[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAMOZA0+R6GK1GGCb=mij7uffso5K_Db5wkWq-URwCsTYoqkxEg@mail.gmail.com>
Date: Fri, 24 Jan 2020 07:04:50 -0800
From: Luigi Rizzo <lrizzo@...gle.com>
To: Jakub Kicinski <kuba@...nel.org>
Cc: Daniel Borkmann <daniel@...earbox.net>, netdev@...r.kernel.org,
Jesper Dangaard Brouer <hawk@...nel.org>,
"David S. Miller" <davem@...emloft.net>, sameehj@...zon.com,
Toke Høiland-Jørgensen <toke@...hat.com>
Subject: Re: [PATCH net-next] v2 net-xdp: netdev attribute to control
xdpgeneric skb linearization
On Fri, Jan 24, 2020 at 6:52 AM Jakub Kicinski <kuba@...nel.org> wrote:
>
> On Fri, 24 Jan 2020 10:55:19 +0100, Daniel Borkmann wrote:
> > > diff --git a/net/core/dev.c b/net/core/dev.c
> > > index 4dcc1b390667..13a671e45b61 100644
> > > --- a/net/core/dev.c
> > > +++ b/net/core/dev.c
> > > @@ -4484,8 +4484,8 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb,
> > > * of XDP_PACKET_HEADROOM bytes. This is the guarantee that also
> > > * native XDP provides, thus we need to do it here as well.
> > > */
> > > - if (skb_is_nonlinear(skb) ||
> > > - skb_headroom(skb) < XDP_PACKET_HEADROOM) {
> > > + if (skb->dev->xdp_linearize && (skb_is_nonlinear(skb) ||
> > > + skb_headroom(skb) < XDP_PACKET_HEADROOM)) {
> > > int hroom = XDP_PACKET_HEADROOM - skb_headroom(skb);
> > > int troom = skb->tail + skb->data_len - skb->end;
> >
> > I still think in order for this knob to be generally useful, we would need to
> > provide an equivalent of bpf_skb_pull_data() helper, which in generic XDP would then
> > pull in more data from non-linear section, and in native XDP would be a "no-op" since
> > the frame is already linear. Otherwise, as mentioned in previous thread, users would
> > have no chance to examine headers if they are not pre-pulled by the driver.
>
> Which takes us to the point of the ongoing work to allow multi-buffer
> frames in native mode. Sorry if this was already mentioned but this
> seems like the other side of the same coin, once we have multi-buffer
> semantics in native mode we can likely just replicate them for skbs, no?
Yes I am aware of that discussion (I posted links to it in some of the
previous messages).
My understanding is that there is no satisfactory solution, and the one effort
I am aware of seems to be "only pass the header".
My feeling is also that by implementing full multi-buffer support we end up
replicating the expensive part of the skb (dmasync, sg handling etc.),
at which point the benefits of a custom solution are largely gone.
cheers
luigi
Powered by blists - more mailing lists