From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A4093431AD; Thu, 19 Oct 2023 17:41:57 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 089A640A67; Thu, 19 Oct 2023 17:41:51 +0200 (CEST) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mails.dpdk.org (Postfix) with ESMTP id 320A040A67 for ; Thu, 19 Oct 2023 17:41:49 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 95B245C032E; Thu, 19 Oct 2023 11:41:48 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 19 Oct 2023 11:41:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm3; t=1697730108; x= 1697816508; bh=whMtndLEERiKGnxloPoI/DR7jK4mGSQ6ZhiDyV56Zrw=; b=X TWWVoZS+dJwzV0aBX06p0VqCZO3zW9M4jcR4fo7GnOE0NWQaLXhfkf25qE3acLX9 u2T4LPwxrhl8JI7BpDS5JjAN3Hi2dkeiB9QKFv6W9a3VQ84Cx7BL9u/qJdoIWjKi PegGSnyrV3LOsFs6V/BERyQZpNtEngfn++G0SiBYqTxnJ1bDqHTOL8SHm+rNNkq7 dIqTodttcqrmCzu/wPYA4wxTKfkngp8tnqND+2bN0/JvZsPzEUJbrbdzyNwLt5uf EUm/uszD+EndYns4HSfdquA7iAKGJH3UFlIzYC10AN/G0fhu5McuIx0ZONW/Ho9q Nipv13aej7VEhuZOy2JjA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1697730108; x= 1697816508; bh=whMtndLEERiKGnxloPoI/DR7jK4mGSQ6ZhiDyV56Zrw=; b=F 2Psl/p2t6QQT3Z/HuR1MWdvbvOl2Zhxhan/z58pb3OUYvVxnQepXYGlmNWGLOs9J FW5s5VDvjM6MLGyNeWoqLfUJNO3S9elAGBuhRZ+Lu+y7dGb1TNQzol8yToC2ysUC 3ChLVBlvLU9MC5GUtzNrVBeBXKomciV/gWQ3swENGb1gOmhF1YBxhsNCFHVixrRr S3uBn6M/SnyZWR+/cYGzwL00s+EW01NPLtKtZrwWoJ0w9+/vgv2WgdbyQrcHaHqU 5eXIuFDVibIvMuiO2DLYbIQhKl4m00pfHBc3dl9FZ1Cfx6pAEIkzVca/SlWfNDi4 qIcp4bGirC360l+iw/+3A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrjeeigdeltdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdejhfdugeehvddtieejieegteeuudfgjeeukeeiledthfetveek hefhieelhfdtnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homhepthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 19 Oct 2023 11:41:47 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: David Marchand , chenbox@nvidia.com, Long Li , Matan Azrad , Viacheslav Ovsiienko , Ori Kam , Suanming Mou Subject: [PATCH 2/2] drivers: use function to compare PCI addresses Date: Thu, 19 Oct 2023 17:31:53 +0200 Message-ID: <20231019154125.308002-3-thomas@monjalon.net> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20231019154125.308002-1-thomas@monjalon.net> References: <20231019154125.308002-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Some places were not using the function rte_pci_addr_cmp() to compare 2 PCI addresses. Signed-off-by: Thomas Monjalon --- drivers/net/mana/mana.c | 6 ++---- drivers/net/mlx4/mlx4.c | 5 +---- drivers/net/mlx5/linux/mlx5_os.c | 5 +---- 3 files changed, 4 insertions(+), 12 deletions(-) diff --git a/drivers/net/mana/mana.c b/drivers/net/mana/mana.c index 41c3cf2595..781ed76139 100644 --- a/drivers/net/mana/mana.c +++ b/drivers/net/mana/mana.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -1464,10 +1465,7 @@ mana_pci_probe_mac(struct rte_pci_device *pci_dev, continue; /* Ignore if this IB device is not this PCI device */ - if (pci_dev->addr.domain != pci_addr.domain || - pci_dev->addr.bus != pci_addr.bus || - pci_dev->addr.devid != pci_addr.devid || - pci_dev->addr.function != pci_addr.function) + if (rte_pci_addr_cmp(&pci_dev->addr, &pci_addr) != 0) continue; ctx = ibv_open_device(ibdev); diff --git a/drivers/net/mlx4/mlx4.c b/drivers/net/mlx4/mlx4.c index 1389b606cc..a1a7e93288 100644 --- a/drivers/net/mlx4/mlx4.c +++ b/drivers/net/mlx4/mlx4.c @@ -817,10 +817,7 @@ mlx4_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev) DEBUG("checking device \"%s\"", list[i]->name); if (mlx4_ibv_device_to_pci_addr(list[i], &pci_addr)) continue; - if ((pci_dev->addr.domain != pci_addr.domain) || - (pci_dev->addr.bus != pci_addr.bus) || - (pci_dev->addr.devid != pci_addr.devid) || - (pci_dev->addr.function != pci_addr.function)) + if (rte_pci_addr_cmp(&pci_dev->addr, &pci_addr) != 0) continue; vf = (pci_dev->id.device_id == PCI_DEVICE_ID_MELLANOX_CONNECTX3VF); diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/mlx5_os.c index 0706e9e9b2..922490ff97 100644 --- a/drivers/net/mlx5/linux/mlx5_os.c +++ b/drivers/net/mlx5/linux/mlx5_os.c @@ -2065,10 +2065,7 @@ mlx5_os_pci_probe_pf(struct mlx5_common_device *cdev, if (mlx5_get_pci_addr(ibv_list[ret]->ibdev_path, &pci_addr)) continue; - if (owner_pci.domain != pci_addr.domain || - owner_pci.bus != pci_addr.bus || - owner_pci.devid != pci_addr.devid || - owner_pci.function != pci_addr.function) + if (rte_pci_addr_cmp(&owner_pci, &pci_addr) != 0) continue; DRV_LOG(INFO, "PCI information matches for device \"%s\"", ibv_list[ret]->name); -- 2.42.0