From: Jiri Pirko <jiri@resnulli.us>
To: Tom Herbert <tom@herbertland.com>
Cc: netdev@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH RFC v2 1/8] xdp: Infrastructure to generalize XDP
Date: Thu, 9 Feb 2017 08:49:35 +0100 [thread overview]
Message-ID: <20170209074935.GA2018@nanopsycho> (raw)
In-Reply-To: <20170208234127.3041579-2-tom@herbertland.com>
Thu, Feb 09, 2017 at 12:41:20AM CET, tom@herbertland.com wrote:
>This patch creates an infrastructure for registering and running code at
>XDP hooks in drivers. This extends and generalizes the original XDP/BPF
>interface. Specifically, it defines a generic xdp_hook structure and a
>set of hooks that can be assigned to devices or napi instances. These
>hooks are also generic to allow for XDP/BPF programs as well as non-BPF
>code (e.g. kernel code can be written in a module).
>
>An XDP hook is defined by the xdp_hook structure. 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 structure and copies
>the values from the xdp_hook passed in. The register function also saves
>the pointer value of the xdp_hook 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, functions to register and unregister hooks on a device
>or individual instances of napi, and xdp_hook_run that is called by
>drivers to run the hooks.
>
>Signed-off-by: Tom Herbert <tom@herbertland.com>
>---
> drivers/net/ethernet/netronome/nfp/nfp_bpf_jit.c | 1 +
> include/linux/filter.h | 10 +-
> include/linux/netdev_features.h | 3 +-
> include/linux/netdevice.h | 16 ++
> include/net/xdp.h | 310 +++++++++++++++++++++++
> include/trace/events/xdp.h | 31 +++
> kernel/bpf/core.c | 1 +
> net/core/Makefile | 2 +-
> net/core/dev.c | 53 ++--
> net/core/filter.c | 1 +
> net/core/rtnetlink.c | 14 +-
> net/core/xdp.c | 304 ++++++++++++++++++++++
> 12 files changed, 711 insertions(+), 35 deletions(-)
> create mode 100644 include/net/xdp.h
> create mode 100644 net/core/xdp.c
>
[...]
>@@ -48,6 +49,36 @@ TRACE_EVENT(xdp_exception,
> __print_symbolic(__entry->act, __XDP_ACT_SYM_TAB))
> );
>
>+/* Temporaray trace function. This will be renamed to xdp_exception after all
typo
>+ * the calling drivers have been patched.
>+ */
next prev parent reply other threads:[~2017-02-09 7:58 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-08 23:41 [PATCH RFC v2 0/8] xdp: Generalize XDP Tom Herbert
2017-02-08 23:41 ` [PATCH RFC v2 1/8] xdp: Infrastructure to generalize XDP Tom Herbert
2017-02-09 7:49 ` Jiri Pirko [this message]
2017-02-09 14:22 ` Mintz, Yuval
2017-02-09 22:17 ` David Miller
2017-02-09 22:26 ` Tom Herbert
2017-02-09 22:34 ` David Miller
2017-02-09 22:45 ` Tom Herbert
2017-02-10 1:42 ` David Miller
2017-02-10 2:29 ` Tom Herbert
2017-02-10 3:33 ` David Miller
2017-02-10 4:55 ` Tom Herbert
2017-02-10 15:12 ` David Miller
2017-02-09 23:08 ` Tom Herbert
2017-02-10 1:48 ` David Miller
2017-02-10 2:30 ` Tom Herbert
2017-02-10 5:42 ` Jason Wang
2017-02-13 2:41 ` [lkp-robot] [xdp] 543d41bf78: INFO:suspicious_RCU_usage kernel test robot
2017-02-13 2:41 ` kernel test robot
2017-02-14 20:31 ` [PATCH RFC v2 1/8] xdp: Infrastructure to generalize XDP Jesper Dangaard Brouer
2017-02-14 20:47 ` Tom Herbert
2017-02-14 21:07 ` Tom Herbert
2017-02-14 22:08 ` Edward Cree
2017-02-14 22:28 ` Tom Herbert
2017-02-14 22:29 ` Jesper Dangaard Brouer
2017-02-08 23:41 ` [PATCH RFC v2 2/8] mlx4: Changes to use generic XDP infrastructure Tom Herbert
2017-02-08 23:41 ` [PATCH RFC v2 3/8] nfp: " Tom Herbert
2017-02-08 23:41 ` [PATCH RFC v2 4/8] qede: " Tom Herbert
2017-02-08 23:41 ` [PATCH RFC v2 5/8] virt_net: " Tom Herbert
2017-02-08 23:41 ` [PATCH RFC v2 6/8] mlx5: " Tom Herbert
2017-02-08 23:41 ` [PATCH RFC v2 7/8] bnxt: " Tom Herbert
2017-02-08 23:41 ` [PATCH RFC v2 8/8] xdp: Cleanup after API changes 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=20170209074935.GA2018@nanopsycho \
--to=jiri@resnulli.us \
--cc=kernel-team@fb.com \
--cc=netdev@vger.kernel.org \
--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.