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 604B2431AE; Thu, 19 Oct 2023 18:04:43 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 36CAB4021F; Thu, 19 Oct 2023 18:04:43 +0200 (CEST) Received: from BN3PR00CU001.outbound.protection.outlook.com (mail-eastus2azon11020002.outbound.protection.outlook.com [52.101.56.2]) by mails.dpdk.org (Postfix) with ESMTP id 8574340150 for ; Thu, 19 Oct 2023 18:04:41 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=T9E83rLZ0fqfjKMkgnWijrGApivCf/udrpKkowe8onTY4k2lTrj3GMiZKQjaIO2NJCPCvWf8uUZq1zqjKYlzOrSuretA3rtPHBiMrqrJd39ylbY1ba09Qk7Vr1lY7QYq/n476wAzBU8Fhtz1BTRGk+Z7N0k21YmhH1BXeaAsrecYPnShZgg6wi35/sAHilZzuC9yXmrjMAN097rMJ8Fj6Kma+nSUZYugzjyUB54QTVcKaFr5OuKWWUTGYLb0O6v1pCfObGML92lAwCvdGhasxS3UUvr2CX/mbNStOQ1mixYwOXzCCLBTZBk6qtOnatX2w4g1/Xkdaek6LH/0EIZvGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=d4aUpB5IL4mChsskDjdKhsTZWMvLbcT4xUP5kPTj/dA=; b=U6Br4xo2BeGYtpqzitNN9wiHOJTtlDqFvCehaNs+r0+xz3X6Hv3vNRcGZZ3iDWvAQc3N6evxmZlFVj2+zXST/z2jrskPUZ7UWs02zKT9rd2pvDMfDRfQbAgymXnx90DCvoD9Qnux5ykdc+Q2a2xvmurHYWsyQm/9tOsiRHGNDdq+fN4i0kb3qBLTOyKMaOdXm4rJUkv7cYM/S1tfd/biVqKR0wum0a40p9ldybUrttAQPiBgRt981DLK4g0n6z99/FFzAaDAAiiKDWzLlmV2NuTWuedet5e3hJjSewppnrc5cuEJz1D0XUkLzJ6GOx+ryvPnLA6ZFf+++uX4VZHAXA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microsoft.com; dmarc=pass action=none header.from=microsoft.com; dkim=pass header.d=microsoft.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=d4aUpB5IL4mChsskDjdKhsTZWMvLbcT4xUP5kPTj/dA=; b=Dm53Oxgb/Ra6zKs0DAeKzewkuPCq2ydHHepDpF+F9i++45GnxYDmOj5yzheFtFbYim61xCCrYadyDjv3tyhswq2MRcCc3ogG4noPPU/h1FJAmBhvxIy79gyg5IFh9cZxEjg5zIXR5PZsNHu6ujJB/Y6KuO7QyR4Vj9BzyIbB+Lk= Received: from PH7PR21MB3263.namprd21.prod.outlook.com (2603:10b6:510:1db::16) by IA1PR21MB3547.namprd21.prod.outlook.com (2603:10b6:208:3e0::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6933.4; Thu, 19 Oct 2023 16:04:38 +0000 Received: from PH7PR21MB3263.namprd21.prod.outlook.com ([fe80::f10e:9c41:f9ce:9b7f]) by PH7PR21MB3263.namprd21.prod.outlook.com ([fe80::f10e:9c41:f9ce:9b7f%4]) with mapi id 15.20.6933.006; Thu, 19 Oct 2023 16:04:38 +0000 From: Long Li To: Thomas Monjalon , "dev@dpdk.org" CC: David Marchand , "chenbox@nvidia.com" , Matan Azrad , Slava Ovsiienko , Ori Kam , Suanming Mou Subject: RE: [PATCH 2/2] drivers: use function to compare PCI addresses Thread-Topic: [PATCH 2/2] drivers: use function to compare PCI addresses Thread-Index: AQHaAqLIzfR1QXsYnEiRvdOe+NsCGLBRRlTA Date: Thu, 19 Oct 2023 16:04:38 +0000 Message-ID: References: <20231019154125.308002-1-thomas@monjalon.net> <20231019154125.308002-3-thomas@monjalon.net> In-Reply-To: <20231019154125.308002-3-thomas@monjalon.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ActionId=357e8624-abf5-4660-acbb-d797331bcb40; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_ContentBits=0; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Enabled=true; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Method=Standard; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_Name=Internal; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SetDate=2023-10-19T16:03:29Z; MSIP_Label_f42aa342-8706-4288-bd11-ebb85995028c_SiteId=72f988bf-86f1-41af-91ab-2d7cd011db47; authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=microsoft.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PH7PR21MB3263:EE_|IA1PR21MB3547:EE_ x-ms-office365-filtering-correlation-id: 727a13cd-f147-4bcf-a5a7-08dbd0bd18d2 x-ld-processed: 72f988bf-86f1-41af-91ab-2d7cd011db47,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: ye4XgIAqUPaq79EOYVX1dktqEkHv0GjXvdjEZCLM3Ht4tvqfcEeCa1OkflfqrcCIki1H1y4m2tYKmuZTInBI7OTD4qTkP7qsDMOUHXYJXE59g86+RtayeDAs6SLKaamdIPE8YgEBQAwcev5h8X7FF431jzU39e2GXByqqEYEnv0q6MNcz/6v8pwW72y4BN6iewOL9sEMhZ1OhGEk2svXWvT4b4gNzgldhRHxelQZEEQEDC2CXCBbIP843VSoU/bNWwffWaekOjv4I+kygM1NzhbjDuU/2J2Of1j+FNcf63X7pRHnpzh5KiwjjYVtui/BCb21YP4/H2AOKN9a9Hr5zioinr7wf7iNys2TVO2jsP4RmdC+V94LQ1SOi2dtW42l39xdZJj6I03X0orVn34hWPCK/wN9i3zfX83nH5tcdEjyGb4wE1ldD0cx4kclqGEGJFrcF+NPI3Zs8IRDbP2OwmiQ8jePkpfmC065U4wK032s22ZHZ7sv44Xdw+CgUrZhSaCiC4Iq5AHf1F0EHUQYCt9m+8IdvxQX7K8bvgQtcK+Z6n+4IKb8BIzxy2pYSZs/3YEpg94twdn91wFZ5uRYLsdJcjPS/w6heRK4ZMgvuL+JC0CCQUt5eaFuE9sRm+T2fVIvvIu0iCLlbzesMOswBM5eHmmQF0QN8Et2+BWbHvE= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PH7PR21MB3263.namprd21.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230031)(136003)(346002)(376002)(396003)(39860400002)(366004)(230922051799003)(1800799009)(186009)(64100799003)(451199024)(9686003)(26005)(7696005)(83380400001)(6506007)(38070700008)(55016003)(71200400001)(1700900044)(478600001)(10290500003)(5660300002)(4326008)(86362001)(38100700002)(52536014)(8990500004)(316002)(41300700001)(2906002)(8676002)(8936002)(33656002)(122000001)(82960400001)(82950400001)(110136005)(66556008)(64756008)(66446008)(66946007)(76116006)(66476007)(54906003); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?nhIA0yc7kO3JF0UD23h4m/d8/L7ZIReWYqZ2VKwvRza/uGiC5igNZraxWrVc?= =?us-ascii?Q?13TAtF0+Kam7G2JpebKHoefIHtNmvahOFJjxlzAnIZ15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GPW0/J41QmaHZuTZGnbmnxHSbD5gT8y6pp5QFl+A?= =?us-ascii?Q?9Zg58kAAuAUppCyy7dMFXXLzc4K/QsZkTiyMkO4KNENJC3szb/yciaYKBzIC?= =?us-ascii?Q?z+UHsobNo6TUs/J5rI18q7Ph3rCqwXd7yTwpL6402jBf6xDCluppc43gtELn?= =?us-ascii?Q?Bug6qc1RaksuJdZGCkvQ/DgNhYsGFeaXbtWKmOjtrIPOmn7iaHcxtq5LC9bC?= =?us-ascii?Q?XZN4Zg4ycN85hLdPg13P91K0W7YU4zdGW6VmHqT1jHfnrsW+27GFgPNC5yf/?= =?us-ascii?Q?5l8aP2ejXS3gv1cmW7+sZlzfDF1tc1hhSN9d9qghRxjlAb3DeNWM+Cw0aTku?= =?us-ascii?Q?+AoBCWrLrFQDA9b/ycWRJpRs8lNuykl8nwc1mybLOBOvsIrd8vyRZVIojRgH?= =?us-ascii?Q?QQKJQl6pA/zwr1pDbtmkv7IZvhmJ5fslrt6PWsnV6EuvM06whpUPMVtwsFax?= =?us-ascii?Q?HPOCYZUThRlu7IbZCPYW31moxA+DTUlJR07eZCVmT3Xpt6g34TvLQX//ziXC?= =?us-ascii?Q?lz1gkUKxXKgs5sIHzazpJx3lJyITssflh6rtmwiU4UC/Ob+igf8oXa6JUSf1?= =?us-ascii?Q?aI3N9AzHllhZkd2DFSpd3cNlOadTd59MrFEgQpjJ?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PH7PR21MB3263.namprd21.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 727a13cd-f147-4bcf-a5a7-08dbd0bd18d2 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Oct 2023 16:04:38.6611 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: RLrtUCsBNnOlja07QwO0k3+XEvJGvWlVvcJuq5ARAQvmnAWbgtSoBEMWfWifnaglIuuukGGeK1FRs2j0BBDYXA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR21MB3547 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 > Subject: [PATCH 2/2] drivers: use function to compare PCI addresses >=20 > Some places were not using the function rte_pci_addr_cmp() to compare 2 P= CI > addresses. >=20 > Signed-off-by: Thomas Monjalon For MANA, Acked-by: Long Li > --- > 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(-) >=20 > 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 >=20 > #include > #include > @@ -1464,10 +1465,7 @@ mana_pci_probe_mac(struct rte_pci_device > *pci_dev, > continue; >=20 > /* Ignore if this IB device is not this PCI device */ > - if (pci_dev->addr.domain !=3D pci_addr.domain || > - pci_dev->addr.bus !=3D pci_addr.bus || > - pci_dev->addr.devid !=3D pci_addr.devid || > - pci_dev->addr.function !=3D pci_addr.function) > + if (rte_pci_addr_cmp(&pci_dev->addr, &pci_addr) !=3D 0) > continue; >=20 > ctx =3D 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, struc= t > 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 !=3D pci_addr.domain) || > - (pci_dev->addr.bus !=3D pci_addr.bus) || > - (pci_dev->addr.devid !=3D pci_addr.devid) || > - (pci_dev->addr.function !=3D pci_addr.function)) > + if (rte_pci_addr_cmp(&pci_dev->addr, &pci_addr) !=3D 0) > continue; > vf =3D (pci_dev->id.device_id =3D=3D > PCI_DEVICE_ID_MELLANOX_CONNECTX3VF); > diff --git a/drivers/net/mlx5/linux/mlx5_os.c b/drivers/net/mlx5/linux/ml= x5_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 !=3D pci_addr.domain || > - owner_pci.bus !=3D pci_addr.bus || > - owner_pci.devid !=3D pci_addr.devid || > - owner_pci.function !=3D pci_addr.function) > + if (rte_pci_addr_cmp(&owner_pci, &pci_addr) !=3D 0) > continue; > DRV_LOG(INFO, "PCI information matches for device > \"%s\"", > ibv_list[ret]->name); > -- > 2.42.0