From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dispatch1-us1.ppe-hosted.com (dispatch1-us1.ppe-hosted.com [67.231.154.164]) by dpdk.org (Postfix) with ESMTP id 8DB6D231E for ; Tue, 4 Sep 2018 07:55:02 +0200 (CEST) X-Virus-Scanned: Proofpoint Essentials engine Received: from webmail.solarflare.com (uk.solarflare.com [193.34.186.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx1-us1.ppe-hosted.com (Proofpoint Essentials ESMTP Server) with ESMTPS id 0FEE4B00055; Tue, 4 Sep 2018 05:55:01 +0000 (UTC) Received: from [192.168.38.17] (91.220.146.112) by ukex01.SolarFlarecom.com (10.17.10.4) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 4 Sep 2018 06:54:55 +0100 To: Shahaf Shuler , Ferruh Yigit , Thomas Monjalon CC: "dev@dpdk.org" References: <20180903144501.31373-1-ferruh.yigit@intel.com> From: Andrew Rybchenko Message-ID: <8146941d-9e41-0e46-95b3-59f4e61daf0d@solarflare.com> Date: Tue, 4 Sep 2018 08:54:23 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [91.220.146.112] X-ClientProxiedBy: ocex03.SolarFlarecom.com (10.20.40.36) To ukex01.SolarFlarecom.com (10.17.10.4) X-TM-AS-Product-Ver: SMEX-12.5.0.1300-8.5.1010-24072.003 X-TM-AS-Result: No-8.384400-8.000000-10 X-TMASE-MatchedRID: zGP2F0O7j/v4ECMHJTM/uSa1MaKuob8PC/ExpXrHizxm60OoujMOyBfo wFeQOa9D3cvhPuHida+gGpGPi45PfWfwTtWE8r6mOcjnbzvq89+0Hc40PUm6ct9zZd3pUn7KXFF kHPfxNK8QIpeoXM415Tjzq+x6e1nvB7dwWBtziZQdNyNDtbgUEY4lnIgC6UzTZ5yuplze9pvB4p 7juQKdofA3u/dvy0exH2XXM8w5v7pNfs8n85Te8oMbH85DUZXyseWplitmp0j6C0ePs7A07QdNP 5JHgU8A47Y+L8b4CvDNZyR03ypIHpgU5Nnkbb1HutPbkTJFA/AImnGDPcGeWShcPtZsx643zsed Qwzua19zckVbxtwf5MP8X2OVYPrmUdNvZjjOj9C63BPMcrcQuXeYWV2RaAfD+kkf6HhPsBc= X-TM-AS-User-Approved-Sender: Yes X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--8.384400-8.000000 X-TMASE-Version: SMEX-12.5.0.1300-8.5.1010-24072.003 X-MDID: 1536040501-n3nR3f9wTzNW 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 05:55:02 -0000 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.