[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20201001114700.6384e6cc@carbon>
Date: Thu, 1 Oct 2020 11:47:00 +0200
From: Jesper Dangaard Brouer <brouer@...hat.com>
To: Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc: Lorenzo Bianconi <lorenzo@...nel.org>, netdev@...r.kernel.org,
bpf@...r.kernel.org, davem@...emloft.net, sameehj@...zon.com,
kuba@...nel.org, john.fastabend@...il.com, daniel@...earbox.net,
ast@...nel.org, shayagr@...zon.com, echaudro@...hat.com,
lorenzo.bianconi@...hat.com, dsahern@...nel.org, brouer@...hat.com
Subject: Re: [PATCH v3 net-next 06/12] bpf: helpers: add multibuffer support
On Wed, 30 Sep 2020 12:11:21 -0700
Alexei Starovoitov <alexei.starovoitov@...il.com> wrote:
> On Wed, Sep 30, 2020 at 05:41:57PM +0200, Lorenzo Bianconi wrote:
> > From: Sameeh Jubran <sameehj@...zon.com>
> >
> > The implementation is based on this [0] draft by Jesper D. Brouer.
First of all I think you are giving me too much credit, and this is
both not really relevant and also not specific enough. The link[0]
contains several proposals (actually from different people) and it is
not clear which of these proposal you reference.
I think this patch need to explain and argue why these BPF-helpers
makes sense... this will become BPF UAPI.
> > Provided two new helpers:
> >
> > * bpf_xdp_get_frag_count()
> > * bpf_xdp_get_frags_total_size()
Why was the "frag" and "frags" name chosen?
> > [0] xdp mb design - https://github.com/xdp-project/xdp-project/blob/master/areas/core/xdp-multi-buffer01-design.org
> > Signed-off-by: Sameeh Jubran <sameehj@...zon.com>
> > Co-developed-by: Lorenzo Bianconi <lorenzo@...nel.org>
> > Signed-off-by: Lorenzo Bianconi <lorenzo@...nel.org>
> > ---
> > include/uapi/linux/bpf.h | 14 ++++++++++++
> > net/core/filter.c | 42 ++++++++++++++++++++++++++++++++++
> > tools/include/uapi/linux/bpf.h | 14 ++++++++++++
> > 3 files changed, 70 insertions(+)
> >
> > diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
> > index a22812561064..6f97dce8cccf 100644
> > --- a/include/uapi/linux/bpf.h
> > +++ b/include/uapi/linux/bpf.h
> > @@ -3586,6 +3586,18 @@ union bpf_attr {
> > * the data in *dst*. This is a wrapper of **copy_from_user**\ ().
> > * Return
> > * 0 on success, or a negative error in case of failure.
> > + *
> > + * int bpf_xdp_get_frag_count(struct xdp_buff *xdp_md)
> > + * Description
> > + * Get the number of fragments for a given xdp multi-buffer.
> > + * Return
> > + * The number of fragments
> > + *
> > + * int bpf_xdp_get_frags_total_size(struct xdp_buff *xdp_md)
> > + * Description
> > + * Get the total size of fragments for a given xdp multi-buffer.
> > + * Return
> > + * The total size of fragments for a given xdp multi-buffer.
> > */
> > #define __BPF_FUNC_MAPPER(FN) \
> > FN(unspec), \
> > @@ -3737,6 +3749,8 @@ union bpf_attr {
> > FN(inode_storage_delete), \
> > FN(d_path), \
> > FN(copy_from_user), \
> > + FN(xdp_get_frag_count), \
> > + FN(xdp_get_frags_total_size), \
> > /* */
>
> Please route the set via bpf-next otherwise merge conflicts will be severe.
>
--
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