Article View: linux.kernel.netdev
Article #18768Re: [PATCH net v3] gve: fix checksum state and gso_segs of HW-GRO packets
From: Eric Dumazet
Date: Wed, 18 Nov 2026 21:38
Date: Wed, 18 Nov 2026 21:38
55 lines
11778 bytes
11778 bytes
Le mer. 18 nov. 2026 ร 22:20, Joshua Washington <joshwash@google.com> a รฉcrit :
>
> From: Ankit Garg <nktgrg@google.com>
>
> With HW-GRO enabled, gve_rx_complete_rsc() turns a coalesced packet into
> a GSO skb by setting gso_size, gso_segs and gso_type, but leaves it
> CHECKSUM_UNNECESSARY with th->check as the device wrote it. Unlike
> tcp4_gro_complete() and tcp6_gro_complete() for a SW-GRO packet, it does
> not seed th->check with the TCP pseudo-header checksum or set
> CHECKSUM_PARTIAL.
>
> The GRO stack completes a HW-GRO skb itself only if it holds the skb for
> merging (since commit 5eddb24901ee ("gro: add support of (hw)gro packets
> to gro stack")). Otherwise the skb is delivered as is, e.g. with rx-gro
> off or for a packet that is flushed immediately (e.g. with PSH set). If
> such an skb is forwarded out of a TSO-capable device, netif_needs_gso()
> accepts it as CHECKSUM_UNNECESSARY and the device segments it with a
> bogus checksum seed, so every segment is dropped by the receiver. This
> blackholes forwarded TCP traffic on VMs acting as routers or NAT
> gateways and was observed on VMs in real use.
>
> Fix it in a manner consistent with other drivers with HW-GRO: set the
> network and transport headers and, for packets whose checksum the device
> verified, seed th->check with the pseudo-header checksum and call
> tcp_gro_complete(), passing gso_segs through NAPI_GRO_CB(skb)->count.
> skb->data points at the Ethernet header on the napi_gro_frags() path and
> at the IP header on the header-split and copybreak paths, so account for
> that when setting the network header. Since the header layout now
> matters, tell IPv4 from IPv6 by the EtherType, as qede and bnx2x do,
> rather than by the packet type.
>
> The device only coalesces TCP directly over IPv4 or IPv6, without VLAN
> tags, IPv6 extension headers or encapsulation, so the IP header always
> follows the Ethernet header and the TCP header always follows the IP
> header. The IP and TCP header lengths are read from the packet, so check
> that the headers are in the linear part before using them, and drop the
> packet otherwise.
>
> Also compute gso_segs from the TCP payload length. It was computed from
> skb->data_len, which is 0 for a packet that rx_copybreak copied whole
> into the linear part, leaving such packets with gso_segs 0 and a
> non-zero gso_size. Such small packets usually carry a single segment, so
> deliver a packet with at most one segment of payload as a non-GSO skb.
>
> Fixes: e637c244b954 ("gve: Advertise NETIF_F_GRO_HW instead of NETIF_F_LRO")
> Cc: stable@vger.kernel.org
> Reviewed-by: Jordan Rhee <jordanrhee@google.com>
> Reviewed-by: Praveen Kaligineedi <pkaligineedi@google.com>
> Signed-off-by: Ankit Garg <nktgrg@google.com>
> Signed-off-by: Joshua Washington <joshwash@google.com>
Reviewed-by: Eric Dumazet <edumazet@kernel.org>
Technical Details
Message-ID:
<CAL4WiiqCqjm-OZ0O+KCJTb9UTqH8eXFZpsKZyc=DObM5aYvJ7w@mail.gmail.com>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366468-linux-kernel-netdev=dewy.ruReferences:
<20261118212045.3575303-1-joshwash@google.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!srl.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366468-linux-kernel-netdev=dewy.ru
From: edumazet@kernel.org (Eric Dumazet)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v3] gve: fix checksum state and gso_segs of HW-GRO packets
Date: Wed, 18 Nov 2026 22:38:18 +0100
Organization: Usenet Network
Message-ID: <CAL4WiiqCqjm-OZ0O+KCJTb9UTqH8eXFZpsKZyc=DObM5aYvJ7w@mail.gmail.com>
References: <20261118212045.3575303-1-joshwash@google.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="2703868"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:+jMvr8B4DF518H5JytVvhsJe+Gg= sha256:VEsPfNQVdYZEbKZW+RIJNEPSbJ60mb1KSxlTQS/uezY=
sha1:Zk+wRASQKkCiOuSvx8btb5uJ0wg= sha256:4lsVGlhNVLGjK5uBcbQsDRmNCZ3Psgq6M4+e8eL+0yE=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 222231153E6; Thu, 19 Nov 2026 00:38:56 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.401
X-Spam-Status: No, score=-3.401 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id pRcsLldsovvr;
Thu, 19 Nov 2026 00:38:53 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=104.64.211.4; helo=sin.lore.kernel.org; envelope-from=netdev+bounces-366468-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sin.lore.kernel.org (sin.lore.kernel.org [104.64.211.4])
by mail.dewy.ru (Postfix) with ESMTPS id 7CA621153B6; Thu, 19 Nov 2026 00:38:43 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sin.lore.kernel.org (Postfix) with ESMTP id D98CE1852CE; Wed, 18 Nov 2026 21:38:34 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1795037912;
b=er7/2YJvdbXeOzMkEJmy4RChrMc6TnpFie2cCI5c62iqVD0Glr0bgV7PQuW2hm9j+vor
SJwAfI/dFQoXLtzYGajUoXDNzWS1RyZAXXfKZvXk52zmdWnHmpT1JjvJa9oz0J8MQx451
88zYjpAbt4k9sLMCXL0wcMxEBskCtEndjlUC8NLK2yLYiRdOdKiVJVNSeXeIBpRFOA1TF
t7lFfObXg4JDb1c7+9E06M0zjOhhGs746uG4ac5U34vrKuLPYLIOMjgY1vyhP4cE51jbU
LHFbyTra2NQPAtYyv43zgPFoon4oC55ULy/aICz8EoYIVkUfxEMeSO2FNhFUYI+Hs3A==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795037912;
h=X-Original-To:Received:Received:DKIM-Signature:Received:
X-Gm-Message-State:X-Received:X-Mailing-List:List-Id:List-Post:
List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence:
MIME-Version:References:In-Reply-To:From:Date:
X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:Subject:To:Cc:
Content-Type:Content-Transfer-Encoding;
bh=ekV3Zp9Kv6Gg9Gx28Ixu1oWJqsN2SEzOcocFPzNJ91g=;
b=C4YEt4IFsLeP7QyiB84KtwzAsl25hhFV2GoPCHnP9yiIIDD2HTrKCZRNB6nUGSuqziE2
JP4SlE6lcjUmI/oEJJPHLtpyxIx/2qcqUqUiJRDip2cogKYpSW9RRLY2Alzzmfb8J/q9f
5yxrX3B1tg2iGot5lJMFjFPyVCNtpXAJTo8I4C8r4+FHAydvoSgP5UdAqq+Lzp7y3iO72
yG0DsJi5HiSKl/Ydqr1yA2+o02G6s9qNUhEiEMEGS8iIEnDm3VUrFPYKdO9/VEGbZ1mHe
avemxDxapJhxYT19nkMUZtIzzO8H0xPCMb18+2UHzzZz3AlwhX+IApquTFK2t/MTl0w==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hxiU+muY;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 3F9F8606A33F;
Wed, 18 Nov 2026 21:38:32 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hxiU+muY
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1795037911;
b=SNOLEXFyS+d7IzhYWAwSHoLEzDzMaSljxbC/H1lhQzJeCsdGT3jXeK67vGXUVAcP7xMt
lU+QhlYAKExffdAtNdvydfQRiE1aCDgOlINDYobRKsrcTg/5BUk+Egt/0ydrhYbk9p0HF
eUishkdRc2vGhqgFbEGF9/xqZH25msgI4muNYnMZlVNuQErgXW0GgsX0FmIZx8fqrO7b2
aTROi9iRlRyi3AO0wTLIIB+cI3aMZOw0jLTgraMDWr9fX+A5Jf+tzMtNw1B7ijTwyjlgs
opiA0Ioyxc8XCao5T0Y/6D6WM9hUJbMsQYpdnu59FhUsihFWbLS96W48B21SdOOrWhg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1795037911;
h=Received:DKIM-Signature:Received:X-Gm-Message-State:X-Received:
MIME-Version:References:In-Reply-To:From:Date:
X-Gmail-Original-Message-ID:X-Gm-Features:Message-ID:Subject:To:Cc:
Content-Type:Content-Transfer-Encoding;
bh=ekV3Zp9Kv6Gg9Gx28Ixu1oWJqsN2SEzOcocFPzNJ91g=;
b=DTidqAUlDwc6swNV12TULh4HFE9duxFxOYMbTDBS8BveilTUSvJRfEfgFi1KABMyIHx1
R6ktHcIbUM4IWCtEri9samA4WUvu/zbbiwnf+SJ2iJrda1PdSMKRqfRGzuFIu1F8/CNUl
VDCeZtyVU1GpYryKGqoUEtU6rRkcOT5mtPmIsp+mtVAMMGDH5h6X9jqZlIMnHRC9nkgLi
xw6GuW/QMOGypmfMWdWEsNgXkFGPsjBex76JxLW04g33qJ8ggfS09dSniBhdyaDXgSWDK
cWsRORkIN4iCSJtknWfK9wMaSbSVmKjFb8sQPDru4JGl8PW1uikcODdWcwU0dwiH3Wg==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=hxiU+muY;
arc=none smtp.remote-ip=100.103.45.18
X-Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18])
(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
key-exchange X25519 server-signature ECDSA (prime256v1))
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C81F606A325
for <netdev@vger.kernel.org>; Wed, 18 Nov 2026 21:38:31 +0000 (UTC)
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2C2501F000CD
for <netdev@vger.kernel.org>; Wed, 18 Nov 2026 21:38:31 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
s=k20260515; t=1795037911;
bh=ekV3Zp9Kv6Gg9Gx28Ixu1oWJqsN2SEzOcocFPzNJ91g=;
h=References:In-Reply-To:From:Date:Subject:To:Cc;
b=hxiU+muYb69WGRdZTzbW3rk6CnWtArSw6qLtyQ5RWx/AkKrKO3zuaK+AzJDklsUh6
+XwepY169geDSvKBwoUix+5wtXyFJe95/I4pFbPLACD/ySPnDiY7anccYC2Hanlzf/
H5kQnrOPWQRWHg7fti89kCpKupBcvU6UHM1T5G4CuuJ83j5ko5c+qrnXFAUn1QtKRD
WeH3WF2qjkTV5Dx3E7qkDzXsSzqnuUmDK+g5ABNBbuomUEtC2uwQnYG7rH8weA+k7s
5O6aMhK5vSX66uPXstjQgc5f1PdN4T5EgFkjdRahikjTkDCzoKU5u18dHtVzcA5moz
R+jemDYy60ikw==
X-Received: by mail-oa1-f45.google.com with SMTP id 586e51a60fabf-43bf9548df4so1580455fac.0
for <netdev@vger.kernel.org>; Wed, 18 Nov 2026 13:38:31 -0800 (PST)
X-Gm-Message-State: APuU4Z95El7WqUln6/uvENnOUfVTKkS/Bvji+prZP1tTVq9b9voqopYd
Zn3FfjwMX1DYAJfC+yJsyEV6bItOfzUCgn30e0Flq9ouM2trX0pUQPFEDAOX/27bzs/MkMmL/Rf
QTdU5Pr0JqKijHQXu59G5rj39+WS3CRY=
X-Received: by 2002:a05:6870:8289:b0:4ad:8277:8b2e with SMTP id
586e51a60fabf-4b75e520769mr3695264fac.57.1795037910498; Wed, 18 Nov 2026
13:38:30 -0800 (PST)
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261118212045.3575303-1-joshwash@google.com>
X-Gmail-Original-Message-ID: <CAL4WiiqCqjm-OZ0O+KCJTb9UTqH8eXFZpsKZyc=DObM5aYvJ7w@mail.gmail.com>
X-Gm-Features: AclHuK9AmXzNN2yxUqVfOu_k9nQ29zzu-2-Bzya7Osu9i3xWf3af1oRJEHG5J80
X-Cc: netdev@vger.kernel.org, Harshitha Ramamurthy <hramamurthy@google.com>,
Andrew Lunn <andrew+netdev@lunn.ch>, "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Jordan Rhee <jordanrhee@google.com>,
Ankit Garg <nktgrg@google.com>, Willem de Bruijn <willemb@google.com>, linux-kernel@vger.kernel.org,
stable@vger.kernel.org, Praveen Kaligineedi <pkaligineedi@google.com>