From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from EUR01-HE1-obe.outbound.protection.outlook.com (mail-he1eur01on0086.outbound.protection.outlook.com [104.47.0.86]) by dpdk.org (Postfix) with ESMTP id 2B08D23D for ; Mon, 15 Oct 2018 07:53:02 +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=IwB9mCEbyy/CluijIXpcJlqqNUwplPoTt46TzGxCqi8=; b=YFBDjiM71xUm3Wa84ockJo5AOygrQlBkzhKUqyZApt3G/pUGgCgiia74Bv/BydZpW5oi3GnyqhJo/z7puYUyINNNg7RQgzO3D29h0Gs/zM9tVzqo72+IorFSdUOSR3InNi4KKBsD+JuwnSU1ece0i+ujNOdEqr1AdLyB0b25WsY= Received: from DB7PR05MB4426.eurprd05.prod.outlook.com (52.134.109.15) by DB7PR05MB4506.eurprd05.prod.outlook.com (52.134.109.140) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.23; Mon, 15 Oct 2018 05:53:00 +0000 Received: from DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::80e:e6b:baf2:d973]) by DB7PR05MB4426.eurprd05.prod.outlook.com ([fe80::80e:e6b:baf2:d973%3]) with mapi id 15.20.1228.020; Mon, 15 Oct 2018 05:53:00 +0000 From: Shahaf Shuler To: Thomas Monjalon , "dev@dpdk.org" CC: "gaetan.rivet@6wind.com" , Ophir Munk , "qi.z.zhang@intel.com" , "ferruh.yigit@intel.com" , Yongseok Koh Thread-Topic: [dpdk-dev] [PATCH v5 1/7] net/mlx5: remove useless driver name comparison Thread-Index: AQHUY/9okZYoKmp3EEiNNGAcHKd7P6UfzlaA Date: Mon, 15 Oct 2018 05:53:00 +0000 Message-ID: References: <20180907230958.21402-1-thomas@monjalon.net> <20181014204747.26621-1-thomas@monjalon.net> <20181014204747.26621-2-thomas@monjalon.net> <2480461.bHeCtipZbE@xps> In-Reply-To: <2480461.bHeCtipZbE@xps> 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; DB7PR05MB4506; 6:IBpQev38THJ720+GHu/t5z4GrkW6FCtsUEh2nS7Y28crfrvOaHiQY8ji01yIN48HNYz6/75l4qimtQG1CEwsAxspyuWxNAbHaAY503IyHj4IuVwXtbs7exxZcxq7wgS0qOE4FrtfmdkpKE9n4OTvEAsuassFXCK7q2z1oOf2w8nhjqlbu1+ct7ClaHx7ssyEdKyCjGOA7ckbWNjlx56qu/pjEWBzI8L3sqeXyMrhaI1rn6SOaxBVSJZDAGJiG9nwXITamyW87nNQthwPjah2Q1BuYYukz4OZLum7Ui/Irw1UNXb3olZ8bWLaArqY5Cj+tVCtfZ02LU3CHoT0Ed4wEWbqEQrA9iyeJAhvbvs2fGUi09bCXi5FQans3f10znbcLqGbH93bUz6hXgO0SgcLEIdGY9PH3p5zKHzObs2ZaCZraKoOR3HL8nfF4itgAyFIZy0z206Ay3Shxn2mxAeH4g==; 5:X26r06daV4rOqOize9tT83K0uOqOcVNz8U07PaGQ/UYMmTZf84QoQGGWZT1Pfhpsa67N7Wq376UZSjWC2R/Gob0cWcmhWWTa8KSin+ozgY2hu1PVE1XDqmRQuxy4G/9P+KVShD6seq3KvHgYGn1WKb3G9Gu2McI1RgFMKgQ2pfs=; 7:Nh88x+7XqyAwjetjokmvg5btEPYGBuq37G3RLf1B2EAdEQsBN/x2que142/6QOsxVEQsb+IqRXY0DkEkGG6O76Euupq0VzRCYxS4LyycFRsr79LRgJuB/Us+Sm689gw3WgaKw8Mg+Bp+W8mLoTLC04KrH1CejgqpJDenEUFPJDP2l3+Lno8T3ol1TMmo2JzX0eB0n/9NHwHtX3ZiIz2UE2M0ydq+Oz3vGPnHZZwnfRCVLKTviq/UqMNv7cmrv9WW x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: eca14004-f317-486b-b489-08d63262773a x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB7PR05MB4506; x-ms-traffictypediagnostic: DB7PR05MB4506: 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)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(201708071742011)(7699051); SRVR:DB7PR05MB4506; BCL:0; PCL:0; RULEID:; SRVR:DB7PR05MB4506; x-forefront-prvs: 0826B2F01B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(136003)(376002)(346002)(39860400002)(189003)(199004)(107886003)(14454004)(93886005)(256004)(25786009)(7736002)(8936002)(99286004)(11346002)(86362001)(6436002)(316002)(81156014)(2900100001)(476003)(7696005)(486006)(4326008)(229853002)(446003)(33656002)(106356001)(74316002)(6246003)(305945005)(5660300001)(2501003)(66066001)(5250100002)(26005)(186003)(105586002)(8676002)(76176011)(54906003)(68736007)(3846002)(6116002)(53936002)(71190400001)(478600001)(71200400001)(81166006)(55016002)(9686003)(6506007)(2906002)(110136005)(97736004)(102836004); DIR:OUT; SFP:1101; SCL:1; SRVR:DB7PR05MB4506; 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: Egbg5lPEDS3JJskj32duDRiMH0CQm0Irca0AyaSDrOZwVJb+7C3opIF721kUk9x5ChWCgbCpcTTsmjYy2Sdm7V5BheXYLQmfKaeFzAofonl3gs0SE7LgBRutMb3Hjh97+EoqgjiWvhdjZMHztYQwBHTSWFKjfcc/5Oj/QodVgoGKUXXb23JHFo3iiBFKcwnjsztypEuosfZus6x4IVZLmLH5lAIQQwMvlbNHWxyusSTZ+MorrzcW+NhtVzRQO8owiMwCkwveD8kLFvof/oSnTDnI+QZIig0toTO4dnhYIsSHq0LwwEcPo8p72Cc39c9ZW1YDWSq9p54g2rU2qPAZ+MdtmFCxyOsgJjV8+aGw2ug= 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: eca14004-f317-486b-b489-08d63262773a X-MS-Exchange-CrossTenant-originalarrivaltime: 15 Oct 2018 05:53:00.6617 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB7PR05MB4506 Subject: Re: [dpdk-dev] [PATCH v5 1/7] net/mlx5: remove useless driver name comparison 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: Mon, 15 Oct 2018 05:53:02 -0000 Sunday, October 14, 2018 11:49 PM, Thomas Monjalon: > 14/10/2018 22:47, Thomas Monjalon: > > The function mlx5_dev_to_port_id() is returning all the ports > > associated to a rte_device. > > It was comparing driver names while already comparing rte_device > pointers. > > If two devices are the same, they will have the same driver. > > So the useless driver name comparison is removed. > > > > Signed-off-by: Thomas Monjalon > > --- > > drivers/net/mlx5/mlx5_ethdev.c | 5 +---- > > 1 file changed, 1 insertion(+), 4 deletions(-) > > > > diff --git a/drivers/net/mlx5/mlx5_ethdev.c > > b/drivers/net/mlx5/mlx5_ethdev.c index 61eda537b..cacdf8e18 100644 > > --- a/drivers/net/mlx5/mlx5_ethdev.c > > +++ b/drivers/net/mlx5/mlx5_ethdev.c > > @@ -1305,10 +1305,7 @@ mlx5_dev_to_port_id(const struct rte_device > *dev, uint16_t *port_list, > > RTE_ETH_FOREACH_DEV(id) { > > struct rte_eth_dev *ldev =3D &rte_eth_devices[id]; > > > > - if (!ldev->device || > > - !ldev->device->driver || > > - strcmp(ldev->device->driver->name, > MLX5_DRIVER_NAME) || > > - ldev->device !=3D dev) > > + if (ldev->device !=3D dev) > > continue; > > if (n < port_list_n) > > port_list[n] =3D id; > > Acked-By: Shahaf Shuler