[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKhg4tJg6bP84QnPMwHgYFZhp1S7W3Hm-5M7PE2ATnYt58G=iA@mail.gmail.com>
Date: Thu, 3 Aug 2023 20:17:12 +0800
From: Liang Chen <liangchen.linux@...il.com>
To: Ilias Apalodimas <ilias.apalodimas@...aro.org>
Cc: Jakub Kicinski <kuba@...nel.org>, davem@...emloft.net, edumazet@...gle.com,
pabeni@...hat.com, ast@...nel.org, daniel@...earbox.net,
john.fastabend@...il.com, netdev@...r.kernel.org
Subject: Re: [PATCH net-next] xdp: Fixing skb->pp_recycle flag in generic XDP handling
On Thu, Aug 3, 2023 at 4:59 PM Ilias Apalodimas
<ilias.apalodimas@...aro.org> wrote:
>
> Hi Liang
>
> On Thu, 3 Aug 2023 at 11:26, Liang Chen <liangchen.linux@...il.com> wrote:
> >
> > On Thu, Aug 3, 2023 at 2:37 AM Jakub Kicinski <kuba@...nel.org> wrote:
> > >
> > > On Wed, 2 Aug 2023 15:04:54 +0800 Liang Chen wrote:
> > > > In the generic XDP processing flow, if an skb with a page pool page
> > > > (skb->pp_recycle == 1) fails to meet XDP packet requirements, it will
> > > > undergo head expansion and linearization of fragment data. As a result,
> > > > skb->head points to a reallocated buffer without any fragments. At this
> > > > point, the skb will not contain any page pool pages. However, the
> > > > skb->pp_recycle flag is still set to 1, which is inconsistent with the
> > > > actual situation. Although it doesn't seem to cause much real harm at the
> > > > moment(a little nagetive impact on skb_try_coalesce), to avoid potential
> > > > issues associated with using incorrect skb->pp_recycle information,
> > > > setting skb->pp_recycle to 0 to reflect the pp state of the skb.
> > >
> > > pp_recycle just means that the skb is "page pool aware", there's
> > > absolutely no harm in having an skb with pp_recycle = 1 and no
> > > page pool pages attached.
> >
> > I don't see it causing an error right now either. But it affects
> > skb_try_coalesce in a negative way from a performance perspective -
> > from->pp_recycle can be falsely true leading to a coalescing failure
> > in "(from->pp_recycle && skb_cloned(from))" test, which otherwise
> > would let the coalesce continue if from->pp_recycle was false. I
> > wonder if that justifies the need for a fix.
>
> This applies to non-native XDP code only though, right? IIRC that
> code was to make xdp easier to use but it's not used when xdp-like
> performance is needed.
Sure, this applies to non-native XDP code only. Thanks.
Thanks,
Liang
>
> Thanks
> /Ilias
> >
> > Thanks,
> > Liang
> >
> >
> > >
> > > I vote not to apply this.
Powered by blists - more mailing lists