app/testpmd: check if CRC strip offload supported
authorFerruh Yigit <ferruh.yigit@intel.com>
Wed, 9 May 2018 22:09:04 +0000 (23:09 +0100)
committerFerruh Yigit <ferruh.yigit@intel.com>
Mon, 14 May 2018 21:32:22 +0000 (22:32 +0100)
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>
app/test-pmd/testpmd.c

index e86cca1..1344016 100644 (file)
@@ -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 &=