From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70057.outbound.protection.outlook.com [40.107.7.57]) by dpdk.org (Postfix) with ESMTP id 17CC21B50C for ; Wed, 20 Jun 2018 15:45:03 +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=HGQBJU9e+QrJU9Du+R+bzW9pWyKrV9c9VE8qy17eDvc=; b=ts+ANE4TrBHx2cEkgGgAcJygiP3zFtKAK6+7Zs3EG2zJDpvzmglIA18YMVxCJ6wbw6TFsFmZCgiQGAyz/zdQMuijhfwNeDteBIWr1xQGn1V2/qlVkBUQMippzz15AnW4xKYGkVs9BxoF+ZwZZjDtKALX0dlIjwcR6Jxmf0YfpbU= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB5017.eurprd05.prod.outlook.com (20.176.236.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.17; Wed, 20 Jun 2018 13:44:59 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::4c94:2db9:b8c5:cc6b]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::4c94:2db9:b8c5:cc6b%4]) with mapi id 15.20.0863.016; Wed, 20 Jun 2018 13:44:59 +0000 From: Shahaf Shuler To: Ferruh Yigit , Neil Horman , John McNamara , Marko Kovacevic , "John W. Linville" , Allain Legacy , Matt Peters , Ravi Kumar , Ajit Khaparde , Somnath Kotur , Rahul Lakkireddy , Wenzhuo Lu , Qi Zhang , Xiao Wang , Beilei Xing , Konstantin Ananyev , Adrien Mazarguil , =?iso-8859-1?Q?N=E9lio_Laranjeiro?= , Yongseok Koh , Tomasz Duszynski , Dmitri Epshtein , Natalie Samsonov , Jianbo Liu , Alejandro Lucero , Tetsuya Mukawa , Santosh Shukla , Jerin Jacob , Rasesh Mody , Harish Patil , Shahed Shaikh , Bruce Richardson , Andrew Rybchenko , Jasvinder Singh , Cristian Dumitrescu , Matej Vido , Maciej Czekaj , Maxime Coquelin , Tiwei Bie , Zhihong Wang , Yong Wang , Thomas Monjalon CC: "dev@dpdk.org" Thread-Topic: [dpdk-dev] [PATCH] ethdev: add new offload flag to keep CRC Thread-Index: AQHUB+9liuIbeKIVGEq9H90gdJ8/q6RpKXOw Date: Wed, 20 Jun 2018 13:44:59 +0000 Message-ID: References: <20180608225709.19473-1-ferruh.yigit@intel.com> <20180619180230.72585-1-ferruh.yigit@intel.com> In-Reply-To: <20180619180230.72585-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: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB7PR05MB5017; 7:noRG3rZpDA8oqGh6lbnGVQgo2RG/nBqnC3E4BFICj93/geq3DwzVjnjEoGCiDjaQGkgIaD5b9Fgk5Y7AI8DC9LWB3zimclG4i1sq2tgpEVz9ZO0mEiiduJP/igWwVJmeT8ziHmYBS3fMApUbsdRbwoQ3i7LBWzgg9/oPXMKTQx6qhR6Xjl2acotsiRzB4gLZ3FjdPF9kBItlzHSr2Wd2RZOOUfUVfIMKL2YXBhfWgiBW4iM8yEzPMf1WC21NVYgG x-ms-office365-filtering-correlation-id: 68552467-1083-4e40-9e2a-08d5d6b4042f x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB5017; x-ms-traffictypediagnostic: DB7PR05MB5017: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3002001)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:DB7PR05MB5017; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB5017; x-forefront-prvs: 070912876F x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(376002)(39860400002)(396003)(39380400002)(366004)(189003)(199004)(6506007)(8676002)(59450400001)(5250100002)(478600001)(5660300001)(81166006)(33656002)(26005)(105586002)(14454004)(66066001)(102836004)(106356001)(81156014)(97736004)(186003)(7696005)(76176011)(9686003)(229853002)(2906002)(25786009)(8666007)(7736002)(3280700002)(316002)(305945005)(39060400002)(55016002)(2900100001)(68736007)(6246003)(110136005)(3660700001)(4326008)(486006)(6116002)(3846002)(7416002)(7406005)(74316002)(446003)(476003)(8936002)(53936002)(86362001)(99286004)(6436002)(11346002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB5017; H:DB7PR05MB4426.eurprd05.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 8uncvHJQryRnx24a0rvgYJESDZF0MM6Vf60gi+Cq9dchcgReabrb4oULQtRkfy88oEc3U6LwyExmSU2BwJ9ukLdDQxY6rzjpjlGpLbHbSGnZgWbquXOQfQX5zQFfeG4AjYpHGMXmnLaZRsUb0EC25noD1zJmlmhNiUyuzMoIopgqLhdFfGrYjWjJaBw0BikXQfQu8C/eLqX15q78UzQjPZ06XVFXe4UKTpYpK8AWoucE7S7drOsvzpSqxehjy1Mwy5DWHZVoKpvAzqhItDhnNToeKFOuXZLkLKiZ0HAfPJxct9ADCDLQcdL3d9odhUrN spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Mellanox.com X-MS-Exchange-CrossTenant-Network-Message-Id: 68552467-1083-4e40-9e2a-08d5d6b4042f X-MS-Exchange-CrossTenant-originalarrivaltime: 20 Jun 2018 13:44:59.4698 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB5017 Subject: Re: [dpdk-dev] [PATCH] ethdev: add new offload flag to keep CRC 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, 20 Jun 2018 13:45:03 -0000 Hi Ferruh, Tuesday, June 19, 2018 9:03 PM, Ferruh Yigit > Subject: [dpdk-dev] [PATCH] ethdev: add new offload flag to keep CRC >=20 [...] > diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c > index de3f869ed..28cf168aa 100644 > --- a/drivers/net/mlx5/mlx5_rxq.c > +++ b/drivers/net/mlx5/mlx5_rxq.c > @@ -388,6 +388,9 @@ mlx5_get_rx_queue_offloads(struct rte_eth_dev > *dev) >=20 > if (config->hw_fcs_strip) > offloads |=3D DEV_RX_OFFLOAD_CRC_STRIP; > + else > + offloads |=3D DEV_RX_OFFLOAD_KEEP_CRC; > + I think it should be: if (config->hw_fcs_strip) { offloads |=3D DEV_RX_OFFLOAD_CRC_STRIP; offloads |=3D DEV_RX_OFFLOAD_KEEP_CRC; } The hw_fcs_strip is the capability from device which allows the PMD to togg= le the CRC stripping. > if (config->hw_csum) > offloads |=3D (DEV_RX_OFFLOAD_IPV4_CKSUM | > DEV_RX_OFFLOAD_UDP_CKSUM | > @@ -1419,17 +1422,17 @@ mlx5_rxq_new(struct rte_eth_dev *dev, > uint16_t idx, uint16_t desc, > /* Configure VLAN stripping. */ > tmpl->rxq.vlan_strip =3D !!(offloads & > DEV_RX_OFFLOAD_VLAN_STRIP); > /* By default, FCS (CRC) is stripped by hardware. */ > - if (offloads & DEV_RX_OFFLOAD_CRC_STRIP) { > - tmpl->rxq.crc_present =3D 0; > - } else if (config->hw_fcs_strip) { > - tmpl->rxq.crc_present =3D 1; > - } else { > - DRV_LOG(WARNING, > - "port %u CRC stripping has been disabled but will" > - " still be performed by hardware, make sure > MLNX_OFED" > - " and firmware are up to date", > - dev->data->port_id); > - tmpl->rxq.crc_present =3D 0; > + tmpl->rxq.crc_present =3D 0; > + if (rte_eth_dev_is_keep_crc(offloads)) { > + if (config->hw_fcs_strip) { > + tmpl->rxq.crc_present =3D 1; > + } else { > + DRV_LOG(WARNING, > + "port %u CRC stripping has been disabled but > will" > + " still be performed by hardware, make sure > MLNX_OFED" > + " and firmware are up to date", > + dev->data->port_id); > + } > } > DRV_LOG(DEBUG, > "port %u CRC stripping is %s, %u bytes will be subtracted > from"