From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: [PATCH] app/testpmd: check if CRC strip offload supported Date: Wed, 9 May 2018 23:09:04 +0100 Message-ID: <20180509220904.128983-1-ferruh.yigit@intel.com> Cc: dev@dpdk.org, Ferruh Yigit , shahafs@mellanox.com, Wei Dai , Qi Zhang To: Wenzhuo Lu , Jingjing Wu Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 189495587 for ; Thu, 10 May 2018 00:09:16 +0200 (CEST) List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 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 --- Cc: Wei Dai Cc: Qi Zhang --- 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