From: Jakub Kicinski <kuba@kernel.org>
To: Daniel Borkmann <daniel@iogearbox.net>
Cc: Luigi Rizzo <lrizzo@google.com>,
netdev@vger.kernel.org, Jesper Dangaard Brouer <hawk@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
sameehj@amazon.com, toke@redhat.com
Subject: Re: [PATCH net-next] v2 net-xdp: netdev attribute to control xdpgeneric skb linearization
Date: Fri, 24 Jan 2020 06:52:44 -0800 [thread overview]
Message-ID: <20200124065244.4cafef68@cakuba> (raw)
In-Reply-To: <3a7e66da-7506-47a0-8733-8d48674176f9@iogearbox.net>
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?
next prev parent reply other threads:[~2020-01-24 14:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-23 23:20 [PATCH net-next] v2 net-xdp: netdev attribute to control xdpgeneric skb linearization Luigi Rizzo
2020-01-24 9:55 ` Daniel Borkmann
2020-01-24 14:52 ` Jakub Kicinski [this message]
2020-01-24 15:04 ` Luigi Rizzo
2020-01-24 14:56 ` Luigi Rizzo
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=20200124065244.4cafef68@cakuba \
--to=kuba@kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=hawk@kernel.org \
--cc=lrizzo@google.com \
--cc=netdev@vger.kernel.org \
--cc=sameehj@amazon.com \
--cc=toke@redhat.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