Skip to contentSkip to conversation

net/iavf: set CMD bit2 to 1 in Tx Desc of AVX Tx path

PATCH Superseded Leyi Rong 3 participants 5 messages Nov 7, 2019 – Nov 13, 2019 Network drivers

lore
Share & tools
lore

Leyi Rong

author
#0 lore raw

PATCH 1/1 net/iavf: set CMD bit2 to 1 in Tx Desc of AVX Tx path

Fix iavf vf_checksum_sw case fail in X710/XXV710, set bit2 to 1 of CMD field in Tx descriptor of AVX Tx path according to Spec.

Fixes af0c246a3800 ("net/iavf: enable AVX2 for iavf")
---
 drivers/net/iavf/iavf_rxtx_vec_avx2.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/iavf/iavf_rxtx_vec_avx2.c +3 -2
index f0c00be56..2c7375576 100644
@@ -785,8 +785,9 @@ iavf_xmit_fixed_burst_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts,
 	volatile struct iavf_tx_desc *txdp;
 	struct iavf_tx_entry *txep;
 	uint16_t n, nb_commit, tx_id;
-	uint64_t flags = IAVF_TX_DESC_CMD_EOP;
-	uint64_t rs = IAVF_TX_DESC_CMD_RS | IAVF_TX_DESC_CMD_EOP;
+	/* bit2 is reserved and must be set to 1 according to Spec */
+	uint64_t flags = IAVF_TX_DESC_CMD_EOP | 0x04;
+	uint64_t rs = IAVF_TX_DESC_CMD_RS | flags;
 
 	/* cross rx_thresh boundary is not allowed */
 	nb_pkts = RTE_MIN(nb_pkts, txq->rs_thresh);
Signature · 1 line
2.17.1
#1 lore raw
Quoted 26 lines

-----Original Message-----
From: Rong, Leyi <[email protected]>
Sent: Thursday, November 7, 2019 1:22 PM
To: Lu, Wenzhuo <[email protected]>; Zhang, Qi Z <[email protected]>; Ye, Xiaolong <[email protected]>
Cc: [email protected]; Rong, Leyi <[email protected]>
Subject: [PATCH] net/iavf: set CMD bit2 to 1 in Tx Desc of AVX Tx path

Fix iavf vf_checksum_sw case fail in X710/XXV710, set bit2 to 1 of CMD field in Tx descriptor of AVX Tx path according to Spec.

Fixes af0c246a3800 ("net/iavf: enable AVX2 for iavf")
---
 drivers/net/iavf/iavf_rxtx_vec_avx2.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/iavf/iavf_rxtx_vec_avx2.c +0 -0
index f0c00be56..2c7375576 100644

drivers/net/iavf/iavf_rxtx_vec_avx2.c iavf_xmit_fixed_burst_vec_avx2(void *tx_queue, · line 790

Quoted 8 lines
drivers/net/iavf/iavf_rxtx_vec_avx2.c +2 -2
@@ -785,8 +785,9 @@ iavf_xmit_fixed_burst_vec_avx2(void *tx_queue,
 struct rte_mbuf **tx_pkts,
 	volatile struct iavf_tx_desc *txdp;
 	struct iavf_tx_entry *txep;
 	uint16_t n, nb_commit, tx_id;
-	uint64_t flags = IAVF_TX_DESC_CMD_EOP;
-	uint64_t rs = IAVF_TX_DESC_CMD_RS | IAVF_TX_DESC_CMD_EOP;
+	/* bit2 is reserved and must be set to 1 according to Spec */
+	uint64_t flags = IAVF_TX_DESC_CMD_EOP | 0x04;

Better to use macro IAVF_TX_DESC_CMD_ICRC to replace 0x4

Quoted 6 lines
drivers/net/iavf/iavf_rxtx_vec_avx2.c +1 -0
+	uint64_t rs = IAVF_TX_DESC_CMD_RS | flags;
 
 	/* cross rx_thresh boundary is not allowed */

nb_pkts = RTE_MIN(nb_pkts, txq->rs_thresh);
--
2.17.1

author
#2 lore raw

PATCH v2 1/1 net/iavf: set CMD bit2 to 1 in Tx Desc of AVX Tx path

In reply to Leyi Rong

Fix iavf vf_checksum_sw case fail in X710/XXV710, set bit2 to 1 of CMD field in Tx descriptor of AVX Tx path according to Spec.

Fixes af0c246a3800 ("net/iavf: enable AVX2 for iavf")

---
v2:
- Use IAVF_TX_DESC_CMD_ICRC instead of 0x04.

---
 drivers/net/iavf/iavf_rxtx_vec_avx2.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/iavf/iavf_rxtx_vec_avx2.c +3 -2
index f0c00be56..a5133d8d8 100644
@@ -785,8 +785,9 @@ iavf_xmit_fixed_burst_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts,
 	volatile struct iavf_tx_desc *txdp;
 	struct iavf_tx_entry *txep;
 	uint16_t n, nb_commit, tx_id;
-	uint64_t flags = IAVF_TX_DESC_CMD_EOP;
-	uint64_t rs = IAVF_TX_DESC_CMD_RS | IAVF_TX_DESC_CMD_EOP;
+	/* bit2 is reserved and must be set to 1 according to Spec */
+	uint64_t flags = IAVF_TX_DESC_CMD_EOP | IAVF_TX_DESC_CMD_ICRC;
+	uint64_t rs = IAVF_TX_DESC_CMD_RS | flags;
 
 	/* cross rx_thresh boundary is not allowed */
 	nb_pkts = RTE_MIN(nb_pkts, txq->rs_thresh);
Signature · 1 line
2.17.1
Acked-by on v2 1/1
#3 lore raw
Quoted 10 lines

-----Original Message-----
From: Rong, Leyi <[email protected]>
Sent: Tuesday, November 12, 2019 10:42 AM
To: Lu, Wenzhuo <[email protected]>; Zhang, Qi Z <[email protected]>; Ye, Xiaolong <[email protected]>
Cc: [email protected]; Rong, Leyi <[email protected]>
Subject: [PATCH v2] net/iavf: set CMD bit2 to 1 in Tx Desc of AVX Tx path

Quoted 6 lines

Fix iavf vf_checksum_sw case fail in X710/XXV710, set bit2 to 1 of CMD field in Tx descriptor of AVX Tx path according to Spec.

Fixes af0c246a3800 ("net/iavf: enable AVX2 for iavf")
Applied
#4 lore raw
In reply to Leyi Rong
Quoted 33 lines · Leyi Rong

Fix iavf vf_checksum_sw case fail in X710/XXV710, set bit2 to 1 of CMD field in Tx descriptor of AVX Tx path according to Spec.

Fixes af0c246a3800 ("net/iavf: enable AVX2 for iavf")

---
v2:
- Use IAVF_TX_DESC_CMD_ICRC instead of 0x04.
---
drivers/net/iavf/iavf_rxtx_vec_avx2.c | 5 +++--

1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/iavf/iavf_rxtx_vec_avx2.c +3 -2
index f0c00be56..a5133d8d8 100644
@@ -785,8 +785,9 @@ iavf_xmit_fixed_burst_vec_avx2(void *tx_queue, struct rte_mbuf **tx_pkts,
 	volatile struct iavf_tx_desc *txdp;
 	struct iavf_tx_entry *txep;
 	uint16_t n, nb_commit, tx_id;
-	uint64_t flags = IAVF_TX_DESC_CMD_EOP;
-	uint64_t rs = IAVF_TX_DESC_CMD_RS | IAVF_TX_DESC_CMD_EOP;
+	/* bit2 is reserved and must be set to 1 according to Spec */
+	uint64_t flags = IAVF_TX_DESC_CMD_EOP | IAVF_TX_DESC_CMD_ICRC;
+	uint64_t rs = IAVF_TX_DESC_CMD_RS | flags;
 
 	/* cross rx_thresh boundary is not allowed */
 	nb_pkts = RTE_MIN(nb_pkts, txq->rs_thresh);
Signature · 1 line
2.17.1

Applied to dpdk-next-net-intel, Thanks.