bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 net-next 0/9] mvneta: introduce XDP multi-buffer support
@ 2020-09-03 20:58 Lorenzo Bianconi
  2020-09-03 20:58 ` [PATCH v2 net-next 1/9] xdp: introduce mb in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (10 more replies)
  0 siblings, 11 replies; 42+ messages in thread
From: Lorenzo Bianconi @ 2020-09-03 20:58 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, lorenzo.bianconi, brouer, echaudro, sameehj, kuba,
	john.fastabend, daniel, ast, shayagr

- Finalize XDP multi-buffer support for mvneta driver introducing the
  capability to map non-linear buffers on tx side.
- Introduce multi-buffer bit (mb) in xdp_frame/xdp_buffer to specify if
  shared_info area has been properly initialized.
- Initialize multi-buffer bit (mb) to 0 in all XDP-capable drivers.
- Add multi-buff support to xdp_return_{buff/frame} utility routines.
- Introduce bpf_xdp_adjust_mb_header helper to adjust frame headers moving
  *offset* bytes from/to the second buffer to/from the first one.
  This helper can be used to move headers when the hw DMA SG is not able
  to copy all the headers in the first fragment and split header and data
  pages. A possible use case for bpf_xdp_adjust_mb_header is described
  here [0]
- Introduce bpf_xdp_get_frag_count and bpf_xdp_get_frags_total_size helpers to
  report the total number/size of frags for a given xdp multi-buff.

XDP multi-buffer design principles are described here [1]
For the moment we have not implemented any self-test for the introduced the bpf
helpers. We can address this in a follow up series if the proposed approach
is accepted.

Changes since v1:
- Fix use-after-free in xdp_return_{buff/frame}
- Introduce bpf helpers
- Introduce xdp_mb sample program
- access skb_shared_info->nr_frags only on the last fragment

Changes since RFC:
- squash multi-buffer bit initialization in a single patch
- add mvneta non-linear XDP buff support for tx side

[0] https://netdevconf.info/0x14/session.html?talk-the-path-to-tcp-4k-mtu-and-rx-zerocopy
[1] https://github.com/xdp-project/xdp-project/blob/master/areas/core/xdp-multi-buffer01-design.org

Lorenzo Bianconi (7):
  xdp: introduce mb in xdp_buff/xdp_frame
  xdp: initialize xdp_buff mb bit to 0 in all XDP drivers
  net: mvneta: update mb bit before passing the xdp buffer to eBPF layer
  xdp: add multi-buff support to xdp_return_{buff/frame}
  net: mvneta: add multi buffer support to XDP_TX
  bpf: helpers: add bpf_xdp_adjust_mb_header helper
  net: mvneta: enable jumbo frames for XDP

Sameeh Jubran (2):
  bpf: helpers: add multibuffer support
  samples/bpf: add bpf program that uses xdp mb helpers

 drivers/net/ethernet/amazon/ena/ena_netdev.c  |   1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c |   1 +
 .../net/ethernet/cavium/thunder/nicvf_main.c  |   1 +
 .../net/ethernet/freescale/dpaa2/dpaa2-eth.c  |   1 +
 drivers/net/ethernet/intel/i40e/i40e_txrx.c   |   1 +
 drivers/net/ethernet/intel/ice/ice_txrx.c     |   1 +
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |   1 +
 .../net/ethernet/intel/ixgbevf/ixgbevf_main.c |   1 +
 drivers/net/ethernet/marvell/mvneta.c         | 126 ++++++------
 .../net/ethernet/marvell/mvpp2/mvpp2_main.c   |   1 +
 drivers/net/ethernet/mellanox/mlx4/en_rx.c    |   1 +
 .../net/ethernet/mellanox/mlx5/core/en_rx.c   |   1 +
 .../ethernet/netronome/nfp/nfp_net_common.c   |   1 +
 drivers/net/ethernet/qlogic/qede/qede_fp.c    |   1 +
 drivers/net/ethernet/sfc/rx.c                 |   1 +
 drivers/net/ethernet/socionext/netsec.c       |   1 +
 drivers/net/ethernet/ti/cpsw.c                |   1 +
 drivers/net/ethernet/ti/cpsw_new.c            |   1 +
 drivers/net/hyperv/netvsc_bpf.c               |   1 +
 drivers/net/tun.c                             |   2 +
 drivers/net/veth.c                            |   1 +
 drivers/net/virtio_net.c                      |   2 +
 drivers/net/xen-netfront.c                    |   1 +
 include/net/xdp.h                             |  26 ++-
 include/uapi/linux/bpf.h                      |  39 +++-
 net/core/dev.c                                |   1 +
 net/core/filter.c                             |  93 +++++++++
 net/core/xdp.c                                |  40 ++++
 samples/bpf/Makefile                          |   3 +
 samples/bpf/xdp_mb_kern.c                     |  68 +++++++
 samples/bpf/xdp_mb_user.c                     | 182 ++++++++++++++++++
 tools/include/uapi/linux/bpf.h                |  40 +++-
 32 files changed, 572 insertions(+), 70 deletions(-)
 create mode 100644 samples/bpf/xdp_mb_kern.c
 create mode 100644 samples/bpf/xdp_mb_user.c

-- 
2.26.2


^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2020-09-09 20:52 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-03 20:58 [PATCH v2 net-next 0/9] mvneta: introduce XDP multi-buffer support Lorenzo Bianconi
2020-09-03 20:58 ` [PATCH v2 net-next 1/9] xdp: introduce mb in xdp_buff/xdp_frame Lorenzo Bianconi
2020-09-04  1:07   ` Alexei Starovoitov
2020-09-04  7:19     ` Jesper Dangaard Brouer
2020-09-04 15:15       ` David Ahern
2020-09-04 15:59         ` Jesper Dangaard Brouer
2020-09-04 16:30           ` David Ahern
2020-09-07 18:02             ` Jesper Dangaard Brouer
2020-09-08  1:22               ` David Ahern
2020-09-03 20:58 ` [PATCH v2 net-next 2/9] xdp: initialize xdp_buff mb bit to 0 in all XDP drivers Lorenzo Bianconi
2020-09-04  7:35   ` Jesper Dangaard Brouer
2020-09-04  7:54     ` Lorenzo Bianconi
2020-09-03 20:58 ` [PATCH v2 net-next 3/9] net: mvneta: update mb bit before passing the xdp buffer to eBPF layer Lorenzo Bianconi
2020-09-06  7:33   ` Shay Agroskin
2020-09-06  9:05     ` Lorenzo Bianconi
2020-09-03 20:58 ` [PATCH v2 net-next 4/9] xdp: add multi-buff support to xdp_return_{buff/frame} Lorenzo Bianconi
2020-09-03 20:58 ` [PATCH v2 net-next 5/9] net: mvneta: add multi buffer support to XDP_TX Lorenzo Bianconi
2020-09-06  7:20   ` Shay Agroskin
2020-09-06  8:43     ` Lorenzo Bianconi
2020-09-03 20:58 ` [PATCH v2 net-next 6/9] bpf: helpers: add bpf_xdp_adjust_mb_header helper Lorenzo Bianconi
2020-09-04  1:09   ` Alexei Starovoitov
2020-09-04  8:07     ` Lorenzo Bianconi
2020-09-04  1:13   ` Alexei Starovoitov
2020-09-04  7:50     ` Lorenzo Bianconi
2020-09-04 13:52       ` Jesper Dangaard Brouer
2020-09-04 14:27         ` Lorenzo Bianconi
2020-09-04  6:47   ` John Fastabend
2020-09-04  9:45     ` Lorenzo Bianconi
2020-09-04 15:23       ` John Fastabend
2020-09-06 13:36         ` Lorenzo Bianconi
2020-09-08 19:57           ` John Fastabend
2020-09-08 21:31             ` Lorenzo Bianconi
2020-09-09 20:51               ` Lorenzo Bianconi
2020-09-03 20:58 ` [PATCH v2 net-next 7/9] bpf: helpers: add multibuffer support Lorenzo Bianconi
2020-09-03 21:24   ` Maciej Fijalkowski
2020-09-04  9:47     ` Lorenzo Bianconi
2020-09-03 20:58 ` [PATCH v2 net-next 8/9] samples/bpf: add bpf program that uses xdp mb helpers Lorenzo Bianconi
2020-09-03 20:58 ` [PATCH v2 net-next 9/9] net: mvneta: enable jumbo frames for XDP Lorenzo Bianconi
2020-09-04  1:08 ` [PATCH v2 net-next 0/9] mvneta: introduce XDP multi-buffer support Alexei Starovoitov
2020-09-04  7:40   ` Lorenzo Bianconi
2020-09-04  5:41 ` John Fastabend
2020-09-04  7:39   ` Lorenzo Bianconi

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).