From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Shay Agroskin <shayagr@amazon.com>
Cc: Lorenzo Bianconi <lorenzo@kernel.org>, <bpf@vger.kernel.org>,
<netdev@vger.kernel.org>, <davem@davemloft.net>,
<kuba@kernel.org>, <ast@kernel.org>, <daniel@iogearbox.net>,
<sameehj@amazon.com>, <john.fastabend@gmail.com>,
<dsahern@kernel.org>, <lorenzo.bianconi@redhat.com>,
<echaudro@redhat.com>,
brouer@redhat.com
Subject: Re: [PATCH v4 bpf-next 09/13] bpf: introduce multibuff support to bpf_prog_test_run_xdp()
Date: Thu, 8 Oct 2020 12:46:04 +0200 [thread overview]
Message-ID: <20201008124604.05db39e8@carbon> (raw)
In-Reply-To: <pj41zl362puop5.fsf@u68c7b5b1d2d758.ant.amazon.com>
On Thu, 8 Oct 2020 11:06:14 +0300
Shay Agroskin <shayagr@amazon.com> wrote:
> Lorenzo Bianconi <lorenzo@kernel.org> writes:
>
> > Introduce the capability to allocate a xdp multi-buff in
> > bpf_prog_test_run_xdp routine. This is a preliminary patch to
> > introduce
> > the selftests for new xdp multi-buff ebpf helpers
> >
> > Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> > ---
> > net/bpf/test_run.c | 51 ++++++++++++++++++++++++++++++++++++++--------
> > 1 file changed, 43 insertions(+), 8 deletions(-)
> >
> > diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
> > index bd291f5f539c..ec7286cd051b 100644
> > --- a/net/bpf/test_run.c
> > +++ b/net/bpf/test_run.c
> > @@ -617,44 +617,79 @@ int bpf_prog_test_run_xdp(struct bpf_prog
> > *prog, const union bpf_attr *kattr,
> > {
> > u32 tailroom = SKB_DATA_ALIGN(sizeof(struct
> > skb_shared_info));
> > u32 headroom = XDP_PACKET_HEADROOM;
> > - u32 size = kattr->test.data_size_in;
> > u32 repeat = kattr->test.repeat;
> > struct netdev_rx_queue *rxqueue;
> > + struct skb_shared_info *sinfo;
> > struct xdp_buff xdp = {};
> > + u32 max_data_sz, size;
> > u32 retval, duration;
> > - u32 max_data_sz;
> > + int i, ret, data_len;
> > void *data;
> > - int ret;
> >
> > if (kattr->test.ctx_in || kattr->test.ctx_out)
> > return -EINVAL;
> >
> > - /* XDP have extra tailroom as (most) drivers use full page
> > */
> > max_data_sz = 4096 - headroom - tailroom;
>
> For the sake of consistency, can this 4096 be changed to PAGE_SIZE
> ?
The size 4096 is explicitly use, because the selftest xdp_adjust_tail
expect this, else it will fail on ARCHs with 64K PAGE_SIZE. It also
seems excessive to create 64K packets for testing XDP.
See: tools/testing/selftests/bpf/prog_tests/xdp_adjust_tail.c
> Same as in
> data_len = min_t(int, kattr->test.data_size_in - size,
> PAGE_SIZE);
>
> expression below
--
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-10-08 10:46 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-02 14:41 [PATCH v4 bpf-next 00/13] mvneta: introduce XDP multi-buffer support Lorenzo Bianconi
2020-10-02 14:41 ` [PATCH v4 bpf-next 01/13] xdp: introduce mb in xdp_buff/xdp_frame Lorenzo Bianconi
2020-10-02 14:42 ` [PATCH v4 bpf-next 02/13] xdp: initialize xdp_buff mb bit to 0 in all XDP drivers Lorenzo Bianconi
2020-10-02 14:42 ` [PATCH v4 bpf-next 03/13] net: mvneta: update mb bit before passing the xdp buffer to eBPF layer Lorenzo Bianconi
2020-10-02 14:42 ` [PATCH v4 bpf-next 04/13] xdp: add multi-buff support to xdp_return_{buff/frame} Lorenzo Bianconi
2020-10-02 14:42 ` [PATCH v4 bpf-next 05/13] net: mvneta: add multi buffer support to XDP_TX Lorenzo Bianconi
2020-10-02 14:42 ` [PATCH v4 bpf-next 06/13] bpf: introduce bpf_xdp_get_frags_{count, total_size} helpers Lorenzo Bianconi
2020-10-02 15:36 ` John Fastabend
2020-10-02 16:25 ` Lorenzo Bianconi
2020-10-02 14:42 ` [PATCH v4 bpf-next 07/13] samples/bpf: add bpf program that uses xdp mb helpers Lorenzo Bianconi
2020-10-02 14:42 ` [PATCH v4 bpf-next 08/13] bpf: move user_size out of bpf_test_init Lorenzo Bianconi
2020-10-02 14:42 ` [PATCH v4 bpf-next 09/13] bpf: introduce multibuff support to bpf_prog_test_run_xdp() Lorenzo Bianconi
2020-10-08 8:06 ` Shay Agroskin
2020-10-08 10:46 ` Jesper Dangaard Brouer [this message]
2020-10-02 14:42 ` [PATCH v4 bpf-next 10/13] bpf: test_run: add skb_shared_info pointer in bpf_test_finish signature Lorenzo Bianconi
2020-10-02 14:42 ` [PATCH v4 bpf-next 11/13] bpf: add xdp multi-buffer selftest Lorenzo Bianconi
2020-10-02 14:42 ` [PATCH v4 bpf-next 12/13] net: mvneta: enable jumbo frames for XDP Lorenzo Bianconi
2020-10-02 14:42 ` [PATCH v4 bpf-next 13/13] bpf: cpumap: introduce xdp multi-buff support Lorenzo Bianconi
2020-10-02 15:25 ` [PATCH v4 bpf-next 00/13] mvneta: introduce XDP multi-buffer support John Fastabend
2020-10-02 16:06 ` Lorenzo Bianconi
2020-10-02 18:06 ` John Fastabend
2020-10-05 9:52 ` Jesper Dangaard Brouer
2020-10-05 21:22 ` John Fastabend
2020-10-05 22:24 ` Lorenzo Bianconi
2020-10-06 4:29 ` John Fastabend
2020-10-06 7:30 ` Jesper Dangaard Brouer
2020-10-06 15:28 ` Lorenzo Bianconi
2020-10-08 14:38 ` John Fastabend
2020-10-02 19:53 ` Daniel Borkmann
2020-10-05 15:50 ` Tirthendu Sarkar
2020-10-06 12:39 ` Jubran, Samih
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=20201008124604.05db39e8@carbon \
--to=brouer@redhat.com \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=dsahern@kernel.org \
--cc=echaudro@redhat.com \
--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).