From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR02-HE1-obe.outbound.protection.outlook.com (mail-eopbgr10045.outbound.protection.outlook.com [40.107.1.45]) by dpdk.org (Postfix) with ESMTP id 716CE2D13 for ; Thu, 28 Jun 2018 07:35:21 +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=Er0tzVR3f9ZlLir5JRrjwXZxHYrH9JUSXw3OX7rSMek=; b=QQZBuNwlp0h1NSyF+6F0eoZrYLRw9X5+aazTPg22DDhEp6T90xe8ObVcQi1ZO39WCStzm5/qS40Y4/mOMKRF1oRETsGWWyBtkpEpKqpp9PMVrobkc9+9p+0jN1U2AKBaZ2vE2gL+tOee0FaVMI+kXaje+FGaVyppUYEPyujL5gI= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB4281.eurprd05.prod.outlook.com (52.134.108.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.24; Thu, 28 Jun 2018 05:35:20 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::4c94:2db9:b8c5:cc6b]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::4c94:2db9:b8c5:cc6b%5]) with mapi id 15.20.0884.025; Thu, 28 Jun 2018 05:35:20 +0000 From: Shahaf Shuler To: Adrien Mazarguil CC: "dev@dpdk.org" Thread-Topic: [PATCH v2 2/7] net/mlx5: remove redundant objects in probe code Thread-Index: AQHUA7qbccOyVQKXvEmKPqz0ep2kl6RkJhJwgBAImoCAAQ1eYA== Date: Thu, 28 Jun 2018 05:35:19 +0000 Message-ID: References: <20180525161814.13873-1-adrien.mazarguil@6wind.com> <20180614083047.10812-1-adrien.mazarguil@6wind.com> <20180614083047.10812-3-adrien.mazarguil@6wind.com> <20180627133051.GR4025@6wind.com> In-Reply-To: <20180627133051.GR4025@6wind.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; DB7PR05MB4281; 7:komv7pGWDTBJRSfuN+dgx5AbaESE7q6MxYGfHMH8IpgAmc5Z+Ln/KU8YJQJ5mCyRej2LtzsHETDrpJflMf3lk9Rgvwy/x8SpNIJBrxOBqu9IWF6Mx5MLBVB4Mu/P/zpvtveBiNG+3nTj2et+UVcf/SHInH/UqJrnaUvuw9XIJRwVOElOAXZ+yOJzEczjeYihdP97b9Xuwstg9fkPSW5QAQTyJiDfqqiSqqQIcpgFi0RlCs8uRfr4V8B15+ajgvq+ x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 7dcc9559-f483-49f9-bfa9-08d5dcb8eff7 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(48565401081)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4281; x-ms-traffictypediagnostic: DB7PR05MB4281: 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)(10201501046)(93006095)(93001095)(3231254)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016); SRVR:DB7PR05MB4281; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4281; x-forefront-prvs: 0717E25089 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(346002)(39860400002)(136003)(396003)(376002)(199004)(189003)(14454004)(229853002)(93886005)(316002)(6246003)(2900100001)(4326008)(5660300001)(5250100002)(6436002)(102836004)(256004)(14444005)(97736004)(2906002)(9686003)(6506007)(26005)(478600001)(55016002)(186003)(25786009)(53936002)(81156014)(81166006)(8936002)(476003)(76176011)(7696005)(486006)(86362001)(68736007)(8676002)(305945005)(99286004)(66066001)(11346002)(106356001)(6116002)(74316002)(33656002)(7736002)(3846002)(446003)(6916009)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4281; 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: OUC7hIJwJFpIshkDWXZTrsA7t2uX8uL7YwlElNMtFhjJ+j+lot9l06pE3bH17bJSgJlr5Fih24tOKbMBL8jOBKGwtkKvQPT5bEAJf8g/BbWMMEJGn7DsSSaLHqM2LNJRyiWbNCAIB3AITPqpPRSj+lL1AfdIPiIQJGqohPkr6/uW1XyH+q/o3WVrG/uQ9xwV+pJF0aTSqqPZyGGYF6y8sBtEv8YsKeM4XmGRukLLBnAWBDkcabYvYbz0TNme2TXJBVygUnHyVRw/3LiphYTTVP0JY4pJnGHMZuWbdFah13o9n6cMV51FwAXZvIw6GbW+G4bnOI3jZunqgVenVwujAiF3obYOvu/xv0s/PFBa2gg= 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: 7dcc9559-f483-49f9-bfa9-08d5dcb8eff7 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Jun 2018 05:35:19.9806 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4281 Subject: Re: [dpdk-dev] [PATCH v2 2/7] net/mlx5: remove redundant objects in probe code 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, 28 Jun 2018 05:35:21 -0000 Wednesday, June 27, 2018 4:31 PM, Adrien Mazarguil: > Subject: Re: [PATCH v2 2/7] net/mlx5: remove redundant objects in probe > code >=20 > Hey Shahaf, >=20 > I couldn't reply earlier, sorry for that. See below. >=20 > On Sun, Jun 17, 2018 at 10:14:01AM +0000, Shahaf Shuler wrote: > > Hi Adrien, > > > > Small nit, > > > > Thursday, June 14, 2018 11:35 AM, Adrien Mazarguil: > > > Subject: [PATCH v2 2/7] net/mlx5: remove redundant objects in probe > > > code > > > > > > This patch gets rid of redundant calls to open the device and query > > > its attributes in order to simplify the code. > > > > > > Signed-off-by: Adrien Mazarguil > > > -- > > > v2 changes: > > > > > > - Minor indent fix on existing code. > > > --- > > > drivers/net/mlx5/mlx5.c | 64 > > > +++++++++++++++++++++----------------------- > > > 1 file changed, 30 insertions(+), 34 deletions(-) > > > > > > diff --git a/drivers/net/mlx5/mlx5.c b/drivers/net/mlx5/mlx5.c index > > > > @@ -907,7 +904,8 @@ mlx5_pci_probe(struct rte_pci_driver *pci_drv > > > __rte_unused, > > > continue; > > > } > > > DRV_LOG(DEBUG, "using port %u", port); > > > - ctx =3D mlx5_glue->open_device(ibv_dev); > > > + if (!ctx) > > > > Is it really possible for ctx to be NULL on this stage? > > Maybe assert is preferable? >=20 > See below, ctx is only inherited (non-NULL) during the first iteration. I= t is > reset and reopened for each instance since they need their own dedicated > Verbs context. >=20 > In any case, this patch focuses on removing redundant calls in preparatio= n for > subsequent patches in the series. This code disappears entirely later. >=20 > > > > + /* > > > + * Each eth_dev instance is assigned its own Verbs context, > > > + * since this one is consumed, let the next iteration open > > > + * another. > > > + */ > > > + ctx =3D NULL; > > > continue; >=20 > No problem if I leave it that way? Sure.=20 >=20 > -- > Adrien Mazarguil > 6WIND