All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Tom Herbert <tom@herbertland.com>,
	davem@davemloft.net, netdev@vger.kernel.org, kernel-team@fb.com,
	tariqt@mellanox.com, bblanco@plumgrid.com,
	alexei.starovoitov@gmail.com, eric.dumazet@gmail.com,
	brouer@redhat.com, Thomas Graf <tgraf@suug.ch>
Subject: Re: [PATCH RFC 1/3] xdp: Infrastructure to generalize XDP
Date: Fri, 23 Sep 2016 15:00:40 +0200	[thread overview]
Message-ID: <20160923150040.0e3dc7d5@redhat.com> (raw)
In-Reply-To: <06280af8-5451-c423-d295-a5f3f51e63cf@mojatatu.com>

On Fri, 23 Sep 2016 07:13:30 -0400
Jamal Hadi Salim <jhs@mojatatu.com> wrote:

> On 16-09-20 06:00 PM, Tom Herbert wrote:
> > This patch creates an infrastructure for registering and running code at
> > XDP hooks in drivers. This is based on the orignal XDP?BPF and borrows
> > heavily from the techniques used by netfilter to make generic nfhooks.
> >
> > An XDP hook is defined by the  xdp_hook_ops. This structure contains the
> > ops of an XDP hook. A pointer to this structure is passed into the XDP
> > register function to set up a hook. The XDP register function mallocs
> > its own xdp_hook_ops structure and copies the values from the
> > xdp_hook_ops passed in. The register function also stores the pointer
> > value of the xdp_hook_ops argument; this pointer is used in subsequently
> > calls to XDP to identify the registered hook.
> >
> > The interface is defined in net/xdp.h. This includes the definition of
> > xdp_hook_ops, functions to register and unregister hook ops on a device
> > or individual instances of napi, and xdp_hook_run that is called by
> > drivers to run the hooks.
> >  
> 
> Tom,
> perused the thread and it seems you are serious ;->
> Are we heading towards Frankenstein Avenue?
> The whole point behind letting in XDP is so that _small programs_
> can be written to do some quick thing. eBPF 4K program limit was
> touted as the check and bound. eBPF sounded fine.
> This sounds like a huge contradiction.
> 
> cheers,
> jamal

Hi Jamal,

I don't understand why you think this is so controversial. The way I
see it (after reading the thread): This is about allowing kernel
components to _also_ use the XDP hook.

I believe Tom have a valid use-case in ILA. The NVE (Network
Virtualization Edge) component very naturally fits in the XDP hook, as
it only need to look at the IPv6 address and do a table lookup (in a
ILA specific data structure) to see if this packet is for local stack
delivery or forward.  For forward it does not need take the performance
hit of allocating SKBs etc.

You can see it as a way to accelerate the NVE component. I can imagine
it could be done in approx 10-20 lines of code, as it would use the
existing ILA lookup function calls.

AFAIK Thomas Graf also see XDP as an acceleration for bpf_cls, but he
is lucky because his code is already eBFP based.

To support Tom's case, with eBPF, I think we would have to implement
specific eBPF helper functions that can do the ILA table lookups.  And
then need a userspace component to load the eBPF program.  Why add all
this, when we could contain all this in the kernel, and simply call
this as native C-code via the XDP hook?

Notice, this is not about throwing eBPF out.  Using eBPF is _very_
essential for XDP.

-- 
Best regards,
  Jesper Dangaard Brouer
  MSc.CS, Principal Kernel Engineer at Red Hat
  Author of http://www.iptv-analyzer.org
  LinkedIn: http://www.linkedin.com/in/brouer

  reply	other threads:[~2016-09-23 13:00 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-20 22:00 [PATCH RFC 0/3] xdp: Generalize XDP Tom Herbert
2016-09-20 22:00 ` [PATCH RFC 1/3] xdp: Infrastructure to generalize XDP Tom Herbert
2016-09-20 22:37   ` Eric Dumazet
2016-09-20 22:40     ` Tom Herbert
2016-09-20 22:44   ` Thomas Graf
2016-09-20 22:49     ` Tom Herbert
2016-09-20 23:09       ` Thomas Graf
2016-09-20 23:18         ` Tom Herbert
2016-09-20 23:43           ` Thomas Graf
2016-09-20 23:59             ` Tom Herbert
2016-09-21  0:13               ` Alexei Starovoitov
2016-09-21 11:55               ` Thomas Graf
2016-09-21 14:19                 ` Tom Herbert
2016-09-21 14:48                   ` Thomas Graf
2016-09-21 15:08                     ` Tom Herbert
2016-09-21 19:56                       ` Jesper Dangaard Brouer
2016-09-22 13:14                         ` Jesper Dangaard Brouer
2016-09-22 14:46                           ` Eric Dumazet
2016-09-21 15:39                   ` Alexei Starovoitov
2016-09-21 17:26                 ` Jakub Kicinski
2016-09-20 23:22         ` Daniel Borkmann
2016-09-21  0:01   ` Alexei Starovoitov
2016-09-21  6:39     ` Jesper Dangaard Brouer
2016-09-21  8:42       ` Daniel Borkmann
2016-09-21 15:44       ` Alexei Starovoitov
2016-09-21 17:26     ` Jakub Kicinski
2016-09-21 17:39       ` Tom Herbert
2016-09-21 18:45         ` Jakub Kicinski
2016-09-21 18:50           ` Tom Herbert
2016-09-21 18:54             ` Jakub Kicinski
2016-09-21 18:58             ` Thomas Graf
2016-09-23 11:13   ` Jamal Hadi Salim
2016-09-23 13:00     ` Jesper Dangaard Brouer [this message]
2016-09-23 14:26       ` Alexei Starovoitov
2016-09-25 11:32       ` Jamal Hadi Salim
2016-09-23 14:14     ` Tom Herbert
2016-09-25 12:29       ` Jamal Hadi Salim
2016-09-20 22:00 ` [PATCH RFC 2/3] mlx4: Change XDP/BPF to use generic XDP infrastructure Tom Herbert
2016-09-20 22:00 ` [PATCH RFC 3/3] netdevice: Remove obsolete xdp_netdev_command Tom Herbert

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=20160923150040.0e3dc7d5@redhat.com \
    --to=brouer@redhat.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=bblanco@plumgrid.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=kernel-team@fb.com \
    --cc=netdev@vger.kernel.org \
    --cc=tariqt@mellanox.com \
    --cc=tgraf@suug.ch \
    --cc=tom@herbertland.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.