Skip to contentSkip to conversation

app/testpmd: check if CRC strip offload supported

PATCH In review Ferruh Yigit 3 participants 4 messages May 9, 2018 – May 11, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 app/testpmd: check if CRC strip offload supported

Testpmd set CRC_STRIP offload blindly, this is wrong according offload API definition, and will cause error for the PMDs that doesn't support CRC_STRIP like virtual PMDs.

Check if underlying device report this capability and don't set it if not supported.

Fixes 0074d02fca21 ("app/testpmd: convert to new Rx offloads API")

---
Cc: Wei Dai <[email protected]>
Cc: Qi Zhang <[email protected]>

---
 app/test-pmd/testpmd.c | 5 +++++
 1 file changed, 5 insertions(+)
app/test-pmd/testpmd.c +5 -0
index db23f23e5..1938283f6 100644
@@ -701,6 +701,11 @@ init_config(void)
 		port->dev_conf.txmode = tx_mode;
 		port->dev_conf.rxmode = rx_mode;
 		rte_eth_dev_info_get(pid, &port->dev_info);
+
+		if (!(port->dev_info.rx_offload_capa &
+					DEV_RX_OFFLOAD_CRC_STRIP))
+			port->dev_conf.rxmode.offloads &=
+				~DEV_RX_OFFLOAD_CRC_STRIP;
 		if (!(port->dev_info.tx_offload_capa &
 		      DEV_TX_OFFLOAD_MBUF_FAST_FREE))
 			port->dev_conf.txmode.offloads &=
Signature · 1 line
2.14.3
Acked-by on v1 1/1
#1 lore raw

Thursday, May 10, 2018 1:09 AM, Ferruh Yigit:

Quoted 6 lines

Subject: [PATCH] app/testpmd: check if CRC strip offload supported

Testpmd set CRC_STRIP offload blindly, this is wrong according offload API definition, and will cause error for the PMDs that doesn't support CRC_STRIP like virtual PMDs.

Quoted 7 lines

Check if underlying device report this capability and don't set it if not supported.

Fixes 0074d02fca21 ("app/testpmd: convert to new Rx offloads API")

Yes this is the correct behavior. I hope all the PMDs report the CRC strip correctly.

Quoted 25 lines

---
Cc: Wei Dai <[email protected]>
Cc: Qi Zhang <[email protected]>

---
 app/test-pmd/testpmd.c | 5 +++++
 1 file changed, 5 insertions(+)
app/test-pmd/testpmd.c index renamed from app/test-pmd/testpmd.c +0 -0

db23f23e5..1938283f6 100644

app/test-pmd/testpmd.c +5 -1
@@ -701,6 +701,11 @@ init_config(void)
 		port->dev_conf.txmode = tx_mode;
 		port->dev_conf.rxmode = rx_mode;
 		rte_eth_dev_info_get(pid, &port->dev_info);
+
+		if (!(port->dev_info.rx_offload_capa &
+					DEV_RX_OFFLOAD_CRC_STRIP))
+			port->dev_conf.rxmode.offloads &=
+				~DEV_RX_OFFLOAD_CRC_STRIP;
 		if (!(port->dev_info.tx_offload_capa &
 		      DEV_TX_OFFLOAD_MBUF_FAST_FREE))
 			port->dev_conf.txmode.offloads &=
--

2.14.3

#2 lore raw
Quoted 23 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Shahaf Shuler
Sent: Thursday, May 10, 2018 5:39 AM
To: Yigit, Ferruh <[email protected]>; Lu, Wenzhuo <[email protected]>; Wu, Jingjing <[email protected]>
Cc: [email protected]; Dai, Wei <[email protected]>; Zhang, Qi Z <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: check if CRC strip offload supported

Thursday, May 10, 2018 1:09 AM, Ferruh Yigit:

Quoted 12 lines

Subject: [PATCH] app/testpmd: check if CRC strip offload supported

Testpmd set CRC_STRIP offload blindly, this is wrong according offload API definition, and will cause error for the PMDs that doesn't support CRC_STRIP like virtual PMDs.

Check if underlying device report this capability and don't set it if not supported.

Fixes 0074d02fca21 ("app/testpmd: convert to new Rx offloads API")
Quoted 6 lines
Quoted 1 line

Yes this is the correct behavior. I hope all the PMDs report the CRC strip correctly.

author Applied
#3 lore raw
Quoted 23 lines · Bernard
Quoted 23 lines

-----Original Message-----
From: dev [mailto:[email protected]] On Behalf Of Shahaf Shuler
Sent: Thursday, May 10, 2018 5:39 AM
To: Yigit, Ferruh <[email protected]>; Lu, Wenzhuo <[email protected]>; Wu, Jingjing <[email protected]>
Cc: [email protected]; Dai, Wei <[email protected]>; Zhang, Qi Z <[email protected]>
Subject: Re: [dpdk-dev] [PATCH] app/testpmd: check if CRC strip offload supported

Thursday, May 10, 2018 1:09 AM, Ferruh Yigit:

Quoted 12 lines

Subject: [PATCH] app/testpmd: check if CRC strip offload supported

Testpmd set CRC_STRIP offload blindly, this is wrong according offload API definition, and will cause error for the PMDs that doesn't support CRC_STRIP like virtual PMDs.

Check if underlying device report this capability and don't set it if not supported.

Fixes 0074d02fca21 ("app/testpmd: convert to new Rx offloads API")
Quoted 8 lines
Quoted 6 lines
Quoted 1 line

Yes this is the correct behavior. I hope all the PMDs report the CRC strip correctly.

Applied to dpdk-next-net/master, thanks.