From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 5ECE21DB8 for ; Sun, 14 Oct 2018 22:49:29 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 06BAF212A0; Sun, 14 Oct 2018 16:49:29 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Sun, 14 Oct 2018 16:49:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=yZXeYDyXMNdzxPnwRFOWT8Wa7/lxSgHW9yv306hmtKs=; b=BJL3NaBJJPbV kEkM3Ipa1kxeZYhBlA49N1GLzIJNwGKsmGKIZSri+IWjLIAFKO0SeqvLYx194f/s /Ah3ni97PBRlNQeIVJcIwNoD3MAieTBkRgtUsj8iWmZdeqG1NgaReRl+xoyK/rf9 C7qWjNwHd8U3KEznGDeKVOBGl5sCHRw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=yZXeYDyXMNdzxPnwRFOWT8Wa7/lxSgHW9yv306hmt Ks=; b=A+J6WsvHo28KNxEHWuBmwHEphfs2zC2qUyxpY+yGnX0OCjz/NGphen8p5 N/YELFrv+YKl4sx7PTyAGIZ5eecH8u0bdNXqVdK+Lflf9nhLGQcmcPF56FNuZIws /5eRvmg/RJYqmGigD3XLj2X3Afx5M1hH6CVKzEb20/DNyJ8Kr+PG7PYfzfX5/11j I4I6mgBtgH3LFd7Zz2Hzg64lxgTwQo2OwIuogcdsAtAZE/8ssOj9vTjXU6AuRRIV LkLB66a57t5fTNIUK+/MRSa+66cE2ocbdoroh/moyF9w1j7jZB7UmLIBnyXHwnB2 3lUV+tzcXzG0V2CawsOvk1dNIOCVA== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id DFAD0102EB; Sun, 14 Oct 2018 16:49:27 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: gaetan.rivet@6wind.com, ophirmu@mellanox.com, qi.z.zhang@intel.com, ferruh.yigit@intel.com, Yongseok Koh , shahafs@mellanox.com Date: Sun, 14 Oct 2018 22:49:27 +0200 Message-ID: <2480461.bHeCtipZbE@xps> In-Reply-To: <20181014204747.26621-2-thomas@monjalon.net> References: <20180907230958.21402-1-thomas@monjalon.net> <20181014204747.26621-1-thomas@monjalon.net> <20181014204747.26621-2-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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: Sun, 14 Oct 2018 20:49:29 -0000 +Cc Yongseok and Shahaf 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 = &rte_eth_devices[id]; > > - if (!ldev->device || > - !ldev->device->driver || > - strcmp(ldev->device->driver->name, MLX5_DRIVER_NAME) || > - ldev->device != dev) > + if (ldev->device != dev) > continue; > if (n < port_list_n) > port_list[n] = id; >