mbox series

[v3,bpf-next,0/2] introduce xdp_init_buff/xdp_prepare_buff

Message ID cover.1607794551.git.lorenzo@kernel.org (mailing list archive)
Headers show
Series introduce xdp_init_buff/xdp_prepare_buff | expand

Message

Lorenzo Bianconi Dec. 12, 2020, 5:41 p.m. UTC
Introduce xdp_init_buff and xdp_prepare_buff utility routines to initialize
xdp_buff data structure and remove duplicated code in all XDP capable
drivers.

Changes since v2:
- precompute xdp->data as hard_start + headroom and save it in a local
  variable to reuse it for xdp->data_end and xdp->data_meta in
  xdp_prepare_buff()

Changes since v1:
- introduce xdp_prepare_buff utility routine

Lorenzo Bianconi (2):
  net: xdp: introduce xdp_init_buff utility routine
  net: xdp: introduce xdp_prepare_buff utility routine

 drivers/net/ethernet/amazon/ena/ena_netdev.c  |  8 +++-----
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c |  7 ++-----
 .../net/ethernet/cavium/thunder/nicvf_main.c  | 11 ++++++-----
 .../net/ethernet/freescale/dpaa/dpaa_eth.c    | 10 ++++------
 .../net/ethernet/freescale/dpaa2/dpaa2-eth.c  | 13 +++++--------
 drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 18 +++++++++---------
 drivers/net/ethernet/intel/ice/ice_txrx.c     | 17 +++++++++--------
 drivers/net/ethernet/intel/igb/igb_main.c     | 18 +++++++++---------
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 19 +++++++++----------
 .../net/ethernet/intel/ixgbevf/ixgbevf_main.c | 19 +++++++++----------
 drivers/net/ethernet/marvell/mvneta.c         |  9 +++------
 .../net/ethernet/marvell/mvpp2/mvpp2_main.c   | 13 +++++++------
 drivers/net/ethernet/mellanox/mlx4/en_rx.c    |  8 +++-----
 .../net/ethernet/mellanox/mlx5/core/en_rx.c   |  7 ++-----
 .../ethernet/netronome/nfp/nfp_net_common.c   | 12 ++++++------
 drivers/net/ethernet/qlogic/qede/qede_fp.c    |  7 ++-----
 drivers/net/ethernet/sfc/rx.c                 |  9 +++------
 drivers/net/ethernet/socionext/netsec.c       |  8 +++-----
 drivers/net/ethernet/ti/cpsw.c                | 17 ++++++-----------
 drivers/net/ethernet/ti/cpsw_new.c            | 17 ++++++-----------
 drivers/net/hyperv/netvsc_bpf.c               |  7 ++-----
 drivers/net/tun.c                             | 11 ++++-------
 drivers/net/veth.c                            | 14 +++++---------
 drivers/net/virtio_net.c                      | 18 ++++++------------
 drivers/net/xen-netfront.c                    |  8 +++-----
 include/net/xdp.h                             | 19 +++++++++++++++++++
 net/bpf/test_run.c                            |  9 +++------
 net/core/dev.c                                | 18 ++++++++----------
 28 files changed, 156 insertions(+), 195 deletions(-)

Comments

Martin Habets Dec. 14, 2020, 3:32 p.m. UTC | #1
On Sat, Dec 12, 2020 at 06:41:47PM +0100, Lorenzo Bianconi wrote:
> Introduce xdp_init_buff and xdp_prepare_buff utility routines to initialize
> xdp_buff data structure and remove duplicated code in all XDP capable
> drivers.
> 
> Changes since v2:
> - precompute xdp->data as hard_start + headroom and save it in a local
>   variable to reuse it for xdp->data_end and xdp->data_meta in
>   xdp_prepare_buff()
> 
> Changes since v1:
> - introduce xdp_prepare_buff utility routine
> 
> Lorenzo Bianconi (2):
>   net: xdp: introduce xdp_init_buff utility routine
>   net: xdp: introduce xdp_prepare_buff utility routine

For changes in drivers/net/ethernet/sfc:

Acked-by: Martin Habets <habetsm.xilinx@gmail.com>

>  drivers/net/ethernet/amazon/ena/ena_netdev.c  |  8 +++-----
>  drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c |  7 ++-----
>  .../net/ethernet/cavium/thunder/nicvf_main.c  | 11 ++++++-----
>  .../net/ethernet/freescale/dpaa/dpaa_eth.c    | 10 ++++------
>  .../net/ethernet/freescale/dpaa2/dpaa2-eth.c  | 13 +++++--------
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 18 +++++++++---------
>  drivers/net/ethernet/intel/ice/ice_txrx.c     | 17 +++++++++--------
>  drivers/net/ethernet/intel/igb/igb_main.c     | 18 +++++++++---------
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 19 +++++++++----------
>  .../net/ethernet/intel/ixgbevf/ixgbevf_main.c | 19 +++++++++----------
>  drivers/net/ethernet/marvell/mvneta.c         |  9 +++------
>  .../net/ethernet/marvell/mvpp2/mvpp2_main.c   | 13 +++++++------
>  drivers/net/ethernet/mellanox/mlx4/en_rx.c    |  8 +++-----
>  .../net/ethernet/mellanox/mlx5/core/en_rx.c   |  7 ++-----
>  .../ethernet/netronome/nfp/nfp_net_common.c   | 12 ++++++------
>  drivers/net/ethernet/qlogic/qede/qede_fp.c    |  7 ++-----
>  drivers/net/ethernet/sfc/rx.c                 |  9 +++------
>  drivers/net/ethernet/socionext/netsec.c       |  8 +++-----
>  drivers/net/ethernet/ti/cpsw.c                | 17 ++++++-----------
>  drivers/net/ethernet/ti/cpsw_new.c            | 17 ++++++-----------
>  drivers/net/hyperv/netvsc_bpf.c               |  7 ++-----
>  drivers/net/tun.c                             | 11 ++++-------
>  drivers/net/veth.c                            | 14 +++++---------
>  drivers/net/virtio_net.c                      | 18 ++++++------------
>  drivers/net/xen-netfront.c                    |  8 +++-----
>  include/net/xdp.h                             | 19 +++++++++++++++++++
>  net/bpf/test_run.c                            |  9 +++------
>  net/core/dev.c                                | 18 ++++++++----------
>  28 files changed, 156 insertions(+), 195 deletions(-)
> 
> -- 
> 2.29.2
Camelia Alexandra Groza Dec. 14, 2020, 5:53 p.m. UTC | #2
> -----Original Message-----
> From: Lorenzo Bianconi <lorenzo@kernel.org>
> Sent: Saturday, December 12, 2020 19:42
> To: bpf@vger.kernel.org; netdev@vger.kernel.org
> Cc: davem@davemloft.net; kuba@kernel.org; ast@kernel.org;
> daniel@iogearbox.net; brouer@redhat.com; lorenzo.bianconi@redhat.com;
> alexander.duyck@gmail.com; maciej.fijalkowski@intel.com;
> saeed@kernel.org
> Subject: [PATCH v3 bpf-next 0/2] introduce xdp_init_buff/xdp_prepare_buff
> 
> Introduce xdp_init_buff and xdp_prepare_buff utility routines to initialize
> xdp_buff data structure and remove duplicated code in all XDP capable
> drivers.
> 
> Changes since v2:
> - precompute xdp->data as hard_start + headroom and save it in a local
>   variable to reuse it for xdp->data_end and xdp->data_meta in
>   xdp_prepare_buff()
> 
> Changes since v1:
> - introduce xdp_prepare_buff utility routine
> 
> Lorenzo Bianconi (2):
>   net: xdp: introduce xdp_init_buff utility routine
>   net: xdp: introduce xdp_prepare_buff utility routine

For the drivers/net/ethernet/freescale/dpaa changes:
Acked-by: Camelia Groza <camelia.groza@nxp.com>

>  drivers/net/ethernet/amazon/ena/ena_netdev.c  |  8 +++-----
>  drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c |  7 ++-----
>  .../net/ethernet/cavium/thunder/nicvf_main.c  | 11 ++++++-----
>  .../net/ethernet/freescale/dpaa/dpaa_eth.c    | 10 ++++------
>  .../net/ethernet/freescale/dpaa2/dpaa2-eth.c  | 13 +++++--------
>  drivers/net/ethernet/intel/i40e/i40e_txrx.c   | 18 +++++++++---------
>  drivers/net/ethernet/intel/ice/ice_txrx.c     | 17 +++++++++--------
>  drivers/net/ethernet/intel/igb/igb_main.c     | 18 +++++++++---------
>  drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 19 +++++++++----------
>  .../net/ethernet/intel/ixgbevf/ixgbevf_main.c | 19 +++++++++----------
>  drivers/net/ethernet/marvell/mvneta.c         |  9 +++------
>  .../net/ethernet/marvell/mvpp2/mvpp2_main.c   | 13 +++++++------
>  drivers/net/ethernet/mellanox/mlx4/en_rx.c    |  8 +++-----
>  .../net/ethernet/mellanox/mlx5/core/en_rx.c   |  7 ++-----
>  .../ethernet/netronome/nfp/nfp_net_common.c   | 12 ++++++------
>  drivers/net/ethernet/qlogic/qede/qede_fp.c    |  7 ++-----
>  drivers/net/ethernet/sfc/rx.c                 |  9 +++------
>  drivers/net/ethernet/socionext/netsec.c       |  8 +++-----
>  drivers/net/ethernet/ti/cpsw.c                | 17 ++++++-----------
>  drivers/net/ethernet/ti/cpsw_new.c            | 17 ++++++-----------
>  drivers/net/hyperv/netvsc_bpf.c               |  7 ++-----
>  drivers/net/tun.c                             | 11 ++++-------
>  drivers/net/veth.c                            | 14 +++++---------
>  drivers/net/virtio_net.c                      | 18 ++++++------------
>  drivers/net/xen-netfront.c                    |  8 +++-----
>  include/net/xdp.h                             | 19 +++++++++++++++++++
>  net/bpf/test_run.c                            |  9 +++------
>  net/core/dev.c                                | 18 ++++++++----------
>  28 files changed, 156 insertions(+), 195 deletions(-)
> 
> --
> 2.29.2