Skip to contentSkip to conversation

net/cpfl: fix datapath function configuration

PATCH Superseded Wenjun Wu 3 participants 5 messages Sep 19, 2023 – Sep 26, 2023 Network drivers

lore
Share & tools
lore

Wenjun Wu

author
#0 lore raw

PATCH 1/1 net/cpfl: fix datapath function configuration

Vector datapath is not support any advanced features for now, so disable vector path if TX checksum offload or RX scatter is enabled.

Fixes 2f39845891e6 ("net/cpfl: add AVX512 data path for single queue model")
---
 drivers/net/cpfl/cpfl_rxtx_vec_common.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/cpfl/cpfl_rxtx_vec_common.h +5 -1
index d8e9191196..9d48620cee 100644
@@ -25,7 +25,11 @@
 		RTE_ETH_RX_OFFLOAD_TIMESTAMP)
 #define CPFL_TX_NO_VECTOR_FLAGS (		\
 		RTE_ETH_TX_OFFLOAD_TCP_TSO |	\
-		RTE_ETH_TX_OFFLOAD_MULTI_SEGS)
+		RTE_ETH_TX_OFFLOAD_MULTI_SEGS |	\
+		RTE_ETH_TX_OFFLOAD_IPV4_CKSUM |		\
+		RTE_ETH_TX_OFFLOAD_SCTP_CKSUM |		\
+		RTE_ETH_TX_OFFLOAD_UDP_CKSUM |	\
+		RTE_ETH_TX_OFFLOAD_TCP_CKSUM)
 
 static inline int
 cpfl_rx_vec_queue_default(struct idpf_rx_queue *rxq)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v2 1/1 net/cpfl: fix datapath function configuration

Vector datapath is not support any advanced features for now, so disable vector path if TX checksum offload or RX scatter is enabled.

Fixes 2f39845891e6 ("net/cpfl: add AVX512 data path for single queue model")

---
v2: disable vector path for scatter cases.

---
 drivers/net/cpfl/cpfl_rxtx_vec_common.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/cpfl/cpfl_rxtx_vec_common.h +8 -1
index d8e9191196..479e1ddcb9 100644
@@ -25,7 +25,11 @@
 		RTE_ETH_RX_OFFLOAD_TIMESTAMP)
 #define CPFL_TX_NO_VECTOR_FLAGS (		\
 		RTE_ETH_TX_OFFLOAD_TCP_TSO |	\
-		RTE_ETH_TX_OFFLOAD_MULTI_SEGS)
+		RTE_ETH_TX_OFFLOAD_MULTI_SEGS |	\
+		RTE_ETH_TX_OFFLOAD_IPV4_CKSUM |		\
+		RTE_ETH_TX_OFFLOAD_SCTP_CKSUM |		\
+		RTE_ETH_TX_OFFLOAD_UDP_CKSUM |	\
+		RTE_ETH_TX_OFFLOAD_TCP_CKSUM)
 
 static inline int
 cpfl_rx_vec_queue_default(struct idpf_rx_queue *rxq)
@@ -81,6 +85,9 @@ cpfl_rx_vec_dev_check_default(struct rte_eth_dev *dev)
 	struct cpfl_rx_queue *cpfl_rxq;
 	int i, default_ret, splitq_ret, ret = CPFL_SCALAR_PATH;
 
+	if (dev->data->scattered_rx)
+		return CPFL_SCALAR_PATH;
+
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
 		cpfl_rxq = dev->data->rx_queues[i];
 		default_ret = cpfl_rx_vec_queue_default(&cpfl_rxq->base);
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH v3 1/1 net/cpfl: fix datapath function configuration

In reply to Wenjun Wu

Vector datapath does not support any advanced features for now, so disable vector path if TX checksum offload or RX scatter is enabled.

Fixes 2f39845891e6 ("net/cpfl: add AVX512 data path for single queue model")

---
v3: fix log typo.
v2: disable vector path for scatter cases.

---
 drivers/net/cpfl/cpfl_rxtx_vec_common.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/cpfl/cpfl_rxtx_vec_common.h +8 -1
index d8e9191196..479e1ddcb9 100644
@@ -25,7 +25,11 @@
 		RTE_ETH_RX_OFFLOAD_TIMESTAMP)
 #define CPFL_TX_NO_VECTOR_FLAGS (		\
 		RTE_ETH_TX_OFFLOAD_TCP_TSO |	\
-		RTE_ETH_TX_OFFLOAD_MULTI_SEGS)
+		RTE_ETH_TX_OFFLOAD_MULTI_SEGS |	\
+		RTE_ETH_TX_OFFLOAD_IPV4_CKSUM |		\
+		RTE_ETH_TX_OFFLOAD_SCTP_CKSUM |		\
+		RTE_ETH_TX_OFFLOAD_UDP_CKSUM |	\
+		RTE_ETH_TX_OFFLOAD_TCP_CKSUM)
 
 static inline int
 cpfl_rx_vec_queue_default(struct idpf_rx_queue *rxq)
@@ -81,6 +85,9 @@ cpfl_rx_vec_dev_check_default(struct rte_eth_dev *dev)
 	struct cpfl_rx_queue *cpfl_rxq;
 	int i, default_ret, splitq_ret, ret = CPFL_SCALAR_PATH;
 
+	if (dev->data->scattered_rx)
+		return CPFL_SCALAR_PATH;
+
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
 		cpfl_rxq = dev->data->rx_queues[i];
 		default_ret = cpfl_rx_vec_queue_default(&cpfl_rxq->base);
Signature · 1 line
2.34.1
Acked-by on v3 1/1
#3 lore raw
Quoted 54 lines

-----Original Message-----
From: Wu, Wenjun1 <[email protected]>
Sent: Tuesday, September 26, 2023 2:05 PM
To: [email protected]; Zhang, Yuying <[email protected]>; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: Wu, Wenjun1 <[email protected]>
Subject: [PATCH v3] net/cpfl: fix datapath function configuration

Vector datapath does not support any advanced features for now, so disable vector path if TX checksum offload or RX scatter is enabled.

Fixes 2f39845891e6 ("net/cpfl: add AVX512 data path for single queue

model")

---
v3: fix log typo.
v2: disable vector path for scatter cases.

---
 drivers/net/cpfl/cpfl_rxtx_vec_common.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/cpfl/cpfl_rxtx_vec_common.h +5 -1
index d8e9191196..479e1ddcb9 100644
@@ -25,7 +25,11 @@
 		RTE_ETH_RX_OFFLOAD_TIMESTAMP)
 #define CPFL_TX_NO_VECTOR_FLAGS (		\
 		RTE_ETH_TX_OFFLOAD_TCP_TSO |	\
-		RTE_ETH_TX_OFFLOAD_MULTI_SEGS)
+		RTE_ETH_TX_OFFLOAD_MULTI_SEGS |	\
+		RTE_ETH_TX_OFFLOAD_IPV4_CKSUM |		\
+		RTE_ETH_TX_OFFLOAD_SCTP_CKSUM |		\
+		RTE_ETH_TX_OFFLOAD_UDP_CKSUM |	\
+		RTE_ETH_TX_OFFLOAD_TCP_CKSUM)
 
 static inline int
 cpfl_rx_vec_queue_default(struct idpf_rx_queue *rxq) @@ -81,6 +85,9 @@

cpfl_rx_vec_dev_check_default(struct rte_eth_dev *dev)

drivers/net/cpfl/cpfl_rxtx_vec_common.h +3 -1
 	struct cpfl_rx_queue *cpfl_rxq;
 	int i, default_ret, splitq_ret, ret = CPFL_SCALAR_PATH;
 
+	if (dev->data->scattered_rx)
+		return CPFL_SCALAR_PATH;
+
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
 		cpfl_rxq = dev->data->rx_queues[i];
 		default_ret = cpfl_rx_vec_queue_default(&cpfl_rxq->base);
--
Quoted 1 line

2.34.1

Applied
#4 lore raw
Quoted 56 lines

-----Original Message-----
From: Xing, Beilei <[email protected]>
Sent: Tuesday, September 26, 2023 2:00 PM
To: Wu, Wenjun1 <[email protected]>; [email protected]; Zhang, Yuying <[email protected]>; Zhang, Qi Z <[email protected]>
Subject: RE: [PATCH v3] net/cpfl: fix datapath function configuration

Quoted 45 lines

-----Original Message-----
From: Wu, Wenjun1 <[email protected]>
Sent: Tuesday, September 26, 2023 2:05 PM
To: [email protected]; Zhang, Yuying <[email protected]>; Xing, Beilei <[email protected]>; Zhang, Qi Z <[email protected]>
Cc: Wu, Wenjun1 <[email protected]>
Subject: [PATCH v3] net/cpfl: fix datapath function configuration

Vector datapath does not support any advanced features for now, so disable vector path if TX checksum offload or RX scatter is enabled.

Fixes 2f39845891e6 ("net/cpfl: add AVX512 data path for single queue

model")

---
v3: fix log typo.
v2: disable vector path for scatter cases.

---
 drivers/net/cpfl/cpfl_rxtx_vec_common.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/net/cpfl/cpfl_rxtx_vec_common.h +5 -1
index d8e9191196..479e1ddcb9 100644
@@ -25,7 +25,11 @@
 		RTE_ETH_RX_OFFLOAD_TIMESTAMP)
 #define CPFL_TX_NO_VECTOR_FLAGS (		\
 		RTE_ETH_TX_OFFLOAD_TCP_TSO |	\
-		RTE_ETH_TX_OFFLOAD_MULTI_SEGS)
+		RTE_ETH_TX_OFFLOAD_MULTI_SEGS |	\
+		RTE_ETH_TX_OFFLOAD_IPV4_CKSUM |		\
+		RTE_ETH_TX_OFFLOAD_SCTP_CKSUM |		\
+		RTE_ETH_TX_OFFLOAD_UDP_CKSUM |	\
+		RTE_ETH_TX_OFFLOAD_TCP_CKSUM)
 
 static inline int
 cpfl_rx_vec_queue_default(struct idpf_rx_queue *rxq) @@ -81,6 +85,9

@@ cpfl_rx_vec_dev_check_default(struct rte_eth_dev *dev)

drivers/net/cpfl/cpfl_rxtx_vec_common.h +0 -0
 	struct cpfl_rx_queue *cpfl_rxq;
 	int i, default_ret, splitq_ret, ret = CPFL_SCALAR_PATH;
Quoted 10 lines
Quoted 8 lines
drivers/net/cpfl/cpfl_rxtx_vec_common.h +3 -1
+	if (dev->data->scattered_rx)
+		return CPFL_SCALAR_PATH;
+
 	for (i = 0; i < dev->data->nb_rx_queues; i++) {
 		cpfl_rxq = dev->data->rx_queues[i];
 		default_ret = cpfl_rx_vec_queue_default(&cpfl_rxq->base);
--

2.34.1

Applied to dpdk-next-net-intel.

Thanks
Qi