Re: [PATCH net] bnxt: fix head underflow on XDP head-grow
From: Joe Damato
Date: Tue Jun 09 2026 - 13:35:21 EST
On Tue, Jun 09, 2026 at 10:22:12AM -0700, Joe Damato wrote:
> On Tue, Jun 09, 2026 at 09:44:17AM -0700, Michael Chan wrote:
> > On Tue, Jun 9, 2026 at 7:51 AM Joe Damato <joe@xxxxxxx> wrote:
> > >
> > > On Mon, Jun 08, 2026 at 09:22:07PM -0700, Michael Chan wrote:
> > > > On Mon, Jun 8, 2026 at 1:31 PM Joe Damato <joe@xxxxxxx> wrote:
> > > > >
> > > > > To fix this, we need to do a bit of math to recover the offset if this
> > > > > is a page fragment since it is not passed into rx_skb_func
> > > > > (bnxt_rx_multi_page_skb, in this case).
> > > >
> > > > I wonder if we should add an offset field to struct bnxt_sw_rx_bd to
> > > > simplify things for page mode. Struct bnxt_sw_rx_agg_bd has the
> > > > offset field for a similar purpose. Thanks.
> > >
> > > I don't mind doing that, but I wonder if that's better material for net-next?
> > >
> > > In other words, we get the minimal fix in (this patch?) and then do the
> > > cleanup and struct tweaking as a follow-up in net-next?
> > >
> > > I could definitely be wrong; I had just assumed patches for net were supposed
> > > to be as minimal as possible.
> >
> > I think some minor refactoring/struct changes to make the fix
> > cleaner/simpler should be fine for -net. I think the total number of
> > line changes should be about the same either way.
>
> OK. Are you OK with changing the signature of rx_skb_func? I was going to add
> offset as an argument so it can be passed through.
Oh, actually nevermind. I think once offset is store in the struct we can
derive like this?
frag_start = page_address(page) + rxr->rx_buf_ring[cons].offset;
And then the signature doesn't need to change.