Skip to contentSkip to conversation

maximize vector rx burst for PMDs

PATCH Superseded Jeff Guo 5 participants 14 messages Aug 27, 2020 – Aug 31, 2020 Network drivers

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Jeff Guo

author
#0 lore raw

v2 cover maximize vector rx burst for PMDs

The limitation of burst size in vector rx was removed, since it should retrieve as much received packets as possible. And also the scattered receive path should use a wrapper function to achieve the goal of burst maximizing.

This patch set aims to maximize vector rx burst for for ixgbe/i40e/ice/iavf/fm10k PMDs.

v2->v1:
1:add fm10k driver case
2:refine some doc

Jeff Guo (5):
net/ixgbe: maximize vector rx burst for ixgbe
net/i40e: maximize vector rx burst for i40e
net/ice: maximize vector rx burst for ice
net/iavf: maximize vector rx burst for iavf
net/fm10k: maximize vector rx burst for fm10k

 drivers/net/fm10k/fm10k_rxtx_vec.c       |  39 +++++++--
 drivers/net/i40e/i40e_rxtx_vec_altivec.c |  61 ++++++++-----
 drivers/net/i40e/i40e_rxtx_vec_avx2.c    |  13 +--
 drivers/net/i40e/i40e_rxtx_vec_neon.c    |  55 +++++++-----
 drivers/net/i40e/i40e_rxtx_vec_sse.c     |  55 +++++++-----
 drivers/net/iavf/iavf_rxtx_vec_avx2.c    |  21 +----
 drivers/net/iavf/iavf_rxtx_vec_sse.c     | 107 ++++++++++++++---------
 drivers/net/ice/ice_rxtx_vec_avx2.c      |  11 +--
 drivers/net/ice/ice_rxtx_vec_sse.c       |  49 +++++++----
 drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c  |  72 +++++++--------
 drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c   |  56 ++++++------
 11 files changed, 312 insertions(+), 227 deletions(-)
Signature · 1 line
2.20.1
author
#1 lore raw

PATCH v2 1/5 net/ixgbe: maximize vector rx burst for ixgbe

The limitation of burst size in vector rx was removed, since it should retrieve as much received packets as possible. And also the scattered receive path should use a wrapper function to achieve the goal of burst maximizing.

---
 drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c | 72 +++++++++++++------------
 drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c  | 56 ++++++++++---------
 2 files changed, 68 insertions(+), 60 deletions(-)
drivers/net/ixgbe/ixgbe_rxtx_vec_neon.c +37 -35
index aa27ee177..580a5ed12 100644
@@ -130,17 +130,6 @@ desc_to_olflags_v(uint8x16x2_t sterr_tmp1, uint8x16x2_t sterr_tmp2,
 	rx_pkts[3]->ol_flags = vol.e[3];
 }
 
-/*
- * vPMD raw receive routine, only accept(nb_pkts >= RTE_IXGBE_DESCS_PER_LOOP)
- *
- * Notice:
- * - nb_pkts < RTE_IXGBE_DESCS_PER_LOOP, just return no packet
- * - nb_pkts > RTE_IXGBE_MAX_RX_BURST, only scan RTE_IXGBE_MAX_RX_BURST
- *   numbers of DD bit
- * - floor align nb_pkts to a RTE_IXGBE_DESC_PER_LOOP power-of-two
- * - don't support ol_flags for rss and csum err
- */
-
 #define IXGBE_VPMD_DESC_EOP_MASK	0x02020202
 #define IXGBE_UINT8_BIT			(CHAR_BIT * sizeof(uint8_t))
 
@@ -206,6 +195,13 @@ desc_to_ptype_v(uint64x2_t descs[4], uint16_t pkt_type_mask,
 				vgetq_lane_u32(tunnel_check, 3));
 }
 
+/**
+ * vPMD raw receive routine, only accept(nb_pkts >= RTE_IXGBE_DESCS_PER_LOOP)
+ *
+ * Notice:
+ * - nb_pkts < RTE_IXGBE_DESCS_PER_LOOP, just return no packet
+ * - floor align nb_pkts to a RTE_IXGBE_DESC_PER_LOOP power-of-two
+ */
 static inline uint16_t
 _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 		   uint16_t nb_pkts, uint8_t *split_packet)
@@ -226,9 +222,6 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 	uint16x8_t crc_adjust = {0, 0, rxq->crc_len, 0,
 				 rxq->crc_len, 0, 0, 0};
 
-	/* nb_pkts shall be less equal than RTE_IXGBE_MAX_RX_BURST */
-	nb_pkts = RTE_MIN(nb_pkts, RTE_IXGBE_MAX_RX_BURST);
-
 	/* nb_pkts has to be floor-aligned to RTE_IXGBE_DESCS_PER_LOOP */
 	nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_IXGBE_DESCS_PER_LOOP);
 
@@ -382,16 +375,6 @@ _recv_raw_pkts_vec(struct ixgbe_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 	return nb_pkts_recd;
 }
 
-/*
- * vPMD receive routine, only accept(nb_pkts >= RTE_IXGBE_DESCS_PER_LOOP)
- *
- * Notice:
- * - nb_pkts < RTE_IXGBE_DESCS_PER_LOOP, just return no packet
- * - nb_pkts > RTE_IXGBE_MAX_RX_BURST, only scan RTE_IXGBE_MAX_RX_BURST
- *   numbers of DD bit
- * - floor align nb_pkts to a RTE_IXGBE_DESC_PER_LOOP power-of-two
- * - don't support ol_flags for rss and csum err
- */
 uint16_t
 ixgbe_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 		uint16_t nb_pkts)
@@ -399,19 +382,12 @@ ixgbe_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 	return _recv_raw_pkts_vec(rx_queue, rx_pkts, nb_pkts, NULL);
 }
 
-/*
+/**
  * vPMD receive routine that reassembles scattered packets
- *
- * Notice:
- * - don't support ol_flags for rss and csum err
- * - nb_pkts < RTE_IXGBE_DESCS_PER_LOOP, just return no packet
- * - nb_pkts > RTE_IXGBE_MAX_RX_BURST, only scan RTE_IXGBE_MAX_RX_BURST
- *   numbers of DD bit
- * - floor align nb_pkts to a RTE_IXGBE_DESC_PER_LOOP power-of-two
  */
-uint16_t
-ixgbe_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
-		uint16_t nb_pkts)
+static uint16_t
+ixgbe_recv_scattered_burst_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
+			       uint16_t nb_pkts)
 {
 	struct ixgbe_rx_queue *rxq = rx_queue;
 	uint8_t split_flags[RTE_IXGBE_MAX_RX_BURST] = {0};
@@ -443,6 +419,32 @@ ixgbe_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 		&split_flags[i]);
 }
 
+/**
+ * vPMD receive routine that reassembles scattered packets.
+ */
+uint16_t
+ixgbe_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
+			      uint16_t nb_pkts)
+{
+	uint16_t retval = 0;
+
+	while (nb_pkts > RTE_IXGBE_MAX_RX_BURST) {
+		uint16_t burst;
+
+		burst = ixgbe_recv_scattered_burst_vec(rx_queue,
+						       rx_pkts + retval,
+						       RTE_IXGBE_MAX_RX_BURST);
+		retval += burst;
+		nb_pkts -= burst;
+		if (burst < RTE_IXGBE_MAX_RX_BURST)
+			return retval;
+	}
+
+	return retval + ixgbe_recv_scattered_burst_vec(rx_queue,
+						       rx_pkts + retval,
+						       nb_pkts);
+}
+
 static inline void
 vtx1(volatile union ixgbe_adv_tx_desc *txdp,
 		struct rte_mbuf *pkt, uint64_t flags)
drivers/net/ixgbe/ixgbe_rxtx_vec_sse.c +31 -25

92 lines not on this page · raw message

Signature · 1 line
2.20.1
author
#2 lore raw

PATCH v2 2/5 net/i40e: maximize vector rx burst for i40e

In reply to Jeff Guo

The limitation of burst size in vector rx was removed, since it should retrieve as much received packets as possible. And also the scattered receive path should use a wrapper function to achieve the goal of burst maximizing.

---
 drivers/net/i40e/i40e_rxtx_vec_altivec.c | 61 +++++++++++++++---------
 drivers/net/i40e/i40e_rxtx_vec_avx2.c    | 13 +----
 drivers/net/i40e/i40e_rxtx_vec_neon.c    | 55 +++++++++++++--------
 drivers/net/i40e/i40e_rxtx_vec_sse.c     | 55 +++++++++++++--------
 4 files changed, 111 insertions(+), 73 deletions(-)
drivers/net/i40e/i40e_rxtx_vec_altivec.c +39 -22
index 6862a017e..2eb45d5a5 100644
@@ -188,11 +188,13 @@ desc_to_ptype_v(vector unsigned long descs[4], struct rte_mbuf **rx_pkts,
 		ptype_tbl[(*(vector unsigned char *)&ptype1)[8]];
 }
 
- /* Notice:
-  * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet
-  * - nb_pkts > RTE_I40E_VPMD_RX_BURST, only scan RTE_I40E_VPMD_RX_BURST
-  *   numbers of DD bits
-  */
+/**
+ * vPMD raw receive routine, only accept(nb_pkts >= RTE_I40E_DESCS_PER_LOOP)
+ *
+ * Notice:
+ * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet
+ * - floor align nb_pkts to a RTE_I40E_DESCS_PER_LOOP power-of-two
+ */
 static inline uint16_t
 _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 		   uint16_t nb_pkts, uint8_t *split_packet)
@@ -214,9 +216,6 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 		};
 	vector unsigned long dd_check, eop_check;
 
-	/* nb_pkts shall be less equal than RTE_I40E_MAX_RX_BURST */
-	nb_pkts = RTE_MIN(nb_pkts, RTE_I40E_MAX_RX_BURST);
-
 	/* nb_pkts has to be floor-aligned to RTE_I40E_DESCS_PER_LOOP */
 	nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_I40E_DESCS_PER_LOOP);
 
@@ -447,11 +446,6 @@ _recv_raw_pkts_vec(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 	return nb_pkts_recd;
 }
 
- /* Notice:
-  * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet
-  * - nb_pkts > RTE_I40E_VPMD_RX_BURST, only scan RTE_I40E_VPMD_RX_BURST
-  *   numbers of DD bits
-  */
 uint16_t
 i40e_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 		   uint16_t nb_pkts)
@@ -459,15 +453,12 @@ i40e_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 	return _recv_raw_pkts_vec(rx_queue, rx_pkts, nb_pkts, NULL);
 }
 
- /* vPMD receive routine that reassembles scattered packets
-  * Notice:
-  * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet
-  * - nb_pkts > RTE_I40E_VPMD_RX_BURST, only scan RTE_I40E_VPMD_RX_BURST
-  *   numbers of DD bits
-  */
-uint16_t
-i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
-			     uint16_t nb_pkts)
+/**
+ * vPMD receive routine that reassembles scattered packets
+ */
+static uint16_t
+i40e_recv_scattered_burst_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
+			      uint16_t nb_pkts)
 {
 	struct i40e_rx_queue *rxq = rx_queue;
 	uint8_t split_flags[RTE_I40E_VPMD_RX_BURST] = {0};
@@ -500,6 +491,32 @@ i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
 		&split_flags[i]);
 }
 
+/**
+ * vPMD receive routine that reassembles scattered packets.
+ */
+uint16_t
+i40e_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
+			     uint16_t nb_pkts)
+{
+	uint16_t retval = 0;
+
+	while (nb_pkts > RTE_I40E_VPMD_RX_BURST) {
+		uint16_t burst;
+
+		burst = i40e_recv_scattered_burst_vec(rx_queue,
+						      rx_pkts + retval,
+						      RTE_I40E_VPMD_RX_BURST);
+		retval += burst;
+		nb_pkts -= burst;
+		if (burst < RTE_I40E_VPMD_RX_BURST)
+			return retval;
+	}
+
+	return retval + i40e_recv_scattered_burst_vec(rx_queue,
+						      rx_pkts + retval,
+						      nb_pkts);
+}
+
 static inline void
 vtx1(volatile struct i40e_tx_desc *txdp,
 	struct rte_mbuf *pkt, uint64_t flags)
drivers/net/i40e/i40e_rxtx_vec_avx2.c +2 -11
index 3bcef1363..690d3d2ba 100644
@@ -729,10 +729,6 @@ _recv_raw_pkts_vec_avx2(struct i40e_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 	return received;
 }
 
-/*
- * Notice:
- * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet
- */
 uint16_t
 i40e_recv_pkts_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
 		   uint16_t nb_pkts)
@@ -740,10 +736,8 @@ i40e_recv_pkts_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
 	return _recv_raw_pkts_vec_avx2(rx_queue, rx_pkts, nb_pkts, NULL);
 }
 
-/*
+/**
  * vPMD receive routine that reassembles single burst of 32 scattered packets
- * Notice:
- * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet
  */
 static uint16_t
 i40e_recv_scattered_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
@@ -781,11 +775,8 @@ i40e_recv_scattered_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
 		&split_flags[i]);
 }
 
-/*
+/**
  * vPMD receive routine that reassembles scattered packets.
- * Main receive routine that can handle arbitrary burst sizes
- * Notice:
- * - nb_pkts < RTE_I40E_DESCS_PER_LOOP, just return no packet
  */
 uint16_t
 i40e_recv_scattered_pkts_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
drivers/net/i40e/i40e_rxtx_vec_neon.c +35 -20

88 lines not on this page · raw message

drivers/net/i40e/i40e_rxtx_vec_sse.c +35 -20

88 lines not on this page · raw message

Signature · 1 line
2.20.1
author
#3 lore raw

PATCH v2 3/5 net/ice: maximize vector rx burst for ice

In reply to Jeff Guo

The limitation of burst size in vector rx was removed, since it should retrieve as much received packets as possible. And also the scattered receive path should use a wrapper function to achieve the goal of burst maximizing.

---
 drivers/net/ice/ice_rxtx_vec_avx2.c | 11 +------
 drivers/net/ice/ice_rxtx_vec_sse.c  | 49 ++++++++++++++++++++---------
 2 files changed, 35 insertions(+), 25 deletions(-)
drivers/net/ice/ice_rxtx_vec_avx2.c +1 -10
index be50677c2..b7e624fda 100644
@@ -603,10 +603,6 @@ _ice_recv_raw_pkts_vec_avx2(struct ice_rx_queue *rxq, struct rte_mbuf **rx_pkts,
 	return received;
 }
 
-/**
- * Notice:
- * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
- */
 uint16_t
 ice_recv_pkts_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
 		       uint16_t nb_pkts)
@@ -615,9 +611,7 @@ ice_recv_pkts_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
 }
 
 /**
- * vPMD receive routine that reassembles single burst of 32 scattered packets
- * Notice:
- * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
+ * vPMD receive routine that reassembles scattered packets
  */
 static uint16_t
 ice_recv_scattered_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
@@ -657,9 +651,6 @@ ice_recv_scattered_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
 
 /**
  * vPMD receive routine that reassembles scattered packets.
- * Main receive routine that can handle arbitrary burst sizes
- * Notice:
- * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
  */
 uint16_t
 ice_recv_scattered_pkts_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
drivers/net/ice/ice_rxtx_vec_sse.c +34 -15

82 lines not on this page · raw message

Signature · 1 line
2.20.1
#4 lore raw

Re: [dpdk-dev] [PATCH v2 3/5] net/ice: maximize vector rx burst for ice

Quoted 30 lines

-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Thursday, August 27, 2020 6:10 PM
To: Yang, Qiming <[email protected]>; Xing, Beilei <[email protected]>; Zhao1, Wei <[email protected]>; Zhang, Qi Z <[email protected]>; Wu, Jingjing <[email protected]>
Cc: Richardson, Bruce <[email protected]>; [email protected]; Guo, Jia <[email protected]>; Zhang, Helin <[email protected]>; [email protected]; Yigit, Ferruh <[email protected]>; [email protected]
Subject: [PATCH v2 3/5] net/ice: maximize vector rx burst for ice

The limitation of burst size in vector rx was removed, since it should retrieve as much received packets as possible. And also the scattered receive path should use a wrapper function to achieve the goal of burst maximizing.

---
 drivers/net/ice/ice_rxtx_vec_avx2.c | 11 +------
drivers/net/ice/ice_rxtx_vec_sse.c  | 49 ++++++++++++++++++++---------
 2 files changed, 35 insertions(+), 25 deletions(-)
drivers/net/ice/ice_rxtx_vec_avx2.c +0 -0
index be50677c2..b7e624fda 100644

drivers/net/ice/ice_rxtx_vec_avx2.c _ice_recv_raw_pkts_vec_avx2(struct ice_rx_queue · line 610

Quoted 8 lines
drivers/net/ice/ice_rxtx_vec_avx2.c +0 -4
@@ -603,10 +603,6 @@ _ice_recv_raw_pkts_vec_avx2(struct ice_rx_queue
 *rxq, struct rte_mbuf **rx_pkts,
 	return received;
 }
 
-/**
- * Notice:
- * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
- */

Actually this is question for all the patches in the patchset.
Why we remove above comment? I think the patch should only target for the case when nb_pkgs > ICE_VPMD_RX_BURST? For small packet number case, nothing changed, right?

Quoted 120 lines
drivers/net/ice/ice_rxtx_vec_avx2.c +0 -0
 uint16_t
 ice_recv_pkts_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
drivers/net/ice/ice_rxtx_vec_avx2.c +1 -3
 		       uint16_t nb_pkts)
@@ -615,9 +611,7 @@ ice_recv_pkts_vec_avx2(void *rx_queue, struct
 rte_mbuf **rx_pkts,  }
 
 /**
- * vPMD receive routine that reassembles single burst of 32 scattered packets
- * Notice:
- * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
+ * vPMD receive routine that reassembles scattered packets
  */
 static uint16_t
 ice_recv_scattered_burst_vec_avx2(void *rx_queue, struct rte_mbuf

**rx_pkts, @@ -657,9 +651,6 @@ ice_recv_scattered_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,

/**
* vPMD receive routine that reassembles scattered packets.
- * Main receive routine that can handle arbitrary burst sizes
- * Notice:
- * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
*/
uint16_t
ice_recv_scattered_pkts_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,

drivers/net/ice/ice_rxtx_vec_sse.c +3 -7
index 382ef31f3..25ae368cc 100644
@@ -205,10 +205,11 @@ ice_rx_desc_to_ptype_v(__m128i descs[4], struct
 rte_mbuf **rx_pkts,  }
 
 /**
+ * vPMD raw receive routine, only accept(nb_pkts >= ICE_DESCS_PER_LOOP)
+ *
  * Notice:
  * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
- * - nb_pkts > ICE_VPMD_RX_BURST, only scan ICE_VPMD_RX_BURST
- *   numbers of DD bits
+ * - floor align nb_pkts to a ICE_DESCS_PER_LOOP power-of-two
  */
 static inline uint16_t
 _ice_recv_raw_pkts_vec(struct ice_rx_queue *rxq, struct rte_mbuf **rx_pkts,
@@ -264,9 +265,6 @@ _ice_recv_raw_pkts_vec(struct ice_rx_queue *rxq,
 struct rte_mbuf **rx_pkts,
 	const __m128i eop_check = _mm_set_epi64x(0x0000000200000002LL,
 						 0x0000000200000002LL);
 
-	/* nb_pkts shall be less equal than ICE_MAX_RX_BURST */
-	nb_pkts = RTE_MIN(nb_pkts, ICE_MAX_RX_BURST);
-
 	/* nb_pkts has to be floor-aligned to ICE_DESCS_PER_LOOP */
 	nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, ICE_DESCS_PER_LOOP);
@@ -444,8 +442,6 @@ _ice_recv_raw_pkts_vec(struct ice_rx_queue *rxq,
 struct rte_mbuf **rx_pkts,
 /**
  * Notice:
  * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
- * - nb_pkts > ICE_VPMD_RX_BURST, only scan ICE_VPMD_RX_BURST
- *   numbers of DD bits
  */
 uint16_t

ice_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, @@ -454,15
+450,12 @@ ice_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,

drivers/net/ice/ice_rxtx_vec_sse.c +5 -8
 	return _ice_recv_raw_pkts_vec(rx_queue, rx_pkts, nb_pkts, NULL);  }
 
-/* vPMD receive routine that reassembles scattered packets
- * Notice:
- * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
- * - nb_pkts > ICE_VPMD_RX_BURST, only scan ICE_VPMD_RX_BURST
- *   numbers of DD bits
+/**
+ * vPMD receive routine that reassembles scattered packets
  */
-uint16_t
-ice_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
-			    uint16_t nb_pkts)
+static uint16_t
+ice_recv_scattered_burst_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
+			     uint16_t nb_pkts)
 {
 	struct ice_rx_queue *rxq = rx_queue;
 	uint8_t split_flags[ICE_VPMD_RX_BURST] = {0}; @@ -496,6 +489,32 @@

ice_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,

drivers/net/ice/ice_rxtx_vec_sse.c +26 -1
 					     &split_flags[i]);
 }
 
+/**
+ * vPMD receive routine that reassembles scattered packets.
+ */
+uint16_t
+ice_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
+			    uint16_t nb_pkts)
+{
+	uint16_t retval = 0;
+
+	while (nb_pkts > ICE_VPMD_RX_BURST) {
+		uint16_t burst;
+
+		burst = ice_recv_scattered_burst_vec(rx_queue,
+						     rx_pkts + retval,
+						     ICE_VPMD_RX_BURST);
+		retval += burst;
+		nb_pkts -= burst;
+		if (burst < ICE_VPMD_RX_BURST)
+			return retval;
+	}
+
+	return retval + ice_recv_scattered_burst_vec(rx_queue,
+						     rx_pkts + retval,
+						     nb_pkts);
+}
+
 static inline void
 ice_vtx1(volatile struct ice_tx_desc *txdp, struct rte_mbuf *pkt,
 	 uint64_t flags)
--

2.20.1

author
#5 lore raw

Re: [dpdk-dev] [PATCH v2 3/5] net/ice: maximize vector rx burst for ice

hi, qi

Quoted 33 lines · Qi Z
Quoted 33 lines

-----Original Message-----
From: Guo, Jia <[email protected]>
Sent: Thursday, August 27, 2020 6:10 PM
To: Yang, Qiming <[email protected]>; Xing, Beilei <[email protected]>; Zhao1, Wei <[email protected]>; Zhang, Qi Z <[email protected]>; Wu, Jingjing <[email protected]>
Cc: Richardson, Bruce <[email protected]>; [email protected]; Guo, Jia <[email protected]>; Zhang, Helin <[email protected]>; [email protected]; Yigit, Ferruh <[email protected]>; [email protected]
Subject: [PATCH v2 3/5] net/ice: maximize vector rx burst for ice

The limitation of burst size in vector rx was removed, since it should retrieve as much received packets as possible. And also the scattered receive path should use a wrapper function to achieve the goal of burst maximizing.

---
  drivers/net/ice/ice_rxtx_vec_avx2.c | 11 +------
drivers/net/ice/ice_rxtx_vec_sse.c  | 49 ++++++++++++++++++++---------
  2 files changed, 35 insertions(+), 25 deletions(-)
drivers/net/ice/ice_rxtx_vec_avx2.c +0 -0
index be50677c2..b7e624fda 100644
@@ -603,10 +603,6 @@ _ice_recv_raw_pkts_vec_avx2(struct ice_rx_queue
 *rxq, struct rte_mbuf **rx_pkts,
  	return received;
  }
 
Quoted 7 lines

drivers/net/ice/ice_rxtx_vec_avx2.c _ice_recv_raw_pkts_vec_avx2(struct ice_rx_queue *rxq, struct rte_mbuf **rx_pkts, · line 609

Quoted 4 lines
drivers/net/ice/ice_rxtx_vec_avx2.c +0 -4
-/**
- * Notice:
- * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
- */

Actually this is question for all the patches in the patchset.
Why we remove above comment? I think the patch should only target for the case when nb_pkgs > ICE_VPMD_RX_BURST? For small packet number case, nothing changed, right?

This is just for doc clean, for the reason that there are no need to duplicate the doc on these layer-by-layer helper functions which are not reflect on code.

And yes, there is not changed for small packet number case.

Quoted 121 lines
Quoted 121 lines
drivers/net/ice/ice_rxtx_vec_avx2.c +0 -0
  uint16_t
  ice_recv_pkts_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,

uint16_t nb_pkts)

drivers/net/ice/ice_rxtx_vec_avx2.c +1 -3
@@ -615,9 +611,7 @@ ice_recv_pkts_vec_avx2(void *rx_queue, struct
 rte_mbuf **rx_pkts,  }
 
  /**
- * vPMD receive routine that reassembles single burst of 32 scattered packets
- * Notice:
- * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
+ * vPMD receive routine that reassembles scattered packets
   */
  static uint16_t
  ice_recv_scattered_burst_vec_avx2(void *rx_queue, struct rte_mbuf

**rx_pkts, @@ -657,9 +651,6 @@ ice_recv_scattered_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,

/**
* vPMD receive routine that reassembles scattered packets.
- * Main receive routine that can handle arbitrary burst sizes
- * Notice:
- * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
*/
uint16_t
ice_recv_scattered_pkts_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,

drivers/net/ice/ice_rxtx_vec_sse.c +3 -7
index 382ef31f3..25ae368cc 100644
@@ -205,10 +205,11 @@ ice_rx_desc_to_ptype_v(__m128i descs[4], struct
 rte_mbuf **rx_pkts,  }
 
  /**
+ * vPMD raw receive routine, only accept(nb_pkts >= ICE_DESCS_PER_LOOP)
+ *
   * Notice:
   * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
- * - nb_pkts > ICE_VPMD_RX_BURST, only scan ICE_VPMD_RX_BURST
- *   numbers of DD bits
+ * - floor align nb_pkts to a ICE_DESCS_PER_LOOP power-of-two
   */
  static inline uint16_t
  _ice_recv_raw_pkts_vec(struct ice_rx_queue *rxq, struct rte_mbuf **rx_pkts,
@@ -264,9 +265,6 @@ _ice_recv_raw_pkts_vec(struct ice_rx_queue *rxq,
 struct rte_mbuf **rx_pkts,
  	const __m128i eop_check = _mm_set_epi64x(0x0000000200000002LL,
  						 0x0000000200000002LL);
 
-	/* nb_pkts shall be less equal than ICE_MAX_RX_BURST */
-	nb_pkts = RTE_MIN(nb_pkts, ICE_MAX_RX_BURST);
-
  	/* nb_pkts has to be floor-aligned to ICE_DESCS_PER_LOOP */
  	nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, ICE_DESCS_PER_LOOP);
@@ -444,8 +442,6 @@ _ice_recv_raw_pkts_vec(struct ice_rx_queue *rxq,
 struct rte_mbuf **rx_pkts,
  /**
   * Notice:
   * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
- * - nb_pkts > ICE_VPMD_RX_BURST, only scan ICE_VPMD_RX_BURST
- *   numbers of DD bits
   */
  uint16_t

ice_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts, @@ -454,15
+450,12 @@ ice_recv_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
return _ice_recv_raw_pkts_vec(rx_queue, rx_pkts, nb_pkts, NULL); }

drivers/net/ice/ice_rxtx_vec_sse.c +5 -8
-/* vPMD receive routine that reassembles scattered packets
- * Notice:
- * - nb_pkts < ICE_DESCS_PER_LOOP, just return no packet
- * - nb_pkts > ICE_VPMD_RX_BURST, only scan ICE_VPMD_RX_BURST
- *   numbers of DD bits
+/**
+ * vPMD receive routine that reassembles scattered packets
   */
-uint16_t
-ice_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
-			    uint16_t nb_pkts)
+static uint16_t
+ice_recv_scattered_burst_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
+			     uint16_t nb_pkts)
  {
  	struct ice_rx_queue *rxq = rx_queue;
  	uint8_t split_flags[ICE_VPMD_RX_BURST] = {0}; @@ -496,6 +489,32 @@

ice_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
&split_flags[i]);
}

drivers/net/ice/ice_rxtx_vec_sse.c +26 -1
+/**
+ * vPMD receive routine that reassembles scattered packets.
+ */
+uint16_t
+ice_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
+			    uint16_t nb_pkts)
+{
+	uint16_t retval = 0;
+
+	while (nb_pkts > ICE_VPMD_RX_BURST) {
+		uint16_t burst;
+
+		burst = ice_recv_scattered_burst_vec(rx_queue,
+						     rx_pkts + retval,
+						     ICE_VPMD_RX_BURST);
+		retval += burst;
+		nb_pkts -= burst;
+		if (burst < ICE_VPMD_RX_BURST)
+			return retval;
+	}
+
+	return retval + ice_recv_scattered_burst_vec(rx_queue,
+						     rx_pkts + retval,
+						     nb_pkts);
+}
+
  static inline void
  ice_vtx1(volatile struct ice_tx_desc *txdp, struct rte_mbuf *pkt,
  	 uint64_t flags)
--

2.20.1

author
#6 lore raw

PATCH v2 4/5 net/iavf: maximize vector rx burst for iavf

In reply to Jeff Guo

The limitation of burst size in vector rx was removed, since it should retrieve as much received packets as possible. And also the scattered receive path should use a wrapper function to achieve the goal of burst maximizing.

---
 drivers/net/iavf/iavf_rxtx_vec_avx2.c |  21 +----
 drivers/net/iavf/iavf_rxtx_vec_sse.c  | 107 ++++++++++++++++----------
 2 files changed, 68 insertions(+), 60 deletions(-)
drivers/net/iavf/iavf_rxtx_vec_avx2.c +1 -20
index e5e0fd309..35166d4c6 100644
@@ -1224,10 +1224,6 @@ _iavf_recv_raw_pkts_vec_avx2_flex_rxd(struct iavf_rx_queue *rxq,
 	return received;
 }
 
-/**
- * Notice:
- * - nb_pkts < IAVF_DESCS_PER_LOOP, just return no packet
- */
 uint16_t
 iavf_recv_pkts_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
 			uint16_t nb_pkts)
@@ -1235,10 +1231,6 @@ iavf_recv_pkts_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
 	return _iavf_recv_raw_pkts_vec_avx2(rx_queue, rx_pkts, nb_pkts, NULL);
 }
 
-/**
- * Notice:
- * - nb_pkts < IAVF_DESCS_PER_LOOP, just return no packet
- */
 uint16_t
 iavf_recv_pkts_vec_avx2_flex_rxd(void *rx_queue, struct rte_mbuf **rx_pkts,
 				 uint16_t nb_pkts)
@@ -1249,8 +1241,6 @@ iavf_recv_pkts_vec_avx2_flex_rxd(void *rx_queue, struct rte_mbuf **rx_pkts,
 
 /**
  * vPMD receive routine that reassembles single burst of 32 scattered packets
- * Notice:
- * - nb_pkts < IAVF_DESCS_PER_LOOP, just return no packet
  */
 static uint16_t
 iavf_recv_scattered_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
@@ -1290,9 +1280,6 @@ iavf_recv_scattered_burst_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
 
 /**
  * vPMD receive routine that reassembles scattered packets.
- * Main receive routine that can handle arbitrary burst sizes
- * Notice:
- * - nb_pkts < IAVF_DESCS_PER_LOOP, just return no packet
  */
 uint16_t
 iavf_recv_scattered_pkts_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
@@ -1313,10 +1300,7 @@ iavf_recv_scattered_pkts_vec_avx2(void *rx_queue, struct rte_mbuf **rx_pkts,
 }
 
 /**
- * vPMD receive routine that reassembles single burst of
- * 32 scattered packets for flex RxD
- * Notice:
- * - nb_pkts < IAVF_DESCS_PER_LOOP, just return no packet
+ * vPMD receive routine that reassembles scattered packets for flex RxD
  */
 static uint16_t
 iavf_recv_scattered_burst_vec_avx2_flex_rxd(void *rx_queue,
@@ -1357,9 +1341,6 @@ iavf_recv_scattered_burst_vec_avx2_flex_rxd(void *rx_queue,
 
 /**
  * vPMD receive routine that reassembles scattered packets for flex RxD.
- * Main receive routine that can handle arbitrary burst sizes
- * Notice:
- * - nb_pkts < IAVF_DESCS_PER_LOOP, just return no packet
  */
 uint16_t
 iavf_recv_scattered_pkts_vec_avx2_flex_rxd(void *rx_queue,
drivers/net/iavf/iavf_rxtx_vec_sse.c +67 -40

165 lines not on this page · raw message

Signature · 1 line
2.20.1
author
#7 lore raw

PATCH v2 5/5 net/fm10k: maximize vector rx burst for fm10k

In reply to Jeff Guo

The limitation of burst size in vector rx was removed, since it should retrieve as much received packets as possible. And also the scattered receive path should use a wrapper function to achieve the goal of burst maximizing.

---
 drivers/net/fm10k/fm10k_rxtx_vec.c | 39 +++++++++++++++++++++++-------
 1 file changed, 30 insertions(+), 9 deletions(-)
drivers/net/fm10k/fm10k_rxtx_vec.c +30 -9
index eff3933b5..8d413b542 100644
@@ -645,25 +645,20 @@ fm10k_reassemble_packets(struct fm10k_rx_queue *rxq,
 	return pkt_idx;
 }
 
-/*
+/**
  * vPMD receive routine that reassembles scattered packets
  *
  * Notice:
  * - don't support ol_flags for rss and csum err
- * - nb_pkts > RTE_FM10K_MAX_RX_BURST, only scan RTE_FM10K_MAX_RX_BURST
- *   numbers of DD bit
  */
-uint16_t
-fm10k_recv_scattered_pkts_vec(void *rx_queue,
-				struct rte_mbuf **rx_pkts,
-				uint16_t nb_pkts)
+static uint16_t
+fm10k_recv_scattered_burst_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
+			       uint16_t nb_pkts)
 {
 	struct fm10k_rx_queue *rxq = rx_queue;
 	uint8_t split_flags[RTE_FM10K_MAX_RX_BURST] = {0};
 	unsigned i = 0;
 
-	/* Split_flags only can support max of RTE_FM10K_MAX_RX_BURST */
-	nb_pkts = RTE_MIN(nb_pkts, RTE_FM10K_MAX_RX_BURST);
 	/* get some new buffers */
 	uint16_t nb_bufs = fm10k_recv_raw_pkts_vec(rxq, rx_pkts, nb_pkts,
 			split_flags);
@@ -691,6 +686,32 @@ fm10k_recv_scattered_pkts_vec(void *rx_queue,
 		&split_flags[i]);
 }
 
+/**
+ * vPMD receive routine that reassembles scattered packets.
+ */
+uint16_t
+fm10k_recv_scattered_pkts_vec(void *rx_queue, struct rte_mbuf **rx_pkts,
+			      uint16_t nb_pkts)
+{
+	uint16_t retval = 0;
+
+	while (nb_pkts > RTE_FM10K_MAX_RX_BURST) {
+		uint16_t burst;
+
+		burst = fm10k_recv_scattered_burst_vec(rx_queue,
+						       rx_pkts + retval,
+						       RTE_FM10K_MAX_RX_BURST);
+		retval += burst;
+		nb_pkts -= burst;
+		if (burst < RTE_FM10K_MAX_RX_BURST)
+			return retval;
+	}
+
+	return retval + fm10k_recv_scattered_burst_vec(rx_queue,
+						       rx_pkts + retval,
+						       nb_pkts);
+}
+
 static const struct fm10k_txq_ops vec_txq_ops = {
 	.reset = fm10k_reset_tx_queue,
 };
Signature · 1 line
2.20.1
#8 lore raw
In reply to Jeff Guo
Quoted 8 lines

From: Jeff Guo [mailto:[email protected]]
Sent: Thursday, August 27, 2020 12:10 PM

The limitation of burst size in vector rx was removed, since it should retrieve as much received packets as possible. And also the scattered receive path should use a wrapper function to achieve the goal of burst maximizing.

Quoted 7 lines

This patch set aims to maximize vector rx burst for for ixgbe/i40e/ice/iavf/fm10k PMDs.

v2->v1:
1:add fm10k driver case
2:refine some doc

I now noticed that the vector functions also does:
nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_I40E_DESCS_PER_LOOP);

I am not sure about this, but if I read it correctly, calling rte_eth_rx_burst() with nb_pkts = 33 (not 32) would only return 32 packets, even if more packets are available. (I assume that RTE_I40E_DESCS_PER_LOOP is 32.) In this case, I guess that you need to read the remaining of the requested packets using the non-vector function in order to support any nb_pkts value.

That is, unless the rte_eth_rx_burst() API is extended with requirements to nb_pkts, as discussed in the other thread:
http://inbox.dpdk.org/dev/[email protected]/T/#mc8051e9022d6aeb20c51c5a226b2274d3d6d4266

Med venlig hilsen / kind regards
- Morten Brørup

#9 lore raw
Quoted 26 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Morten Brørup
Sent: Thursday, August 27, 2020 20:38
To: Guo, Jia <[email protected]>; Yang, Qiming <[email protected]>; Xing, Beilei <[email protected]>; Zhao1, Wei <[email protected]>; Zhang, Qi Z <[email protected]>; Wu, Jingjing <[email protected]>
Cc: Richardson, Bruce <[email protected]>; [email protected]; Zhang, Helin <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 0/5] maximize vector rx burst for PMDs

Quoted 8 lines

From: Jeff Guo [mailto:[email protected]]
Sent: Thursday, August 27, 2020 12:10 PM

The limitation of burst size in vector rx was removed, since it should retrieve as much received packets as possible. And also the scattered receive path should use a wrapper function to achieve the goal of burst maximizing.

Quoted 7 lines

This patch set aims to maximize vector rx burst for for ixgbe/i40e/ice/iavf/fm10k PMDs.

v2->v1:
1:add fm10k driver case
2:refine some doc

Quoted 8 lines

I now noticed that the vector functions also does:
nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_I40E_DESCS_PER_LOOP);

I am not sure about this, but if I read it correctly, calling rte_eth_rx_burst() with nb_pkts = 33 (not 32) would only return 32 packets, even if more packets are available. (I assume that RTE_I40E_DESCS_PER_LOOP is 32.) In this case, I guess that you need to read the remaining of the requested packets using the non-vector function in order to support any nb_pkts value.

This is vector instruction handling design requirement, like for avx2: #define ICE_DESCS_PER_LOOP_AVX 8, if deep into the real loop handling, you will get the point why doing RTE_ALIGN_FLOOR. ;-)

_ice_recv_raw_pkts_vec_avx2:
for (i = 0, received = 0; i < nb_pkts; i += ICE_DESCS_PER_LOOP_AVX, rxdp += ICE_DESCS_PER_LOOP_AVX)

Maybe it is worth to tell PMD to stop using vector by calling rte_eth_rx_queue_setup with the application burst size it wants.

Quoted 10 lines

That is, unless the rte_eth_rx_burst() API is extended with requirements to nb_pkts, as discussed in the other thread:
http://inbox.dpdk.org/dev/20200827114117.GD569@bricha3-
MOBL.ger.corp.intel.com/T/#mc8051e9022d6aeb20c51c5a226b2274d3d6d4266

Med venlig hilsen / kind regards
- Morten Brørup

author
#10 lore raw
Quoted 33 lines · Haiyue
Quoted 25 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Morten Brørup
Sent: Thursday, August 27, 2020 20:38
To: Guo, Jia <[email protected]>; Yang, Qiming <[email protected]>; Xing, Beilei <[email protected]>; Zhao1, Wei <[email protected]>; Zhang, Qi Z <[email protected]>; Wu, Jingjing <[email protected]>
Cc: Richardson, Bruce <[email protected]>; [email protected]; Zhang, Helin <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 0/5] maximize vector rx burst for PMDs

Quoted 8 lines

From: Jeff Guo [mailto:[email protected]]
Sent: Thursday, August 27, 2020 12:10 PM

The limitation of burst size in vector rx was removed, since it should retrieve as much received packets as possible. And also the scattered receive path should use a wrapper function to achieve the goal of burst maximizing.

Quoted 7 lines

This patch set aims to maximize vector rx burst for for ixgbe/i40e/ice/iavf/fm10k PMDs.

v2->v1:
1:add fm10k driver case
2:refine some doc

Quoted 8 lines

I now noticed that the vector functions also does:
nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_I40E_DESCS_PER_LOOP);

I am not sure about this, but if I read it correctly, calling rte_eth_rx_burst() with nb_pkts = 33 (not 32) would only return 32 packets, even if more packets are available. (I assume that RTE_I40E_DESCS_PER_LOOP is 32.) In this case, I guess that you need to read the remaining of the requested packets using the non-vector function in order to support any nb_pkts value.

Quoted 13 lines

This is vector instruction handling design requirement, like for avx2: #define ICE_DESCS_PER_LOOP_AVX 8, if deep into the real loop handling, you will get the point why doing RTE_ALIGN_FLOOR. ;-)

_ice_recv_raw_pkts_vec_avx2:
for (i = 0, received = 0; i < nb_pkts; i += ICE_DESCS_PER_LOOP_AVX, rxdp += ICE_DESCS_PER_LOOP_AVX)

Maybe it is worth to tell PMD to stop using vector by calling rte_eth_rx_queue_setup with the application burst size it wants.

Quoted 4 lines

That is, unless the rte_eth_rx_burst() API is extended with requirements to nb_pkts, as discussed in the other thread:
http://inbox.dpdk.org/dev/20200827114117.GD569@bricha3-
MOBL.ger.corp.intel.com/T/#mc8051e9022d6aeb20c51c5a226b2274d3d6d4266

Agree with above haiyue said, and go through the discuss on the thread, i think vector path was born definitely for the spirit of dpdk, each driver could keep the performance base on

the instinct requirement and define what is the specific "max", the path option could give to app, it could static choose one when set up queue or dynamic but not the driver scope,

document could be add to AVI if need for benefit user.

Quoted 5 lines
Quoted 5 lines

Med venlig hilsen / kind regards
- Morten Brørup

#11 lore raw
Quoted 72 lines

From: dev [mailto:[email protected]] On Behalf Of Jeff Guo
Sent: Friday, August 28, 2020 8:40 AM

Quoted 4 lines · Haiyue
Quoted 4 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Morten Brørup
Sent: Thursday, August 27, 2020 20:38
To: Guo, Jia <[email protected]>; Yang, Qiming

<[email protected]>; Xing, Beilei

Quoted 1 line
Quoted 1 line

<[email protected]>; Zhao1, Wei <[email protected]>; Zhang, Qi

Z <[email protected]>; Wu,

Quoted 2 lines
Quoted 2 lines

Jingjing <[email protected]>
Cc: Richardson, Bruce <[email protected]>; [email protected];

Zhang, Helin <[email protected]>;

Quoted 2 lines
Quoted 2 lines

Yigit, Ferruh <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 0/5] maximize vector rx burst for

PMDs

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

From: Jeff Guo [mailto:[email protected]]
Sent: Thursday, August 27, 2020 12:10 PM

The limitation of burst size in vector rx was removed, since it

should

Quoted 1 line
Quoted 1 line
Quoted 1 line

retrieve as much received packets as possible. And also the

scattered

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines

receive path should use a wrapper function to achieve the goal of burst maximizing.

This patch set aims to maximize vector rx burst for for ixgbe/i40e/ice/iavf/fm10k PMDs.

Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

v2->v1:
1:add fm10k driver case
2:refine some doc

I now noticed that the vector functions also does:
nb_pkts = RTE_ALIGN_FLOOR(nb_pkts, RTE_I40E_DESCS_PER_LOOP);

I am not sure about this, but if I read it correctly, calling

rte_eth_rx_burst() with nb_pkts = 33

Quoted 1 line
Quoted 1 line

(not 32) would only return 32 packets, even if more packets are

available. (I assume that

Quoted 1 line
Quoted 1 line

RTE_I40E_DESCS_PER_LOOP is 32.) In this case, I guess that you need

to read the remaining of the

Quoted 1 line
Quoted 1 line

requested packets using the non-vector function in order to support

any nb_pkts value.

Quoted 2 lines
Quoted 1 line

This is vector instruction handling design requirement, like for

avx2: #define ICE_DESCS_PER_LOOP_AVX 8,

Quoted 1 line

if deep into the real loop handling, you will get the point why doing

RTE_ALIGN_FLOOR. ;-)

Quoted 3 lines

_ice_recv_raw_pkts_vec_avx2:
for (i = 0, received = 0; i < nb_pkts; i += ICE_DESCS_PER_LOOP_AVX,

rxdp += ICE_DESCS_PER_LOOP_AVX)

Quoted 2 lines

Maybe it is worth to tell PMD to stop using vector by calling

rte_eth_rx_queue_setup with the application

Quoted 3 lines

burst size it wants.

Quoted 1 line

That is, unless the rte_eth_rx_burst() API is extended with

requirements to nb_pkts, as discussed in

Quoted 3 lines
Quoted 3 lines

the other thread:
http://inbox.dpdk.org/dev/20200827114117.GD569@bricha3-
MOBL.ger.corp.intel.com/T/#mc8051e9022d6aeb20c51c5a226b2274d3d6d4266

Agree with above haiyue said, and go through the discuss on the thread, i think vector path was born definitely for the spirit of dpdk, each driver could keep the performance base on

Quoted 7 lines

the instinct requirement and define what is the specific "max", the path
option could give to app, it could static choose one when set up queue or dynamic but not the driver scope,

document could be add to AVI if need for benefit user.

Based on the discussion in the other thread, I think a minimum requirement to nb_pkts will be accepted.

On that note, for the series:

#12 lore raw
In reply to Jeff Guo
Quoted 5 lines · On Fri, 28 Aug 2020 14:39:33 +0800 Jeff Guo <[email protected]> wrote:
Quoted 5 lines
Quoted 5 lines

I am not sure about this, but if I read it correctly, calling rte_eth_rx_burst() with nb_pkts = 33 (not 32) would only return 32 packets, even if more packets are available. (I assume that RTE_I40E_DESCS_PER_LOOP is 32.) In this case, I guess that you need to read the remaining of the requested packets using the non-vector function in order to support any nb_pkts value.

Quoted 8 lines
Quoted 8 lines

This is vector instruction handling design requirement, like for avx2: #define ICE_DESCS_PER_LOOP_AVX 8, if deep into the real loop handling, you will get the point why doing RTE_ALIGN_FLOOR. ;-)

_ice_recv_raw_pkts_vec_avx2:
for (i = 0, received = 0; i < nb_pkts; i += ICE_DESCS_PER_LOOP_AVX, rxdp += ICE_DESCS_PER_LOOP_AVX)

Maybe it is worth to tell PMD to stop using vector by calling rte_eth_rx_queue_setup with the application burst size it wants.

There is no need for yet another nerd knob in DPDK.

The driver must accept any burst size > 0.
If it wants to optimize for certain multiples, then it can do so in its burst handler. Like any optimized checksum calculator does.

Let the CPU branch predictor do its job and find the best path through the driver code.

Something like:

uint16_t
my_driver_recv_burst((void *prxq, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)

{
	if (nb_pkts == 32)
		return my_driver_recv_burst32(prxq, rx_pkts, nb_pkts);
	...
	else
		return my_driver_recv_burstN(prxq, rx_pkts, nb_pkts);
	...

}

You could repeatedly call the burst32 if passed large nb_pkts.

#13 lore raw
Quoted 28 lines

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Saturday, August 29, 2020 04:31
To: Guo, Jia <[email protected]>
Cc: Wang, Haiyue <[email protected]>; Morten Brørup <[email protected]>; Yang, Qiming <[email protected]>; Xing, Beilei <[email protected]>; Zhao1, Wei <[email protected]>; Zhang, Qi Z <[email protected]>; Wu, Jingjing <[email protected]>; Richardson, Bruce <[email protected]>; [email protected]; Zhang, Helin <[email protected]>; Yigit, Ferruh <[email protected]>; [email protected]
Subject: Re: [dpdk-dev] [PATCH v2 0/5] maximize vector rx burst for PMDs

Quoted 1 line · On Fri, 28 Aug 2020 14:39:33 +0800 Jeff Guo <[email protected]> wrote:
Quoted 1 line
Quoted 1 line

I am not sure about this, but if I read it correctly, calling rte_eth_rx_burst() with nb_pkts =

33

Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

(not 32) would only return 32 packets, even if more packets are available. (I assume that RTE_I40E_DESCS_PER_LOOP is 32.) In this case, I guess that you need to read the remaining of the requested packets using the non-vector function in order to support any nb_pkts value.

This is vector instruction handling design requirement, like for avx2: #define

ICE_DESCS_PER_LOOP_AVX 8,

Quoted 6 lines
Quoted 6 lines

if deep into the real loop handling, you will get the point why doing RTE_ALIGN_FLOOR. ;-)

_ice_recv_raw_pkts_vec_avx2:
for (i = 0, received = 0; i < nb_pkts; i += ICE_DESCS_PER_LOOP_AVX, rxdp += ICE_DESCS_PER_LOOP_AVX)

Maybe it is worth to tell PMD to stop using vector by calling rte_eth_rx_queue_setup with the

Quoted 8 lines

application

Quoted 1 line
Quoted 1 line

burst size it wants.

There is no need for yet another nerd knob in DPDK.

The driver must accept any burst size > 0.
If it wants to optimize for certain multiples, then it can do so in its burst handler. Like any optimized checksum calculator does.

I think if people care about performance, then PMDs have done every possible methods like the burst size, then no need to invent their burst handers. ;-)

At least, burst size is an optimize hit for performance.