Article View: linux.kernel.netdev
Article #18661Re: [PATCH net-next v2 1/2] ipvlan: fix RX byte accounting for local traffic
From: Simon Horman
Date: Wed, 18 Nov 2026 17:43
Date: Wed, 18 Nov 2026 17:43
30 lines
9003 bytes
9003 bytes
On Thu, Nov 12, 2026 at 10:56:18AM +0800, Xia Yan wrote:
> For traffic between ipvlan devices on the same lower device,
> skb->len already includes the Ethernet header. Adding ETH_HLEN
> again in ipvlan_rcv_frame() overcounts rx_bytes by 14 bytes per
> packet. ipvlan_process_multicast() does the same for local broadcast
> and multicast traffic.
>
> Packets received from the lower device have had the Ethernet header
> pulled by eth_type_trans(), so their counters still need ETH_HLEN.
>
> Use the existing local and tx_pkt flags to distinguish these paths.
>
> Found during a code review of the ipvlan receive paths.
>
> Sending five IPv4 UDP packets with 32-byte payloads between ipvlan
> devices in separate network namespaces increases rx_bytes by 440
> instead of 370. With this change the count is 370. External RX byte
> counts are unchanged in the same tests.
>
> Tested before and after the change with custom IPv4 and IPv6 UDP
> tests in UML, covering L2 unicast, broadcast and joined multicast,
> and L3 unicast.
>
> Fixes: 2ad7bf363841 ("ipvlan: Initial check-in of the IPVLAN driver.")
> Signed-off-by: Xia Yan <yanxia@cmss.chinamobile.com>
I agree that net-next is an appropriate target for this change.
Reviewed-by: Simon Horman <horms@kernel.org>
Technical Details
Message-ID:
<20261118174324.GM860048@horms.kernel.org>Path:
mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366311-linux-kernel-netdev=dewy.ruReferences:
<20261112025619.563195-1-yanxia@cmss.chinamobile.com> <20261112025619.563195-2-yanxia@cmss.chinamobile.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-lax.pugleaf.net!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-366311-linux-kernel-netdev=dewy.ru From: horms@kernel.org (Simon Horman) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net-next v2 1/2] ipvlan: fix RX byte accounting for local traffic Date: Wed, 18 Nov 2026 17:43:24 +0000 Organization: Usenet Network Message-ID: <20261118174324.GM860048@horms.kernel.org> References: <20261112025619.563195-1-yanxia@cmss.chinamobile.com> <20261112025619.563195-2-yanxia@cmss.chinamobile.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="2653776"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:eX3hlMmcbqchkCO5PZr5EfpTb/w= sha256:XH6VbvtmdysdqVlGlOBSj47dUciiOesYaxUTwMgjmWM= sha1:uOZRPPI2I+nQpbVZ8/U3mVLmDFI= sha256:hlMQbZbm4+SC4TLkxsMeiuq9tE2ltSlCt+rc3uUk4QE= Content-Disposition: inline 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 73DB211534F; Wed, 18 Nov 2026 20:43:50 +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 vaoIf8HfXVVO; Wed, 18 Nov 2026 20:43:47 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-366311-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 sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id E109011534E; Wed, 18 Nov 2026 20:43:38 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id D18928679B; Wed, 18 Nov 2026 17:43:29 +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=1795023809; b=umDvROYV1UntU5bTuZr2DgkT1OkUSPwrTysIcnwYC/ns+kHt44VhWFABzl9FX0SoFiUv 096m5DHdex8KaCweKI7P6sZ12jJh7xQWa8Mmz1peYb7C+OCqDYf7oZmcapEqdzXcc8uUN w1tPHcAKog8LhQtx0TqwYYfs0HEFiyMErDIRDe0ixrgxVSyRxdtr0hJZtWm1aUd4zWJHO HkkBZwMoneTMQloLk3ZSfC+F1F+qdCkbYgtV30Pv+wH1vX+vgveIJxyPpZHYNb8yCz13x 6Npt8jVgvzlUboyzeKtg8ul59XqeMFWea3zDjPmSSb2E5+za7h2ybdQRVj7q4mVF8Lg== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795023809; h=X-Original-To:Received:Received:DKIM-Signature:Date:From:To:Cc: Subject:Message-ID:References:X-Mailing-List:List-Id:List-Post: List-Help:List-Subscribe:List-Unsubscribe:List-Owner:Precedence: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=uPLl3xwpgDX5H1PdVBFmf+WBUvg+VbeEZCbLUMxn+3Y=; b=BV8IkFxB0tiDd6jOwUD2s97Yqec9noquWc37U4o6T87BqxJi3kvzyV6bemFI6d9ulj/m VE5AOqWy4k5jR1G8CrnC2tmh6JQpftp2+6RHIRwoeMT/nPg/l56F8OKfd7HQfQbSPQKW8 sESaGY0JsLhBgly0zKNImEbYdEsmrDGyp2inQm3d5SeLNPLXUbjkmVcZC9ClOgxe253vh n02R7HXrVdzXnBIwLwTolFtcMpX4Xlbt80XRr1BX+cwD11+97nXssdnUFID3hp6UFfLAh HecI2BRKwaCCxQz/toNL4ENY8aG9cVbufOiB4Pzstss1X8c8SRp5evkvUIVAxeMUMAA== 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=nE9i200m; 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 9914A606A330; Wed, 18 Nov 2026 17:43:29 +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=nE9i200m 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=1795023808; b=XYriY3Vcruv/+FN1dv7fJQod2CcP8H5b3Klijc7/pH9HbqqfgwHcCSrZJdpnXd4wMZeo 1ksg2IwNxpyS50QbrKq8SfM3U0ok/POFRSzpTJWntXDydnglMvD3JvrT+Ny8k0enBNQ0H 6x0OEAk8tsBpxebHvB5DNsgjuBKAu3BaHtTeQ6JzWy8+CBVF7jHfEXT/awFkQ+nFulCEX g0UB2k17UqX+CPY2oIKss503y/d8PiUygW7ejvYD0K4dGfUdW9oHKgEkmG05HWjYSkITj UvQiH1g2dcNf3p6MyndKYa26isWv43hnWsZ/Fjz7abSq5mVhrj/QDbF1Mm3rXmYAbaQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795023808; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=uPLl3xwpgDX5H1PdVBFmf+WBUvg+VbeEZCbLUMxn+3Y=; b=P70USzIBi1WTlgWqYGmZ8ujG1GWnX9yCMFK0e5wXSMg7txk3SSGNl38YkTTkRSW7XKE2 YBbNbXlVobir7rm47GPn0vS8pmqa60u0+lDba+x9UgdZUjqSp9KpZKQUv73P2VwfihuHR tFsGJJYN0zK3zNCmfRrC5yhxNjZhmjrcbTI45TRHsfTHGbiEzFCZcV2J9+7eLWcFxol5s FSy1TXADueIWGYJzHWYf80VhNVLbIgiIRlv8UssGsubWLVEi0gpPQbRH7FvcYvw+BzvXe zfFrd91egu04NJ0VDJSCXCXGt3QZYvae2X3onwXWz6Lv7CWPDyonwYofyGOnlzsd3RA== 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=nE9i200m; 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 B673C606A31C; Wed, 18 Nov 2026 17:43:28 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3D8BB1F000C4; Wed, 18 Nov 2026 17:43:26 +0000 (UTC) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795023808; bh=uPLl3xwpgDX5H1PdVBFmf+WBUvg+VbeEZCbLUMxn+3Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=nE9i200mpUr0zIF5ta/NZZzPNXGiZERkQMGfALDDWmgZ0809RRclIfE7+YvS3eM9g 5zLGpAOYT2juDjSxRoKGgaQWBaskh+jRq8YVsm7N2WIgnFaNuxuIYZezl35wAPoKlg zMzI7cMZPb6KzuNHA/OqrxgQSlxdYwENh7hv8Q4rtISG6/juArsgJK+cBmwm2qPENP oOb0I/wkTVLnfk/KHtGam1uOaBzBQgQbxoC5xJDQOOjRySpeUtu+/M5TKAoZQZrb3d rybfXVrmppMTDcCZXWi/NfOlRkeeOo2zx1CJkRvvZPur8KsGRs5QYujEdvCfk7bc7r eMo4NGUhhOn0Q== X-Cc: netdev@vger.kernel.org, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@kernel.org, kuba@kernel.org, pabeni@redhat.com, maheshb@google.com, arnd@arndb.de, kaber@trash.net, dskr99@gmail.com, linux-kernel@vger.kernel.org, yana06070@163.com 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: <20261112025619.563195-2-yanxia@cmss.chinamobile.com>