From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id A67251BE0 for ; Tue, 4 Sep 2018 10:06:25 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Sep 2018 01:06:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.53,328,1531810800"; d="scan'208";a="259636892" Received: from fyigit-mobl.ger.corp.intel.com (HELO [10.237.221.56]) ([10.237.221.56]) by fmsmga005.fm.intel.com with ESMTP; 04 Sep 2018 01:06:16 -0700 To: Andrew Rybchenko , Shahaf Shuler , Thomas Monjalon Cc: "dev@dpdk.org" References: <20180903144501.31373-1-ferruh.yigit@intel.com> <8146941d-9e41-0e46-95b3-59f4e61daf0d@solarflare.com> From: Ferruh Yigit Openpgp: preference=signencrypt Message-ID: <78b3f188-36d5-226b-66af-dae22c64c479@intel.com> Date: Tue, 4 Sep 2018 09:06:15 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <8146941d-9e41-0e46-95b3-59f4e61daf0d@solarflare.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] ethdev: make default behavior CRC strip on Rx 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: Tue, 04 Sep 2018 08:06:26 -0000 On 9/4/2018 6:54 AM, Andrew Rybchenko wrote: > On 09/04/2018 08:17 AM, Shahaf Shuler wrote: >> Hi Ferruh, >> >> Monday, September 3, 2018 5:45 PM, Ferruh Yigit: >>> Removed DEV_RX_OFFLOAD_CRC_STRIP offload flag. >>> Without any specific Rx offload flag, default behavior by PMDs is to >>> strip CRC. >>> >>> PMDs that support keeping CRC should advertise >>> DEV_RX_OFFLOAD_KEEP_CRC >>> Rx offload capability. >>> >>> Applications that require keeping CRC should check PMD capability first >>> and if it is supported can enable this feature by setting >>> DEV_RX_OFFLOAD_KEEP_CRC in Rx offload flag in rte_eth_dev_configure() >>> >>> Signed-off-by: Ferruh Yigit >>> --- >> [...] >> >>> diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c >>> index 1f7bfd441..718f4b1d9 100644 >>> --- a/drivers/net/mlx5/mlx5_rxq.c >>> +++ b/drivers/net/mlx5/mlx5_rxq.c >>> @@ -388,7 +388,6 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev >>> *dev) >>> DEV_RX_OFFLOAD_TIMESTAMP | >>> DEV_RX_OFFLOAD_JUMBO_FRAME); >>> >>> - offloads |= DEV_RX_OFFLOAD_CRC_STRIP; >>> if (config->hw_fcs_strip) >>> offloads |= DEV_RX_OFFLOAD_KEEP_CRC; >>> >>> @@ -1438,7 +1437,7 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t >>> idx, uint16_t desc, >>> tmpl->rxq.vlan_strip = !!(offloads & DEV_RX_OFFLOAD_VLAN_STRIP); >>> /* By default, FCS (CRC) is stripped by hardware. */ >>> tmpl->rxq.crc_present = 0; >>> - if (rte_eth_dev_must_keep_crc(offloads)) { >>> + if (offloads | DEV_RX_OFFLOAD_KEEP_CRC) { >> I don't understand this logic, and it exists on many other location in the patch. >> Shouldn't it be (offloads & DEV_RX_OFFLOAD_KEEP_CRC) ? > > OMG, how can I overlook it on my review. Really good catch. Same here, new version coming soon.