From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 May 2018 15:09:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,382,1520924400"; d="scan'208";a="53854997" Received: from silpixa00399777.ir.intel.com (HELO silpixa00399777.ger.corp.intel.com) ([10.237.222.236]) by fmsmga001.fm.intel.com with ESMTP; 09 May 2018 15:09:14 -0700 From: Ferruh Yigit To: Wenzhuo Lu , Jingjing Wu Cc: dev@dpdk.org, Ferruh Yigit , shahafs@mellanox.com, Wei Dai , Qi Zhang Date: Wed, 9 May 2018 23:09:04 +0100 Message-Id: <20180509220904.128983-1-ferruh.yigit@intel.com> X-Mailer: git-send-email 2.14.3 Subject: [dpdk-dev] [PATCH] app/testpmd: check if CRC strip offload supported X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 09 May 2018 22:09:18 -0000 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