[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250724095108.186fe3a1@kernel.org>
Date: Thu, 24 Jul 2025 09:51:08 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Mohsin Bashir <mohsin.bashr@...il.com>
Cc: Maciej Fijalkowski <maciej.fijalkowski@...el.com>,
netdev@...r.kernel.org, alexanderduyck@...com, andrew+netdev@...n.ch,
davem@...emloft.net, edumazet@...gle.com, pabeni@...hat.com,
horms@...nel.org, vadim.fedorenko@...ux.dev, jdamato@...tly.com,
sdf@...ichev.me, aleksander.lobakin@...el.com, ast@...nel.org,
daniel@...earbox.net, hawk@...nel.org, john.fastabend@...il.com
Subject: Re: [PATCH net-next 5/9] eth: fbnic: Add XDP pass, drop, abort
support
On Thu, 24 Jul 2025 08:47:20 -0700 Mohsin Bashir wrote:
> >> + if (xdp_buff_has_frags(&pkt->buff) && !xdp_prog->aux->xdp_has_frags)
> >> + return ERR_PTR(-FBNIC_XDP_LEN_ERR);
> >
> > when can this happen and couldn't you catch this within ndo_bpf? i suppose
> > it's related to hds setup.
>
> It is important to avoid passing a packet with frags to a single-buff
> XDP program. The implication being that a single-buff XDP program would
> fail to access packet linearly. For example, we can send a jumbo UDP
> packet to the SUT with a single-buffer XDP program attached and in the
> XDP program, attempt to access payload linearly.
>
> I believe handling this case within ndo_bpf may not be possible.
Herm, we are handling it in ndo_bpf..
This check is just a safety in case somehow we get a packet larger
than MTU, and therefore crossing the "safe" HDS threshold.
Powered by blists - more mailing lists