Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp3591256pxb; Mon, 21 Feb 2022 01:13:13 -0800 (PST) X-Google-Smtp-Source: ABdhPJxiLQxeiuaxCJfzVjE6kAYZdNM7bbx8o5XhW2S4HfzG/ZtfpAP2y5GsWUHXfyRjsdbExlsg X-Received: by 2002:a17:902:a9c7:b0:14f:c587:2bf0 with SMTP id b7-20020a170902a9c700b0014fc5872bf0mr2388033plr.101.1645434793542; Mon, 21 Feb 2022 01:13:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645434793; cv=none; d=google.com; s=arc-20160816; b=iqVHZ85Lzeyz7ovNF+eedo//vNcbP9LO7I4gAlSv3PFbXnNjdPYZQCBHYOySxn4hf4 0bMkF8Hmry6fhJN4FliJetpBAfIm6PkWqI0cA3fg3w0HXTwleKE+Ym1EcVPKFRxHjdLq FBOJ1I6x6LdYPbYEbWCWuUj1sJf+SPJUbcblrfCAkpFtteAB0roK+VXoJJ390xA412Lt hWfL4O3H2uzi3YaxsC0h/e81HwJ5Cq3silpDZPTeVZXXEl3qBPsrW0L6PqlId1Z/99HP gubrTPNDM7wxw5mriYSBuSMvAln9YgEad7uj74Jtn9kLDUIekQ/LxZr8PSihCeOmA2tX eXqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=JYnP3q7TXlLUy1XLn2m5CwnhR2OGlO525rdZ+tITisc=; b=SZHACPlRZ7N83Ri6kStulTwJSdyRXgAuoLk9Fh4qcbPb4osf8IxDYxRaWLuD/RtQw/ 7mnkeBQw9mmZO3gjBzQzod914kigLoZbbUCfNojbcuMlb2RgSjdETLReZ1S+4JxI98fu 7YDsuvNY82vc9k1lOoUPccjM3+S0A6TIEfKsOYh0P85ZPbu+hLsKHC3XcZCUWEcEmk1Q 4ciZjTF2goM0z8sHoRGXO4Kc1VcudliFxaBvBoP7jGv5fCvkHNXUN7DrKYPcdDoxZQWG YHWsX8XBSiaRn1YgDk34LDHz98skNd+3iIAomjRvri2udXqfQyu1+MmltsFHf9FIgIpV 9vSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Rw9l43W0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d71si17307146pga.612.2022.02.21.01.13.00; Mon, 21 Feb 2022 01:13:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Rw9l43W0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235857AbiBTQcn (ORCPT + 99 others); Sun, 20 Feb 2022 11:32:43 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:37288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234610AbiBTQck (ORCPT ); Sun, 20 Feb 2022 11:32:40 -0500 Received: from mail-vs1-xe2d.google.com (mail-vs1-xe2d.google.com [IPv6:2607:f8b0:4864:20::e2d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62AFAE6B for ; Sun, 20 Feb 2022 08:32:19 -0800 (PST) Received: by mail-vs1-xe2d.google.com with SMTP id w4so15195813vsq.1 for ; Sun, 20 Feb 2022 08:32:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JYnP3q7TXlLUy1XLn2m5CwnhR2OGlO525rdZ+tITisc=; b=Rw9l43W0JdjL2vZDCqx1F2qjFrPh47g8mOhG3tGA5e1RK+tcalXRWqm+PTqL2/AIO2 BhwbQpf7T1ZW6RqmPlmJ67BrMaxq/r2qD/ngnHgmeYlcOkMIwYgAqJrJuduKI3eDE6x3 JLhwo9gNsZDZ6p12l5sDYPcggA1un2YorDmxyd7GGTGWF3B6RWvXzc5A1Y4Vfhx5jOIX G4fKtya8iHPmIrIthhnYUo1eeq+2djuAdxzXyJdmeEuXf21UylC0aDu8NGWwvqkQjF1s SGdiW+zt0A+MHJhLgxU+hHGt8WWKY6jxYPgzz0VLJaDOEP6n1IFykDR1u7x+NH9Q2pNQ BMtg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JYnP3q7TXlLUy1XLn2m5CwnhR2OGlO525rdZ+tITisc=; b=RwMBlP3L6EJtK2k7m6nzn8OkinZyiLG9tPaV7ezeJTsfQX6OMMf8d/fGEFG+HudrLa H2K+bWgMq+ezqrPYXiNE4om5ZQ+tfuM3XMaUgoidhn984z+8CCOeswvgb+ER04f+87JR qpOmZ8o32vG0viMus3t4/K2JikQSel/6AN30xGCJweBTAcB81aq+WYyuu5hVI8zBtILZ r88UOk8kjyC/dcHtm9wtdydiqLwlYGMno8ZJBn4Ytp8vViJkyediqr05EerKCsR+y+/8 pA/e/3/zpkxGd786sLAOGa4D/oSAY9joZ9w8xEChgx9GgdDfl7kgTPAm2me9iN9Eq5ma T7Ew== X-Gm-Message-State: AOAM533dUwBbA5/6yrq1furotTOUqEPipF1b12cOzx4QmP32Z7PesGIc my8LG1IsWOsVyZFfvqs10LcdbN8mOO4= X-Received: by 2002:a67:ecc6:0:b0:31c:33d2:8f6b with SMTP id i6-20020a67ecc6000000b0031c33d28f6bmr1576707vsp.46.1645374738459; Sun, 20 Feb 2022 08:32:18 -0800 (PST) Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com. [209.85.217.48]) by smtp.gmail.com with ESMTPSA id k5sm84720vkb.23.2022.02.20.08.32.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 20 Feb 2022 08:32:17 -0800 (PST) Received: by mail-vs1-f48.google.com with SMTP id e26so15191468vso.3 for ; Sun, 20 Feb 2022 08:32:17 -0800 (PST) X-Received: by 2002:a67:c384:0:b0:31b:6b52:33c7 with SMTP id s4-20020a67c384000000b0031b6b5233c7mr6847946vsj.74.1645374737046; Sun, 20 Feb 2022 08:32:17 -0800 (PST) MIME-Version: 1.0 References: <20220218143524.61642-1-thomas.liu@ucloud.cn> In-Reply-To: <20220218143524.61642-1-thomas.liu@ucloud.cn> From: Willem de Bruijn Date: Sun, 20 Feb 2022 08:31:41 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH net v3] gso: do not skip outer ip header in case of ipip and net_failover To: Tao Liu Cc: davem@davemloft.net, yoshfuji@linux-ipv6.org, dsahern@kernel.org, kuba@kernel.org, edumazet@google.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 18, 2022 at 6:36 AM Tao Liu wrote: > > We encounter a tcp drop issue in our cloud environment. Packet GROed in > host forwards to a VM virtio_net nic with net_failover enabled. VM acts > as a IPVS LB with ipip encapsulation. The full path like: > host gro -> vm virtio_net rx -> net_failover rx -> ipvs fullnat > -> ipip encap -> net_failover tx -> virtio_net tx > > When net_failover transmits a ipip pkt (gso_type = 0x0103, which means > SKB_GSO_TCPV4, SKB_GSO_DODGY and SKB_GSO_IPXIP4), there is no gso > did because it supports TSO and GSO_IPXIP4. But network_header points to > inner ip header. > > Call Trace: > tcp4_gso_segment ------> return NULL > inet_gso_segment ------> inner iph, network_header points to > ipip_gso_segment > inet_gso_segment ------> outer iph > skb_mac_gso_segment > > Afterwards virtio_net transmits the pkt, only inner ip header is modified. > And the outer one just keeps unchanged. The pkt will be dropped in remote > host. > > Call Trace: > inet_gso_segment ------> inner iph, outer iph is skipped > skb_mac_gso_segment > __skb_gso_segment > validate_xmit_skb > validate_xmit_skb_list > sch_direct_xmit > __qdisc_run > __dev_queue_xmit ------> virtio_net > dev_hard_start_xmit > __dev_queue_xmit ------> net_failover > ip_finish_output2 > ip_output > iptunnel_xmit > ip_tunnel_xmit > ipip_tunnel_xmit ------> ipip > dev_hard_start_xmit > __dev_queue_xmit > ip_finish_output2 > ip_output > ip_forward > ip_rcv > __netif_receive_skb_one_core > netif_receive_skb_internal > napi_gro_receive > receive_buf > virtnet_poll > net_rx_action > > The root cause of this issue is specific with the rare combination of > SKB_GSO_DODGY and a tunnel device that adds an SKB_GSO_ tunnel option. > SKB_GSO_DODGY is set from external virtio_net. We need to reset network > header when callbacks.gso_segment() returns NULL. > > This patch also includes ipv6_gso_segment(), considering SIT, etc. > > Fixes: cb32f511a70b ("ipip: add GSO/TSO support") > Signed-off-by: Tao Liu Reviewed-by: Willem de Bruijn