[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201008124604.05db39e8@carbon>
Date: Thu, 8 Oct 2020 12:46:04 +0200
From: Jesper Dangaard Brouer <brouer@...hat.com>
To: Shay Agroskin <shayagr@...zon.com>
Cc: Lorenzo Bianconi <lorenzo@...nel.org>, <bpf@...r.kernel.org>,
<netdev@...r.kernel.org>, <davem@...emloft.net>, <kuba@...nel.org>,
<ast@...nel.org>, <daniel@...earbox.net>, <sameehj@...zon.com>,
<john.fastabend@...il.com>, <dsahern@...nel.org>,
<lorenzo.bianconi@...hat.com>, <echaudro@...hat.com>,
brouer@...hat.com
Subject: Re: [PATCH v4 bpf-next 09/13] bpf: introduce multibuff support to
bpf_prog_test_run_xdp()
On Thu, 8 Oct 2020 11:06:14 +0300
Shay Agroskin <shayagr@...zon.com> wrote:
> Lorenzo Bianconi <lorenzo@...nel.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@...nel.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
Powered by blists - more mailing lists