From 7c45f6c0794858999696f1f54b59d2a0e436e68b Mon Sep 17 00:00:00 2001 From: Ferruh Yigit Date: Wed, 9 May 2018 23:09:04 +0100 Subject: [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") Signed-off-by: Ferruh Yigit Acked-by: Shahaf Shuler Acked-by: Bernard Iremonger --- 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 e86cca1e77..1344016032 100644 --- a/app/test-pmd/testpmd.c +++ b/app/test-pmd/testpmd.c @@ -706,6 +706,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.20.1