From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0046.outbound.protection.outlook.com [104.47.2.46]) by dpdk.org (Postfix) with ESMTP id D212A231E for ; Tue, 4 Sep 2018 07:17:22 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Mellanox.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=e4X2VTSA3GWfLo8ckhdLvkXlX9Csr5yfS4A2RUshaes=; b=N6B36ZDfn8sq5+662Ocg/hODuBgd0xcSNyqy9h7w3DMf4e6fE9UT6xK6rWRKNGoDDUMj+ih9mt6e4OdXojW9pdiobmgcegkcnyvUETcknH9SNUJfG+bvzOQdYvDWGhnrOLI8NwIsgCWFOQQD13nSZyw53RqdxWOxe+q1FHd+QYk= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB4169.eurprd05.prod.outlook.com (52.134.107.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1080.17; Tue, 4 Sep 2018 05:17:21 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::c8e7:d9c1:5054:693b]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::c8e7:d9c1:5054:693b%6]) with mapi id 15.20.1101.016; Tue, 4 Sep 2018 05:17:21 +0000 From: Shahaf Shuler To: Ferruh Yigit , Andrew Rybchenko , Thomas Monjalon CC: "dev@dpdk.org" Thread-Topic: [PATCH] ethdev: make default behavior CRC strip on Rx Thread-Index: AQHUQ4xqFykpMwLPwEGp5kZuL+7MSaTfla8w Date: Tue, 4 Sep 2018 05:17:21 +0000 Message-ID: References: <20180903144501.31373-1-ferruh.yigit@intel.com> In-Reply-To: <20180903144501.31373-1-ferruh.yigit@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-originating-ip: [31.154.10.105] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB4169; 6:I5IDz9Usnu4kkFnI6qkEh6IrQZOZNk5/AHKFoNitiE+0foSnE8brrv8F1nq7KOJUD+VXQk/BHVq25R9hlqTkCl9FLDLq57OYYsaInK6yTKZBc24tlDXFGbqeHtifeDt8j8XwogAM3SFY/JWIji6TA/iMtHhqJEpXrdnj1WzKgS5WUgUsnJFy/hB9ZGpzYwHbJF8fI0q21O/v5hPUQVgNcjZRo2c9H8M8b1R4WjoNAsjYNatlVnHd4x4+YpKJAUvYEfYofDiUr+tW9Z9XRi12+PllskxB8EBBpPNwhz51ktI3hfuIENC1+Wy2XhF23ubBZLohNeByEpM4BuRK+IxpK4jSAhUMuRQMpK6aJvlTogxu73ivkSEu1NzevpCDslOQpGOKuBQuj3exrNvRZLPJZZ/9ZwidCWc5R5TNqv1AZAFoKoJ13SF+FbJ17k+HxWXjadgirPZz/lKVvNS7yi886A==; 5:C3wNpIsla3/X26/i0QnM93QwmZHG3+hw9OTPzbYmBMhuF1SSxcBb9/56cwBzFNRTHLmtxBMeEcKATWlYA/j8gXxDtuk5LuxazmTM9PeNPn8kOmeaB234lSjbzYuXMeGS/js1vHWOBqa0Da4hYMopQAEhvaM+imgaWnpanGPS35s=; 7:ynayX5vragjtANMAHOd+FLS0jL1QQO01Syc2JEequ1k7nA/p2nS7p9wfkVR4EMbcvtH+UxL2CGlarIojMCayE6s/MGY/lGDUnjUhcQIIirlij9fHummc/k7R76vF1gvv70pHBHQVM1uyJ8ftpHvU0P+RLWLL/DlhDVKPGNCMFEN5nURsXGHHVE1ylsh/8rBiC5UuPPxWiERh2u5Qzox5LuNyBTfao1xcffVqgbJfup14jX+RRKkdl6yWmbc2Vc09 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 9c0bd05c-a43f-4525-0de2-08d61225b146 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4169; x-ms-traffictypediagnostic: DB7PR05MB4169: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(278428928389397)(228905959029699); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(823301075)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(201708071742011)(7699016); SRVR:DB7PR05MB4169; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4169; x-forefront-prvs: 0785459C39 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(396003)(376002)(39860400002)(346002)(199004)(189003)(2900100001)(99286004)(14454004)(26005)(81166006)(4326008)(7696005)(81156014)(186003)(76176011)(316002)(102836004)(8936002)(11346002)(3846002)(68736007)(6506007)(110136005)(446003)(486006)(6116002)(25786009)(66066001)(256004)(6246003)(476003)(97736004)(9686003)(86362001)(53936002)(7736002)(5660300001)(55016002)(478600001)(33656002)(305945005)(106356001)(5250100002)(105586002)(6636002)(6436002)(2906002)(74316002)(8676002)(229853002)(83323001); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4169; H:DB7PR05MB4426.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: lj+rLjU+iY9+cpZXvLohhLzWKPcFbsU7h84HKJMc1BP7A/W5OD1oT+7KBFRCFnFfyQsJyBHO2KKZKumabVfPAjdE05kc+xsHSbi36zmBvopFpidLB8VCvRf9DyP95EJm6B/31A2KPB9cedeg4vom+vPZr4AE98SUKznXic+dYr9ox10Jspd7jN5ex8NnNdYn8c5NjPEefr4zjnqgstuLgOMMwKEVHq2O0jq2UvY+Cpj/ozar7FiJdoYfiIvY1tx9oH4KTBGlfWxYMjc3G0u1zZfZCOgjAFQaq16bXMYEVf/AtEyx/TWjkV/839YTx/HHNS+T3jCnq21UE0MQb7f2nToQAKkpbvkcXkNIIAPshGQ= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9c0bd05c-a43f-4525-0de2-08d61225b146 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Sep 2018 05:17:21.4850 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4169 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:17:23 -0000 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. >=20 > PMDs that support keeping CRC should advertise > DEV_RX_OFFLOAD_KEEP_CRC > Rx offload capability. >=20 > 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() >=20 > Signed-off-by: Ferruh Yigit > --- [...] > diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c=20 > 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); >=20 > - offloads |=3D DEV_RX_OFFLOAD_CRC_STRIP; > if (config->hw_fcs_strip) > offloads |=3D DEV_RX_OFFLOAD_KEEP_CRC; >=20 > @@ -1438,7 +1437,7 @@ mlx5_rxq_new(struct rte_eth_dev *dev, uint16_t=20 > idx, uint16_t desc, > tmpl->rxq.vlan_strip =3D !!(offloads & DEV_RX_OFFLOAD_VLAN_STRIP); > /* By default, FCS (CRC) is stripped by hardware. */ > tmpl->rxq.crc_present =3D 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) ?=20 > if (config->hw_fcs_strip) { > tmpl->rxq.crc_present =3D 1; > } else { Also I think the CRC offload should have an entry on the port caps printed = by testpmt "show port caps 0" (see port_offload_cap_display()).