BPF List
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: kuba@kernel.org, netdev@vger.kernel.org, bpf@vger.kernel.org,
	bcm-kernel-feedback-list@broadcom.com,
	Andrew Sauber <andrew.sauber@isovalent.com>,
	Anton Protopopov <aspsk@isovalent.com>,
	William Tu <witu@nvidia.com>,
	Martin Zaharinov <micron10@gmail.com>,
	Ronak Doshi <ronak.doshi@broadcom.com>
Subject: Re: [PATCH net] vmxnet3: Fix malformed packet sizing in vmxnet3_process_xdp
Date: Fri, 25 Apr 2025 10:33:37 +0100	[thread overview]
Message-ID: <20250425093337.GN3042781@horms.kernel.org> (raw)
In-Reply-To: <20250423133600.176689-1-daniel@iogearbox.net>

On Wed, Apr 23, 2025 at 03:36:00PM +0200, Daniel Borkmann wrote:
> vmxnet3 driver's XDP handling is buggy for packet sizes using ring0 (that
> is, packet sizes between 128 - 3k bytes).
> 
> We noticed MTU-related connectivity issues with Cilium's service load-
> balancing in case of vmxnet3 as NIC underneath. A simple curl to a HTTP
> backend service where the XDP LB was doing IPIP encap led to overly large
> packet sizes but only for *some* of the packets (e.g. HTTP GET request)
> while others (e.g. the prior TCP 3WHS) looked completely fine on the wire.
> 
> In fact, the pcap recording on the backend node actually revealed that the
> node with the XDP LB was leaking uninitialized kernel data onto the wire
> for the affected packets, for example, while the packets should have been
> 152 bytes their actual size was 1482 bytes, so the remainder after 152 bytes
> was padded with whatever other data was in that page at the time (e.g. we
> saw user/payload data from prior processed packets).
> 
> We only noticed this through an MTU issue, e.g. when the XDP LB node and
> the backend node both had the same MTU (e.g. 1500) then the curl request
> got dropped on the backend node's NIC given the packet was too large even
> though the IPIP-encapped packet normally would never even come close to
> the MTU limit. Lowering the MTU on the XDP LB (e.g. 1480) allowed to let
> the curl request succeed (which also indicates that the kernel ignored the
> padding, and thus the issue wasn't very user-visible).
> 
> Commit e127ce7699c1 ("vmxnet3: Fix missing reserved tailroom") was too eager
> to also switch xdp_prepare_buff() from rcd->len to rbi->len. It really needs
> to stick to rcd->len which is the actual packet length from the descriptor.
> The latter we also feed into vmxnet3_process_xdp_small(), by the way, and
> it indicates the correct length needed to initialize the xdp->{data,data_end}
> parts. For e127ce7699c1 ("vmxnet3: Fix missing reserved tailroom") the
> relevant part was adapting xdp_init_buff() to address the warning given the
> xdp_data_hard_end() depends on xdp->frame_sz. With that fixed, traffic on
> the wire looks good again.
> 
> Fixes: e127ce7699c1 ("vmxnet3: Fix missing reserved tailroom")
> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
> Tested-by: Andrew Sauber <andrew.sauber@isovalent.com>
> Cc: Anton Protopopov <aspsk@isovalent.com>
> Cc: William Tu <witu@nvidia.com>
> Cc: Martin Zaharinov <micron10@gmail.com>
> Cc: Ronak Doshi <ronak.doshi@broadcom.com>

Reviewed-by: Simon Horman <horms@kernel.org>


  reply	other threads:[~2025-04-25  9:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-23 13:36 [PATCH net] vmxnet3: Fix malformed packet sizing in vmxnet3_process_xdp Daniel Borkmann
2025-04-25  9:33 ` Simon Horman [this message]
2025-04-26  0:30 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250425093337.GN3042781@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=andrew.sauber@isovalent.com \
    --cc=aspsk@isovalent.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=kuba@kernel.org \
    --cc=micron10@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=ronak.doshi@broadcom.com \
    --cc=witu@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox