bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame
@ 2020-07-23 11:42 Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 01/22] xdp: introduce mb " Lorenzo Bianconi
                   ` (22 more replies)
  0 siblings, 23 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Introduce multi-buffer bit (mb) in xdp_frame/xdp_buffer to specify
if shared_info area has been properly initialized for non-linear
xdp buffers.
Initialize mb to 0 for all xdp drivers

Lorenzo Bianconi (22):
  xdp: introduce mb in xdp_buff/xdp_frame
  xdp: initialize xdp_buff mb bit to 0 in netif_receive_generic_xdp
  net: virtio_net: initialize mb bit of xdp_buff to 0
  net: xen-netfront: initialize mb bit of xdp_buff to 0
  net: veth: initialize mb bit of xdp_buff to 0
  net: hv_netvsc: initialize mb bit of xdp_buff to 0
  net: bnxt: initialize mb bit in xdp_buff to 0
  net: dpaa2: initialize mb bit in xdp_buff to 0
  net: ti: initialize mb bit in xdp_buff to 0
  net: nfp: initialize mb bit in xdp_buff to 0
  net: mvpp2: initialize mb bit in xdp_buff to 0
  net: sfc: initialize mb bit in xdp_buff to 0
  net: qede: initialize mb bit in xdp_buff to 0
  net: amazon: ena: initialize mb bit in xdp_buff to 0
  net: cavium: thunder: initialize mb bit in xdp_buff to 0
  net: socionext: initialize mb bit in xdp_buff to 0
  net: tun: initialize mb bit in xdp_buff to 0
  net: ixgbe: initialize mb bit in xdp_buff to 0
  net: ice: initialize mb bit in xdp_buff to 0
  net: i40e: initialize mb bit in xdp_buff to 0
  net: mlx5: initialize mb bit in xdp_buff to 0
  net: mlx4: initialize mb bit in xdp_buff to 0

 drivers/net/ethernet/amazon/ena/ena_netdev.c        | 1 +
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c       | 1 +
 drivers/net/ethernet/cavium/thunder/nicvf_main.c    | 1 +
 drivers/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 +
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c   | 1 +
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c     | 1 +
 drivers/net/ethernet/mellanox/mlx4/en_rx.c          | 1 +
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c     | 1 +
 drivers/net/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                                   | 8 ++++++--
 net/core/dev.c                                      | 1 +
 24 files changed, 31 insertions(+), 2 deletions(-)

-- 
2.26.2


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

* [RFC net-next 01/22] xdp: introduce mb in xdp_buff/xdp_frame
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 13:51   ` Jubran, Samih
  2020-07-23 11:42 ` [RFC net-next 02/22] xdp: initialize xdp_buff mb bit to 0 in netif_receive_generic_xdp Lorenzo Bianconi
                   ` (21 subsequent siblings)
  22 siblings, 1 reply; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Introduce multi-buffer bit (mb) in xdp_frame/xdp_buffer to specify
if shared_info area has been properly initialized for non-linear
xdp buffers

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 include/net/xdp.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/net/xdp.h b/include/net/xdp.h
index dbe9c60797e1..2ef6935c5646 100644
--- a/include/net/xdp.h
+++ b/include/net/xdp.h
@@ -72,7 +72,8 @@ struct xdp_buff {
 	void *data_hard_start;
 	struct xdp_rxq_info *rxq;
 	struct xdp_txq_info *txq;
-	u32 frame_sz; /* frame size to deduce data_hard_end/reserved tailroom*/
+	u32 frame_sz:31; /* frame size to deduce data_hard_end/reserved tailroom*/
+	u32 mb:1; /* xdp non-linear buffer */
 };
 
 /* Reserve memory area at end-of data area.
@@ -96,7 +97,8 @@ struct xdp_frame {
 	u16 len;
 	u16 headroom;
 	u32 metasize:8;
-	u32 frame_sz:24;
+	u32 frame_sz:23;
+	u32 mb:1; /* xdp non-linear frame */
 	/* Lifetime of xdp_rxq_info is limited to NAPI/enqueue time,
 	 * while mem info is valid on remote CPU.
 	 */
@@ -141,6 +143,7 @@ void xdp_convert_frame_to_buff(struct xdp_frame *frame, struct xdp_buff *xdp)
 	xdp->data_end = frame->data + frame->len;
 	xdp->data_meta = frame->data - frame->metasize;
 	xdp->frame_sz = frame->frame_sz;
+	xdp->mb = frame->mb;
 }
 
 static inline
@@ -167,6 +170,7 @@ int xdp_update_frame_from_buff(struct xdp_buff *xdp,
 	xdp_frame->headroom = headroom - sizeof(*xdp_frame);
 	xdp_frame->metasize = metasize;
 	xdp_frame->frame_sz = xdp->frame_sz;
+	xdp_frame->mb = xdp->mb;
 
 	return 0;
 }
-- 
2.26.2


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

* [RFC net-next 02/22] xdp: initialize xdp_buff mb bit to 0 in netif_receive_generic_xdp
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 01/22] xdp: introduce mb " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 03/22] net: virtio_net: initialize mb bit of xdp_buff to 0 Lorenzo Bianconi
                   ` (20 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 net/core/dev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/net/core/dev.c b/net/core/dev.c
index 316349f6cea5..eb3e54df198c 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -4641,6 +4641,7 @@ static u32 netif_receive_generic_xdp(struct sk_buff *skb,
 	/* SKB "head" area always have tailroom for skb_shared_info */
 	xdp->frame_sz  = (void *)skb_end_pointer(skb) - xdp->data_hard_start;
 	xdp->frame_sz += SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
+	xdp->mb = 0;
 
 	orig_data_end = xdp->data_end;
 	orig_data = xdp->data;
-- 
2.26.2


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

* [RFC net-next 03/22] net: virtio_net: initialize mb bit of xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 01/22] xdp: introduce mb " Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 02/22] xdp: initialize xdp_buff mb bit to 0 in netif_receive_generic_xdp Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 04/22] net: xen-netfront: " Lorenzo Bianconi
                   ` (19 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/virtio_net.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c
index ba38765dc490..100fa9b60026 100644
--- a/drivers/net/virtio_net.c
+++ b/drivers/net/virtio_net.c
@@ -690,6 +690,7 @@ static struct sk_buff *receive_small(struct net_device *dev,
 		xdp.data_meta = xdp.data;
 		xdp.rxq = &rq->xdp_rxq;
 		xdp.frame_sz = buflen;
+		xdp.mb = 0;
 		orig_data = xdp.data;
 		act = bpf_prog_run_xdp(xdp_prog, &xdp);
 		stats->xdp_packets++;
@@ -860,6 +861,7 @@ static struct sk_buff *receive_mergeable(struct net_device *dev,
 		xdp.data_meta = xdp.data;
 		xdp.rxq = &rq->xdp_rxq;
 		xdp.frame_sz = frame_sz - vi->hdr_len;
+		xdp.mb = 0;
 
 		act = bpf_prog_run_xdp(xdp_prog, &xdp);
 		stats->xdp_packets++;
-- 
2.26.2


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

* [RFC net-next 04/22] net: xen-netfront: initialize mb bit of xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (2 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 03/22] net: virtio_net: initialize mb bit of xdp_buff to 0 Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 05/22] net: veth: " Lorenzo Bianconi
                   ` (18 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/xen-netfront.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
index ed995df19247..ce862b08bb3b 100644
--- a/drivers/net/xen-netfront.c
+++ b/drivers/net/xen-netfront.c
@@ -868,6 +868,7 @@ static u32 xennet_run_xdp(struct netfront_queue *queue, struct page *pdata,
 	xdp->data_end = xdp->data + len;
 	xdp->rxq = &queue->xdp_rxq;
 	xdp->frame_sz = XEN_PAGE_SIZE - XDP_PACKET_HEADROOM;
+	xdp->mb = 0;
 
 	act = bpf_prog_run_xdp(prog, xdp);
 	switch (act) {
-- 
2.26.2


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

* [RFC net-next 05/22] net: veth: initialize mb bit of xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (3 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 04/22] net: xen-netfront: " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 06/22] net: hv_netvsc: " Lorenzo Bianconi
                   ` (17 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/veth.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index b594f03eeddb..463865c513b2 100644
--- a/drivers/net/veth.c
+++ b/drivers/net/veth.c
@@ -711,6 +711,7 @@ static struct sk_buff *veth_xdp_rcv_skb(struct veth_rq *rq,
 	/* SKB "head" area always have tailroom for skb_shared_info */
 	xdp.frame_sz = (void *)skb_end_pointer(skb) - xdp.data_hard_start;
 	xdp.frame_sz += SKB_DATA_ALIGN(sizeof(struct skb_shared_info));
+	xdp.mb = 0;
 
 	orig_data = xdp.data;
 	orig_data_end = xdp.data_end;
-- 
2.26.2


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

* [RFC net-next 06/22] net: hv_netvsc: initialize mb bit of xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (4 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 05/22] net: veth: " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 07/22] net: bnxt: initialize mb bit in " Lorenzo Bianconi
                   ` (16 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/hyperv/netvsc_bpf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/hyperv/netvsc_bpf.c b/drivers/net/hyperv/netvsc_bpf.c
index 8e4141552423..e26c60413128 100644
--- a/drivers/net/hyperv/netvsc_bpf.c
+++ b/drivers/net/hyperv/netvsc_bpf.c
@@ -50,6 +50,7 @@ u32 netvsc_run_xdp(struct net_device *ndev, struct netvsc_channel *nvchan,
 	xdp->data_end = xdp->data + len;
 	xdp->rxq = &nvchan->xdp_rxq;
 	xdp->frame_sz = PAGE_SIZE;
+	xdp->mb = 0;
 
 	memcpy(xdp->data, data, len);
 
-- 
2.26.2


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

* [RFC net-next 07/22] net: bnxt: initialize mb bit in xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (5 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 06/22] net: hv_netvsc: " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 08/22] net: dpaa2: " Lorenzo Bianconi
                   ` (15 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
index 5e3b4a3b69ea..615d95cf4629 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
@@ -139,6 +139,7 @@ bool bnxt_rx_xdp(struct bnxt *bp, struct bnxt_rx_ring_info *rxr, u16 cons,
 	xdp.data_end = *data_ptr + *len;
 	xdp.rxq = &rxr->xdp_rxq;
 	xdp.frame_sz = PAGE_SIZE; /* BNXT_RX_PAGE_MODE(bp) when XDP enabled */
+	xdp.mb = 0;
 	orig_data = xdp.data;
 
 	rcu_read_lock();
-- 
2.26.2


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

* [RFC net-next 08/22] net: dpaa2: initialize mb bit in xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (6 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 07/22] net: bnxt: initialize mb bit in " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 09/22] net: ti: " Lorenzo Bianconi
                   ` (14 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
index c1bea9132f50..fc37099675c8 100644
--- a/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
+++ b/drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
@@ -361,6 +361,7 @@ static u32 run_xdp(struct dpaa2_eth_priv *priv,
 
 	xdp.frame_sz = DPAA2_ETH_RX_BUF_RAW_SIZE -
 		(dpaa2_fd_get_offset(fd) - XDP_PACKET_HEADROOM);
+	xdp.mb = 0;
 
 	xdp_act = bpf_prog_run_xdp(xdp_prog, &xdp);
 
-- 
2.26.2


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

* [RFC net-next 09/22] net: ti: initialize mb bit in xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (7 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 08/22] net: dpaa2: " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 10/22] net: nfp: " Lorenzo Bianconi
                   ` (13 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/ti/cpsw.c     | 1 +
 drivers/net/ethernet/ti/cpsw_new.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 9b17bbbe102f..53a55c540adc 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -407,6 +407,7 @@ static void cpsw_rx_handler(void *token, int len, int status)
 		xdp.data_hard_start = pa;
 		xdp.rxq = &priv->xdp_rxq[ch];
 		xdp.frame_sz = PAGE_SIZE;
+		xdp.mb = 0;
 
 		port = priv->emac_port + cpsw->data.dual_emac;
 		ret = cpsw_run_xdp(priv, ch, &xdp, page, port);
diff --git a/drivers/net/ethernet/ti/cpsw_new.c b/drivers/net/ethernet/ti/cpsw_new.c
index 1247d35d42ef..703d079fd479 100644
--- a/drivers/net/ethernet/ti/cpsw_new.c
+++ b/drivers/net/ethernet/ti/cpsw_new.c
@@ -349,6 +349,7 @@ static void cpsw_rx_handler(void *token, int len, int status)
 		xdp.data_hard_start = pa;
 		xdp.rxq = &priv->xdp_rxq[ch];
 		xdp.frame_sz = PAGE_SIZE;
+		xdp.mb = 0;
 
 		ret = cpsw_run_xdp(priv, ch, &xdp, page, priv->emac_port);
 		if (ret != CPSW_XDP_PASS)
-- 
2.26.2


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

* [RFC net-next 10/22] net: nfp: initialize mb bit in xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (8 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 09/22] net: ti: " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 11/22] net: mvpp2: " Lorenzo Bianconi
                   ` (12 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
index 44608873d3d9..c6998c34e552 100644
--- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
+++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c
@@ -1824,6 +1824,7 @@ static int nfp_net_rx(struct nfp_net_rx_ring *rx_ring, int budget)
 	true_bufsz = xdp_prog ? PAGE_SIZE : dp->fl_bufsz;
 	xdp.frame_sz = PAGE_SIZE - NFP_NET_RX_BUF_HEADROOM;
 	xdp.rxq = &rx_ring->xdp_rxq;
+	xdp.mb = 0;
 	tx_ring = r_vec->xdp_ring;
 
 	while (pkts_polled < budget) {
-- 
2.26.2


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

* [RFC net-next 11/22] net: mvpp2: initialize mb bit in xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (9 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 10/22] net: nfp: " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 12/22] net: sfc: " Lorenzo Bianconi
                   ` (11 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
index 6a3f356640a0..61b1688527ea 100644
--- a/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
+++ b/drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c
@@ -3475,6 +3475,7 @@ static int mvpp2_rx(struct mvpp2_port *port, struct napi_struct *napi,
 			xdp.data = data + MVPP2_MH_SIZE + MVPP2_SKB_HEADROOM;
 			xdp.data_end = xdp.data + rx_bytes;
 			xdp.frame_sz = PAGE_SIZE;
+			xdp.mb = 0;
 
 			if (bm_pool->pkt_size == MVPP2_BM_SHORT_PKT_SIZE)
 				xdp.rxq = &rxq->xdp_rxq_short;
-- 
2.26.2


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

* [RFC net-next 12/22] net: sfc: initialize mb bit in xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (10 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 11/22] net: mvpp2: " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 13/22] net: qede: " Lorenzo Bianconi
                   ` (10 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/sfc/rx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/sfc/rx.c b/drivers/net/ethernet/sfc/rx.c
index 59a43d586967..8fd6023995d4 100644
--- a/drivers/net/ethernet/sfc/rx.c
+++ b/drivers/net/ethernet/sfc/rx.c
@@ -301,6 +301,7 @@ static bool efx_do_xdp(struct efx_nic *efx, struct efx_channel *channel,
 	xdp.data_end = xdp.data + rx_buf->len;
 	xdp.rxq = &rx_queue->xdp_rxq_info;
 	xdp.frame_sz = efx->rx_page_buf_step;
+	xdp.mb = 0;
 
 	xdp_act = bpf_prog_run_xdp(xdp_prog, &xdp);
 	rcu_read_unlock();
-- 
2.26.2


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

* [RFC net-next 13/22] net: qede: initialize mb bit in xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (11 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 12/22] net: sfc: " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 14/22] net: amazon: ena: " Lorenzo Bianconi
                   ` (9 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/qlogic/qede/qede_fp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/qlogic/qede/qede_fp.c b/drivers/net/ethernet/qlogic/qede/qede_fp.c
index a2494bf85007..14a54094ca08 100644
--- a/drivers/net/ethernet/qlogic/qede/qede_fp.c
+++ b/drivers/net/ethernet/qlogic/qede/qede_fp.c
@@ -1096,6 +1096,7 @@ static bool qede_rx_xdp(struct qede_dev *edev,
 	xdp.data_end = xdp.data + *len;
 	xdp.rxq = &rxq->xdp_rxq;
 	xdp.frame_sz = rxq->rx_buf_seg_size; /* PAGE_SIZE when XDP enabled */
+	xdp.mb = 0;
 
 	/* Queues always have a full reset currently, so for the time
 	 * being until there's atomic program replace just mark read
-- 
2.26.2


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

* [RFC net-next 14/22] net: amazon: ena: initialize mb bit in xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (12 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 13/22] net: qede: " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 15/22] net: cavium: thunder: " Lorenzo Bianconi
                   ` (8 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/amazon/ena/ena_netdev.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 6478c1e0d137..12f7ee1d1f0a 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -1613,6 +1613,7 @@ static int ena_clean_rx_irq(struct ena_ring *rx_ring, struct napi_struct *napi,
 	res_budget = budget;
 	xdp.rxq = &rx_ring->xdp_rxq;
 	xdp.frame_sz = ENA_PAGE_SIZE;
+	xdp.mb = 0;
 
 	do {
 		xdp_verdict = XDP_PASS;
-- 
2.26.2


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

* [RFC net-next 15/22] net: cavium: thunder: initialize mb bit in xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (13 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 14/22] net: amazon: ena: " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 16/22] net: socionext: " Lorenzo Bianconi
                   ` (7 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/cavium/thunder/nicvf_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/cavium/thunder/nicvf_main.c b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
index 2ba0ce115e63..bd2592ddfd6d 100644
--- a/drivers/net/ethernet/cavium/thunder/nicvf_main.c
+++ b/drivers/net/ethernet/cavium/thunder/nicvf_main.c
@@ -553,6 +553,7 @@ static inline bool nicvf_xdp_rx(struct nicvf *nic, struct bpf_prog *prog,
 	xdp.data_end = xdp.data + len;
 	xdp.rxq = &rq->xdp_rxq;
 	xdp.frame_sz = RCV_FRAG_LEN + XDP_PACKET_HEADROOM;
+	xdp.mb = 0;
 	orig_data = xdp.data;
 
 	rcu_read_lock();
-- 
2.26.2


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

* [RFC net-next 16/22] net: socionext: initialize mb bit in xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (14 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 15/22] net: cavium: thunder: " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 17/22] net: tun: " Lorenzo Bianconi
                   ` (6 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/socionext/netsec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/socionext/netsec.c b/drivers/net/ethernet/socionext/netsec.c
index 0f366cc50b74..0c98391224bd 100644
--- a/drivers/net/ethernet/socionext/netsec.c
+++ b/drivers/net/ethernet/socionext/netsec.c
@@ -947,6 +947,7 @@ static int netsec_process_rx(struct netsec_priv *priv, int budget)
 
 	xdp.rxq = &dring->xdp_rxq;
 	xdp.frame_sz = PAGE_SIZE;
+	xdp.mb = 0;
 
 	rcu_read_lock();
 	xdp_prog = READ_ONCE(priv->xdp_prog);
-- 
2.26.2


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

* [RFC net-next 17/22] net: tun: initialize mb bit in xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (15 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 16/22] net: socionext: " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 18/22] net: ixgbe: " Lorenzo Bianconi
                   ` (5 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/tun.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 7adeb91bd368..7007fc344460 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -1674,6 +1674,7 @@ static struct sk_buff *tun_build_skb(struct tun_struct *tun,
 		xdp.data_end = xdp.data + len;
 		xdp.rxq = &tfile->xdp_rxq;
 		xdp.frame_sz = buflen;
+		xdp.mb = 0;
 
 		act = bpf_prog_run_xdp(xdp_prog, &xdp);
 		if (act == XDP_REDIRECT || act == XDP_TX) {
@@ -2421,6 +2422,7 @@ static int tun_xdp_one(struct tun_struct *tun,
 		xdp_set_data_meta_invalid(xdp);
 		xdp->rxq = &tfile->xdp_rxq;
 		xdp->frame_sz = buflen;
+		xdp->mb = 0;
 
 		act = bpf_prog_run_xdp(xdp_prog, xdp);
 		err = tun_xdp_act(tun, xdp_prog, xdp, act);
-- 
2.26.2


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

* [RFC net-next 18/22] net: ixgbe: initialize mb bit in xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (16 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 17/22] net: tun: " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 19/22] net: ice: " Lorenzo Bianconi
                   ` (4 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c     | 1 +
 drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 4d898ff21a46..327265ae3b68 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -2303,6 +2303,7 @@ static int ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
 #if (PAGE_SIZE < 8192)
 	xdp.frame_sz = ixgbe_rx_frame_truesize(rx_ring, 0);
 #endif
+	xdp.mb = 0;
 
 	while (likely(total_rx_packets < budget)) {
 		union ixgbe_adv_rx_desc *rx_desc;
diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
index 6e9a397db583..134e8f1a0b77 100644
--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c
@@ -1133,6 +1133,7 @@ static int ixgbevf_clean_rx_irq(struct ixgbevf_q_vector *q_vector,
 	struct xdp_buff xdp;
 
 	xdp.rxq = &rx_ring->xdp_rxq;
+	xdp.mb = 0;
 
 	/* Frame size depend on rx_ring setup when PAGE_SIZE=4K */
 #if (PAGE_SIZE < 8192)
-- 
2.26.2


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

* [RFC net-next 19/22] net: ice: initialize mb bit in xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (17 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 18/22] net: ixgbe: " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 20/22] net: i40e: " Lorenzo Bianconi
                   ` (3 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/intel/ice/ice_txrx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/ice/ice_txrx.c b/drivers/net/ethernet/intel/ice/ice_txrx.c
index abdb137c8bb7..90453b3ffa2c 100644
--- a/drivers/net/ethernet/intel/ice/ice_txrx.c
+++ b/drivers/net/ethernet/intel/ice/ice_txrx.c
@@ -1098,6 +1098,7 @@ int ice_clean_rx_irq(struct ice_ring *rx_ring, int budget)
 #if (PAGE_SIZE < 8192)
 	xdp.frame_sz = ice_rx_frame_truesize(rx_ring, 0);
 #endif
+	xdp.mb = 0;
 
 	/* start the loop to process Rx packets bounded by 'budget' */
 	while (likely(total_rx_pkts < (unsigned int)budget)) {
-- 
2.26.2


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

* [RFC net-next 20/22] net: i40e: initialize mb bit in xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (18 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 19/22] net: ice: " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 21/22] net: mlx5: " Lorenzo Bianconi
                   ` (2 subsequent siblings)
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/intel/i40e/i40e_txrx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index 3e5c566ceb01..7d5a8afa8a4c 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -2324,6 +2324,7 @@ static int i40e_clean_rx_irq(struct i40e_ring *rx_ring, int budget)
 	xdp.frame_sz = i40e_rx_frame_truesize(rx_ring, 0);
 #endif
 	xdp.rxq = &rx_ring->xdp_rxq;
+	xdp.mb = 0;
 
 	while (likely(total_rx_packets < (unsigned int)budget)) {
 		struct i40e_rx_buffer *rx_buffer;
-- 
2.26.2


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

* [RFC net-next 21/22] net: mlx5: initialize mb bit in xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (19 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 20/22] net: i40e: " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-23 11:42 ` [RFC net-next 22/22] net: mlx4: " Lorenzo Bianconi
  2020-07-28 14:48 ` [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Jesper Dangaard Brouer
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
index 74860f3827b1..bfaa03134505 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
@@ -1104,6 +1104,7 @@ static void mlx5e_fill_xdp_buff(struct mlx5e_rq *rq, void *va, u16 headroom,
 	xdp->data_end = xdp->data + len;
 	xdp->rxq = &rq->xdp_rxq;
 	xdp->frame_sz = rq->buff.frame0_sz;
+	xdp->mb = 0;
 }
 
 struct sk_buff *
-- 
2.26.2


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

* [RFC net-next 22/22] net: mlx4: initialize mb bit in xdp_buff to 0
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (20 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 21/22] net: mlx5: " Lorenzo Bianconi
@ 2020-07-23 11:42 ` Lorenzo Bianconi
  2020-07-28 14:48 ` [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Jesper Dangaard Brouer
  22 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-23 11:42 UTC (permalink / raw)
  To: netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba

Initialize multi-buffer bit (mb) to 0 in xdp_buff data structure.
This is a preliminary patch to enable xdp multi-buffer support.

Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
---
 drivers/net/ethernet/mellanox/mlx4/en_rx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
index 8a10285b0e10..0d42e81a7ad8 100644
--- a/drivers/net/ethernet/mellanox/mlx4/en_rx.c
+++ b/drivers/net/ethernet/mellanox/mlx4/en_rx.c
@@ -684,6 +684,7 @@ int mlx4_en_process_rx_cq(struct net_device *dev, struct mlx4_en_cq *cq, int bud
 	xdp_prog = rcu_dereference(ring->xdp_prog);
 	xdp.rxq = &ring->xdp_rxq;
 	xdp.frame_sz = priv->frag_info[0].frag_stride;
+	xdp.mb = 0;
 	doorbell_pending = 0;
 
 	/* We assume a 1:1 mapping between CQEs and Rx descriptors, so Rx
-- 
2.26.2


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

* RE: [RFC net-next 01/22] xdp: introduce mb in xdp_buff/xdp_frame
  2020-07-23 11:42 ` [RFC net-next 01/22] xdp: introduce mb " Lorenzo Bianconi
@ 2020-07-23 13:51   ` Jubran, Samih
  0 siblings, 0 replies; 26+ messages in thread
From: Jubran, Samih @ 2020-07-23 13:51 UTC (permalink / raw)
  To: Lorenzo Bianconi, netdev
  Cc: bpf, davem, ast, brouer, daniel, lorenzo.bianconi, echaudro, kuba

> -----Original Message-----
> From: Lorenzo Bianconi <lorenzo@kernel.org>
> Sent: Thursday, July 23, 2020 2:42 PM
> To: netdev@vger.kernel.org
> Cc: bpf@vger.kernel.org; davem@davemloft.net; ast@kernel.org;
> brouer@redhat.com; daniel@iogearbox.net; lorenzo.bianconi@redhat.com;
> echaudro@redhat.com; Jubran, Samih <sameehj@amazon.com>;
> kuba@kernel.org
> Subject: [EXTERNAL] [RFC net-next 01/22] xdp: introduce mb in
> xdp_buff/xdp_frame
> 
> CAUTION: This email originated from outside of the organization. Do not click
> links or open attachments unless you can confirm the sender and know the
> content is safe.
> 
> 
> 
> Introduce multi-buffer bit (mb) in xdp_frame/xdp_buffer to specify if
> shared_info area has been properly initialized for non-linear xdp buffers
> 
> Signed-off-by: Lorenzo Bianconi <lorenzo@kernel.org>
> ---
>  include/net/xdp.h | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/include/net/xdp.h b/include/net/xdp.h index
> dbe9c60797e1..2ef6935c5646 100644
> --- a/include/net/xdp.h
> +++ b/include/net/xdp.h
> @@ -72,7 +72,8 @@ struct xdp_buff {
>         void *data_hard_start;
>         struct xdp_rxq_info *rxq;
>         struct xdp_txq_info *txq;
> -       u32 frame_sz; /* frame size to deduce data_hard_end/reserved
> tailroom*/
> +       u32 frame_sz:31; /* frame size to deduce data_hard_end/reserved
> tailroom*/
It seems strange that you assign a 32 sized field to a 24 sized field.
Wouldn't it be better if we used the same size in all places?
> +       u32 mb:1; /* xdp non-linear buffer */
>  };
> 
>  /* Reserve memory area at end-of data area.
> @@ -96,7 +97,8 @@ struct xdp_frame {
>         u16 len;
>         u16 headroom;
>         u32 metasize:8;
> -       u32 frame_sz:24;
> +       u32 frame_sz:23;
> +       u32 mb:1; /* xdp non-linear frame */
>         /* Lifetime of xdp_rxq_info is limited to NAPI/enqueue time,
>          * while mem info is valid on remote CPU.
>          */
> @@ -141,6 +143,7 @@ void xdp_convert_frame_to_buff(struct xdp_frame
> *frame, struct xdp_buff *xdp)
>         xdp->data_end = frame->data + frame->len;
>         xdp->data_meta = frame->data - frame->metasize;
>         xdp->frame_sz = frame->frame_sz;
> +       xdp->mb = frame->mb;
>  }
> 
>  static inline
> @@ -167,6 +170,7 @@ int xdp_update_frame_from_buff(struct xdp_buff
> *xdp,
>         xdp_frame->headroom = headroom - sizeof(*xdp_frame);
>         xdp_frame->metasize = metasize;
>         xdp_frame->frame_sz = xdp->frame_sz;
> +       xdp_frame->mb = xdp->mb;
> 
>         return 0;
>  }
> --
> 2.26.2


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

* Re: [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame
  2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
                   ` (21 preceding siblings ...)
  2020-07-23 11:42 ` [RFC net-next 22/22] net: mlx4: " Lorenzo Bianconi
@ 2020-07-28 14:48 ` Jesper Dangaard Brouer
  2020-07-28 15:10   ` Lorenzo Bianconi
  22 siblings, 1 reply; 26+ messages in thread
From: Jesper Dangaard Brouer @ 2020-07-28 14:48 UTC (permalink / raw)
  To: Lorenzo Bianconi
  Cc: netdev, bpf, davem, ast, daniel, lorenzo.bianconi, echaudro,
	sameehj, kuba, brouer

On Thu, 23 Jul 2020 13:42:12 +0200
Lorenzo Bianconi <lorenzo@kernel.org> wrote:

> Introduce multi-buffer bit (mb) in xdp_frame/xdp_buffer to specify
> if shared_info area has been properly initialized for non-linear
> xdp buffers.
> Initialize mb to 0 for all xdp drivers

It is nice to see that we have some many XDP drivers, but 20 separate
patches for drivers is a bit much.  Perhaps we can do all the drivers
in one patch? What do others think?

> Lorenzo Bianconi (22):
>   xdp: introduce mb in xdp_buff/xdp_frame
>   xdp: initialize xdp_buff mb bit to 0 in netif_receive_generic_xdp
>   net: virtio_net: initialize mb bit of xdp_buff to 0
>   net: xen-netfront: initialize mb bit of xdp_buff to 0
>   net: veth: initialize mb bit of xdp_buff to 0
>   net: hv_netvsc: initialize mb bit of xdp_buff to 0
>   net: bnxt: initialize mb bit in xdp_buff to 0
>   net: dpaa2: initialize mb bit in xdp_buff to 0
>   net: ti: initialize mb bit in xdp_buff to 0
>   net: nfp: initialize mb bit in xdp_buff to 0
>   net: mvpp2: initialize mb bit in xdp_buff to 0
>   net: sfc: initialize mb bit in xdp_buff to 0
>   net: qede: initialize mb bit in xdp_buff to 0
>   net: amazon: ena: initialize mb bit in xdp_buff to 0
>   net: cavium: thunder: initialize mb bit in xdp_buff to 0
>   net: socionext: initialize mb bit in xdp_buff to 0
>   net: tun: initialize mb bit in xdp_buff to 0
>   net: ixgbe: initialize mb bit in xdp_buff to 0
>   net: ice: initialize mb bit in xdp_buff to 0
>   net: i40e: initialize mb bit in xdp_buff to 0
>   net: mlx5: initialize mb bit in xdp_buff to 0
>   net: mlx4: initialize mb bit in xdp_buff to 0
>
>  drivers/net/ethernet/amazon/ena/ena_netdev.c        | 1 +
>  drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c       | 1 +
>  drivers/net/ethernet/cavium/thunder/nicvf_main.c    | 1 +
>  drivers/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 +
>  drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c   | 1 +
>  drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c     | 1 +

I see that mvneta is missing, but maybe it is doing another kind of
init of struct xdp_buff?

>  drivers/net/ethernet/mellanox/mlx4/en_rx.c          | 1 +
>  drivers/net/ethernet/mellanox/mlx5/core/en_rx.c     | 1 +
>  drivers/net/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                                   | 8 ++++++--
>  net/core/dev.c                                      | 1 +
>  24 files changed, 31 insertions(+), 2 deletions(-)

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


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

* Re: [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame
  2020-07-28 14:48 ` [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Jesper Dangaard Brouer
@ 2020-07-28 15:10   ` Lorenzo Bianconi
  0 siblings, 0 replies; 26+ messages in thread
From: Lorenzo Bianconi @ 2020-07-28 15:10 UTC (permalink / raw)
  To: Jesper Dangaard Brouer
  Cc: Lorenzo Bianconi, netdev, bpf, davem, ast, daniel, echaudro,
	sameehj, kuba

[-- Attachment #1: Type: text/plain, Size: 3740 bytes --]

> On Thu, 23 Jul 2020 13:42:12 +0200
> Lorenzo Bianconi <lorenzo@kernel.org> wrote:
> 
> > Introduce multi-buffer bit (mb) in xdp_frame/xdp_buffer to specify
> > if shared_info area has been properly initialized for non-linear
> > xdp buffers.
> > Initialize mb to 0 for all xdp drivers
> 
> It is nice to see that we have some many XDP drivers, but 20 separate
> patches for drivers is a bit much.  Perhaps we can do all the drivers
> in one patch? What do others think?

I am fine with it, not sure what is the best approach.

> 
> > Lorenzo Bianconi (22):
> >   xdp: introduce mb in xdp_buff/xdp_frame
> >   xdp: initialize xdp_buff mb bit to 0 in netif_receive_generic_xdp
> >   net: virtio_net: initialize mb bit of xdp_buff to 0
> >   net: xen-netfront: initialize mb bit of xdp_buff to 0
> >   net: veth: initialize mb bit of xdp_buff to 0
> >   net: hv_netvsc: initialize mb bit of xdp_buff to 0
> >   net: bnxt: initialize mb bit in xdp_buff to 0
> >   net: dpaa2: initialize mb bit in xdp_buff to 0
> >   net: ti: initialize mb bit in xdp_buff to 0
> >   net: nfp: initialize mb bit in xdp_buff to 0
> >   net: mvpp2: initialize mb bit in xdp_buff to 0
> >   net: sfc: initialize mb bit in xdp_buff to 0
> >   net: qede: initialize mb bit in xdp_buff to 0
> >   net: amazon: ena: initialize mb bit in xdp_buff to 0
> >   net: cavium: thunder: initialize mb bit in xdp_buff to 0
> >   net: socionext: initialize mb bit in xdp_buff to 0
> >   net: tun: initialize mb bit in xdp_buff to 0
> >   net: ixgbe: initialize mb bit in xdp_buff to 0
> >   net: ice: initialize mb bit in xdp_buff to 0
> >   net: i40e: initialize mb bit in xdp_buff to 0
> >   net: mlx5: initialize mb bit in xdp_buff to 0
> >   net: mlx4: initialize mb bit in xdp_buff to 0
> >
> >  drivers/net/ethernet/amazon/ena/ena_netdev.c        | 1 +
> >  drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c       | 1 +
> >  drivers/net/ethernet/cavium/thunder/nicvf_main.c    | 1 +
> >  drivers/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 +
> >  drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c   | 1 +
> >  drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c     | 1 +
> 
> I see that mvneta is missing, but maybe it is doing another kind of
> init of struct xdp_buff?

yes, mvneta has been done in a previous patch.

Regards,
Lorenzo

> 
> >  drivers/net/ethernet/mellanox/mlx4/en_rx.c          | 1 +
> >  drivers/net/ethernet/mellanox/mlx5/core/en_rx.c     | 1 +
> >  drivers/net/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                                   | 8 ++++++--
> >  net/core/dev.c                                      | 1 +
> >  24 files changed, 31 insertions(+), 2 deletions(-)
> 
> -- 
> Best regards,
>   Jesper Dangaard Brouer
>   MSc.CS, Principal Kernel Engineer at Red Hat
>   LinkedIn: http://www.linkedin.com/in/brouer
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

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

end of thread, other threads:[~2020-07-28 15:10 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-23 11:42 [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 01/22] xdp: introduce mb " Lorenzo Bianconi
2020-07-23 13:51   ` Jubran, Samih
2020-07-23 11:42 ` [RFC net-next 02/22] xdp: initialize xdp_buff mb bit to 0 in netif_receive_generic_xdp Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 03/22] net: virtio_net: initialize mb bit of xdp_buff to 0 Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 04/22] net: xen-netfront: " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 05/22] net: veth: " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 06/22] net: hv_netvsc: " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 07/22] net: bnxt: initialize mb bit in " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 08/22] net: dpaa2: " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 09/22] net: ti: " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 10/22] net: nfp: " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 11/22] net: mvpp2: " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 12/22] net: sfc: " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 13/22] net: qede: " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 14/22] net: amazon: ena: " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 15/22] net: cavium: thunder: " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 16/22] net: socionext: " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 17/22] net: tun: " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 18/22] net: ixgbe: " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 19/22] net: ice: " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 20/22] net: i40e: " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 21/22] net: mlx5: " Lorenzo Bianconi
2020-07-23 11:42 ` [RFC net-next 22/22] net: mlx4: " Lorenzo Bianconi
2020-07-28 14:48 ` [RFC net-next 00/22] Introduce mb bit in xdp_buff/xdp_frame Jesper Dangaard Brouer
2020-07-28 15:10   ` 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).