DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] app/testpmd: check if CRC strip offload supported
@ 2018-05-09 22:09 Ferruh Yigit
  2018-05-10  4:39 ` Shahaf Shuler
  0 siblings, 1 reply; 4+ messages in thread
From: Ferruh Yigit @ 2018-05-09 22:09 UTC (permalink / raw)
  To: Wenzhuo Lu, Jingjing Wu; +Cc: dev, Ferruh Yigit, shahafs, Wei Dai, Qi Zhang

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: shahafs@mellanox.com

Signed-off-by: Ferruh Yigit <ferruh.yigit@intel.com>
---
Cc: Wei Dai <wei.dai@intel.com>
Cc: Qi Zhang <qi.z.zhang@intel.com>
---
 app/test-pmd/testpmd.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index db23f23e5..1938283f6 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -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

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

end of thread, other threads:[~2018-05-11 16:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-09 22:09 [dpdk-dev] [PATCH] app/testpmd: check if CRC strip offload supported Ferruh Yigit
2018-05-10  4:39 ` Shahaf Shuler
2018-05-11 15:36   ` Iremonger, Bernard
2018-05-11 16:27     ` Ferruh Yigit

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).