From: Jesper Dangaard Brouer <brouer@redhat.com>
To: David Ahern <dsahern@gmail.com>
Cc: Alexei Starovoitov <alexei.starovoitov@gmail.com>,
Lorenzo Bianconi <lorenzo@kernel.org>,
netdev@vger.kernel.org, bpf@vger.kernel.org, davem@davemloft.net,
lorenzo.bianconi@redhat.com, echaudro@redhat.com,
sameehj@amazon.com, kuba@kernel.org, john.fastabend@gmail.com,
daniel@iogearbox.net, ast@kernel.org, shayagr@amazon.com,
David Ahern <dsahern@kernel.org>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
brouer@redhat.com
Subject: Re: [PATCH v2 net-next 1/9] xdp: introduce mb in xdp_buff/xdp_frame
Date: Mon, 7 Sep 2020 20:02:45 +0200 [thread overview]
Message-ID: <20200907200245.0cdb63f1@carbon> (raw)
In-Reply-To: <107260d3-1fea-b582-84d3-2d092f3112b1@gmail.com>
On Fri, 4 Sep 2020 10:30:48 -0600
David Ahern <dsahern@gmail.com> wrote:
> On 9/4/20 9:59 AM, Jesper Dangaard Brouer wrote:
> >> dev_rx for example seems like it could just be the netdev
> >> index rather than a pointer or perhaps can be removed completely. I
> >> believe it is only used for 1 use case (redirects to CPUMAP); maybe that
> >> code can be refactored to handle the dev outside of xdp_frame.
> >
> > The dev_rx is needed when creating an SKB from a xdp_frame (basically
> > skb->dev = rx_dev). Yes, that is done in cpumap, but I want to
> > generalize this. The veth also creates SKBs from xdp_frame, but use
> > itself as skb->dev.
> >
> > And yes, we could save some space storing the index instead, and trade
> > space for cycles in a lookup.
>
> I think this can be managed without adding a reference to the xdp_frame.
> I'll start a separate thread on that.
>
> >>
> >> As for frame_sz, why does it need to be larger than a u16?
> >
> > Because PAGE_SIZE can be 64KiB on some archs.
> >
I also believe syzbot managed to create packets for generic-XDP with
frame_sz 128KiB, which was a bit weird (it's on my todo list to
investigate and fix).
> ok, is there any alignment requirement? can frame_sz be number of 32-bit
> words? I believe bit shifts are cheap.
No that is not possible, because some drivers and generic-XDP have a
fully dynamic frame_sz.
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
next prev parent reply other threads:[~2020-09-07 18:03 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-03 20:58 [PATCH v2 net-next 0/9] mvneta: introduce XDP multi-buffer support Lorenzo Bianconi
2020-09-03 20:58 ` [PATCH v2 net-next 1/9] xdp: introduce mb in xdp_buff/xdp_frame Lorenzo Bianconi
2020-09-04 1:07 ` Alexei Starovoitov
2020-09-04 7:19 ` Jesper Dangaard Brouer
2020-09-04 15:15 ` David Ahern
2020-09-04 15:59 ` Jesper Dangaard Brouer
2020-09-04 16:30 ` David Ahern
2020-09-07 18:02 ` Jesper Dangaard Brouer [this message]
2020-09-08 1:22 ` David Ahern
2020-09-03 20:58 ` [PATCH v2 net-next 2/9] xdp: initialize xdp_buff mb bit to 0 in all XDP drivers Lorenzo Bianconi
2020-09-04 7:35 ` Jesper Dangaard Brouer
2020-09-04 7:54 ` Lorenzo Bianconi
2020-09-03 20:58 ` [PATCH v2 net-next 3/9] net: mvneta: update mb bit before passing the xdp buffer to eBPF layer Lorenzo Bianconi
2020-09-06 7:33 ` Shay Agroskin
2020-09-06 9:05 ` Lorenzo Bianconi
2020-09-03 20:58 ` [PATCH v2 net-next 4/9] xdp: add multi-buff support to xdp_return_{buff/frame} Lorenzo Bianconi
2020-09-03 20:58 ` [PATCH v2 net-next 5/9] net: mvneta: add multi buffer support to XDP_TX Lorenzo Bianconi
2020-09-06 7:20 ` Shay Agroskin
2020-09-06 8:43 ` Lorenzo Bianconi
2020-09-03 20:58 ` [PATCH v2 net-next 6/9] bpf: helpers: add bpf_xdp_adjust_mb_header helper Lorenzo Bianconi
2020-09-04 1:09 ` Alexei Starovoitov
2020-09-04 8:07 ` Lorenzo Bianconi
2020-09-04 1:13 ` Alexei Starovoitov
2020-09-04 7:50 ` Lorenzo Bianconi
2020-09-04 13:52 ` Jesper Dangaard Brouer
2020-09-04 14:27 ` Lorenzo Bianconi
2020-09-04 6:47 ` John Fastabend
2020-09-04 9:45 ` Lorenzo Bianconi
2020-09-04 15:23 ` John Fastabend
2020-09-06 13:36 ` Lorenzo Bianconi
2020-09-08 19:57 ` John Fastabend
2020-09-08 21:31 ` Lorenzo Bianconi
2020-09-09 20:51 ` Lorenzo Bianconi
2020-09-03 20:58 ` [PATCH v2 net-next 7/9] bpf: helpers: add multibuffer support Lorenzo Bianconi
2020-09-03 21:24 ` Maciej Fijalkowski
2020-09-04 9:47 ` Lorenzo Bianconi
2020-09-03 20:58 ` [PATCH v2 net-next 8/9] samples/bpf: add bpf program that uses xdp mb helpers Lorenzo Bianconi
2020-09-03 20:58 ` [PATCH v2 net-next 9/9] net: mvneta: enable jumbo frames for XDP Lorenzo Bianconi
2020-09-04 1:08 ` [PATCH v2 net-next 0/9] mvneta: introduce XDP multi-buffer support Alexei Starovoitov
2020-09-04 7:40 ` Lorenzo Bianconi
2020-09-04 5:41 ` John Fastabend
2020-09-04 7:39 ` Lorenzo Bianconi
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=20200907200245.0cdb63f1@carbon \
--to=brouer@redhat.com \
--cc=alexei.starovoitov@gmail.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsahern@gmail.com \
--cc=dsahern@kernel.org \
--cc=echaudro@redhat.com \
--cc=ilias.apalodimas@linaro.org \
--cc=john.fastabend@gmail.com \
--cc=kuba@kernel.org \
--cc=lorenzo.bianconi@redhat.com \
--cc=lorenzo@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=sameehj@amazon.com \
--cc=shayagr@amazon.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;
as well as URLs for NNTP newsgroup(s).