From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30057.outbound.protection.outlook.com [40.107.3.57]) by dpdk.org (Postfix) with ESMTP id F36DC7D19 for ; Thu, 4 Jan 2018 12:55:19 +0100 (CET) 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; bh=xoC1pcJTwiOCUPm6/wFwND8D9Lysc8Eea6U/G24sY9s=; b=KZiAmusGEaKnQn0JE8SULgUKJ0y775CUsiqBlqlH2lNf4r6bLzRjWQgGbhvQV9sqRiQFigjBvdI9wBWpwSx9hGix2GusmEpLCL8d3zkE66JeiTufZ9MzoMSlhWuW1W8W70AglWIDxdZuR7NLsJPkTzk8C+/klaa/xy0IWFk0bXU= Received: from VI1PR05MB3149.eurprd05.prod.outlook.com (10.170.237.142) by AM5PR0501MB2036.eurprd05.prod.outlook.com (10.167.214.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.366.8; Thu, 4 Jan 2018 11:55:17 +0000 Received: from VI1PR05MB3149.eurprd05.prod.outlook.com ([fe80::355f:857b:fdfd:afd9]) by VI1PR05MB3149.eurprd05.prod.outlook.com ([fe80::355f:857b:fdfd:afd9%13]) with mapi id 15.20.0366.009; Thu, 4 Jan 2018 11:55:17 +0000 From: Shahaf Shuler To: Adrien Mazarguil CC: =?iso-8859-1?Q?N=E9lio_Laranjeiro?= , "Yongseok Koh" , "dev@dpdk.org" Thread-Topic: [PATCH v2 6/7] net/mlx4: convert to new Tx offloads API Thread-Index: AQHThLhwbOQeMrdcN0Wb9W1vPxHS56NjlyhQ Date: Thu, 4 Jan 2018 11:55:17 +0000 Message-ID: References: <20171123120252.143695-1-shahafs@mellanox.com> <20180103172924.GE4256@6wind.com> In-Reply-To: <20180103172924.GE4256@6wind.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [193.47.165.251] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; AM5PR0501MB2036; 6:jSDaz853XMopQxkoGy4zfazet6PJzVv/JEbo95o/WjXiqf3sCweNWEmgclpk1xAS+JiBT+tEF8PDX7wK4ys9aXA8waZuQQdn31DDd2htTfxfTEJ6qFwMXc8I3BgDRFTNNzGGUTVPFywwwQoDItT6EX4gllmwik+lgtSymqR87EANAw4oL/dS/R8ghv+0qeu+1i6yd4YftKDYt9fhpohcmi0k3tj8QCLNaYcs3tVS8L1BiQUfDKnzRv9ZUND28Zv6RFVhKsfAItFD//CG5edhyUOqTznFJBXbzMBPhrmNWqEnXmVou1xI1ZJ92xMtQUGWBGVvpEhjvESTEKGpu4mPfvqou+s4K8KYCaPTS5FClQS37KpT3g8wi5g8U9PfkyFz; 5:iOpXEh5CJpPfi3JqYqTPHoC+Ua4KU2vfeB/qaiePUCdKYEPNJywkX6saX154fpcyS/m8Sy18dm0bzHrQw2UfHTTYx8trGYUE7OKlZRIqiJg1at70fX6WDbOdV/G+jHJwo8xccvX4NNG/H+xB2UOm0i9JU6cJRRBulaRPhDOERKs=; 24:MeW6tF7cnEG7CiPGtnc2Pp91RjGaTqhZ7FwMa/djCLuaRTc3gwR4teEjLNw9SKkhYE5/B0oFFtSNf7/TMhBfpFJYaCowWyUk5aEHJCnHaH8=; 7:VyiyR3SyDsJgMfYaxjF9bGyj1Tu7vgIncnPUqZtXydOzzzw3XKdg2cPi4B+ACBIvZ+h2OpAKqMscGJQmHdpAX38+zkoWuNKhW/jkRClIA/PxcZaAHrI2sLRsMjzJs/G6mdNv95xcmcQJ22PdRFccvXVW7jpwveOCrIcTaPIAcI+DleS+MMGDU2w5oT8H4yZt4Q04IZKupuQb/jA3rI/k6vJFbb+lzXY7P7a4UNJajeH9N/m2MYgTmrQacgEgz/q2 x-ms-exchange-antispam-srfa-diagnostics: SSOS; x-ms-office365-filtering-correlation-id: c410fd8b-3d7f-4a4f-09ec-08d5536a05c3 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603307)(7153060); SRVR:AM5PR0501MB2036; x-ms-traffictypediagnostic: AM5PR0501MB2036: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040470)(2401047)(5005006)(8121501046)(3002001)(3231023)(944501075)(93006095)(93001095)(10201501046)(6055026)(6041268)(20161123560045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(6072148)(201708071742011); SRVR:AM5PR0501MB2036; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:AM5PR0501MB2036; x-forefront-prvs: 054231DC40 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(346002)(376002)(39380400002)(366004)(189003)(199004)(2950100002)(6916009)(6436002)(81156014)(81166006)(229853002)(2900100001)(316002)(8676002)(76176011)(99286004)(93886005)(53936002)(97736004)(7696005)(59450400001)(102836004)(55016002)(106356001)(9686003)(105586002)(6506007)(8936002)(33656002)(4326008)(5250100002)(5660300001)(3280700002)(3660700001)(7736002)(6116002)(3846002)(305945005)(66066001)(74316002)(68736007)(86362001)(25786009)(2906002)(54906003)(6246003)(478600001)(14454004); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0501MB2036; H:VI1PR05MB3149.eurprd05.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; received-spf: None (protection.outlook.com: mellanox.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=shahafs@mellanox.com; x-microsoft-antispam-message-info: UsxxlYcviNranDChuI3prwcCMBhCkv/Bn05B786n7v+0XQOuYgsn7/H3sd2N/WOBCOXFpOeSevs/0d1k//jI1A== 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: c410fd8b-3d7f-4a4f-09ec-08d5536a05c3 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Jan 2018 11:55:17.0475 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0501MB2036 Subject: Re: [dpdk-dev] [PATCH v2 6/7] net/mlx4: convert to new Tx offloads API 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: Thu, 04 Jan 2018 11:55:20 -0000 Hi Adrien and Nelio, See below comment regarding your output on the offload check. Rest of the comments were accepted. Wednesday, January 3, 2018 7:29 PM, Adrien Mazarguil : [...] >=20 > > +{ > > + uint64_t port_offloads =3D priv->dev->data- > >dev_conf.txmode.offloads; > > + uint64_t port_supp_offloads =3D > mlx4_priv_get_tx_port_offloads(priv); >=20 > Instead of a redundant "port_", how about clarifying it all as follows: >=20 > offloads -> requested > port_offloads -> mandatory > port_supp_offloads -> supported >=20 > > + > > + if ((port_offloads ^ offloads) & port_supp_offloads) > > + return 0; > > + return 1; >=20 > And simplify this as: >=20 > return !((mandatory ^ requested) & supported); >=20 > Maybe I missed something, but there seems to be an inconsistency, e.g. You are correct that the purpose of this function is to check if the offloa= d configuration is correct. However the current code being done on mlx4 does not validate if the queue = offloads configured are supported.=20 It only validates if the port offloads configuration matches the queue offl= oad configuration. The reason it lack the supported offloads check was discussed in internal m= ail (you both CC I believe). Generally it was due to the fact that CRC and = VLAN strip offloads are not supported by the PMD, however set for almost ev= ery example/application in DPDK. For the complete check look on mlx5 patches on this series.=20 > requesting an unsupported offload does not necessarily fail: >=20 > mandatory =3D 0x00 > requested =3D 0x40 > supported =3D 0x10 >=20 > =3D> valid but shouldn't be It should if the offload is per-queue offload. >=20 > And requesting a supported offload when there are no mandatory ones > should not be a problem: >=20 > mandatory =3D 0x00 > requested =3D 0x10 > supported =3D 0x10 >=20 > =3D> invalid but it should be It is invalid indeed. If the application declare some port offload not to b= e set on dev_configure, it cannot enable it from the queue setup. Port offloads can be set only on device configuration, and when set every q= ueue should have them set as well. >=20 > A naive translation of the above requirements results in the following > expression: >=20 > return (requested | supported) =3D=3D supported && > (requested & mandatory) =3D=3D mandatory; >=20 > What's your opinion? >=20