summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFerruh Yigit <ferruh.yigit@intel.com>2018-05-09 23:09:04 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2018-05-14 22:32:22 +0100
commit7c45f6c0794858999696f1f54b59d2a0e436e68b (patch)
tree17dfdc64eb36db5a1ecc25257f5dec763b450a1b
parent907252079a0cf56b61754a59739e3a5703b28524 (diff)
downloaddpdk-7c45f6c0794858999696f1f54b59d2a0e436e68b.zip
dpdk-7c45f6c0794858999696f1f54b59d2a0e436e68b.tar.gz
dpdk-7c45f6c0794858999696f1f54b59d2a0e436e68b.tar.xz
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 <ferruh.yigit@intel.com> Acked-by: Shahaf Shuler <shahafs@mellanox.com> Acked-by: Bernard Iremonger <bernard.iremonger@intel.com>
-rw-r--r--app/test-pmd/testpmd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index e86cca1..1344016 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 &=