From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 4010DA034F; Tue, 28 Apr 2020 10:11:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 7673D1D554; Tue, 28 Apr 2020 10:11:52 +0200 (CEST) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2044.outbound.protection.outlook.com [40.107.21.44]) by dpdk.org (Postfix) with ESMTP id 475832B86 for ; Tue, 28 Apr 2020 10:11:51 +0200 (CEST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mUjJYqXKmu1BNxOM+sDSbz8xDtqmHayYhoQDUoau6Cw1zYA+IHSnZrDlQe8+ZZ6p6jftjZ/ScYFdDRIqs5nLIPDCZaNabkVNVo4kvFf03tUJpkqJdUT/1BGV3BJAAa4HrSGVSnbutQdDWL0F1xXRLDlIDyh0bcn3JPmCSszFdLdcg5bSUDVTMe9EAf6Iz7dyZky70/k1sPqXja6wGc6+YC3ovrd+vjor8k6Ey2zVK3GV9QpKdJN+9IPPplnYf2A/xO6ihueBpZrHI5Oke8kxqLWjG2UU7eK2PbX9DzXPlmVx5fbq2Mu8Dbah4nMZgzMqSKmnl1SAXx/pwTJ+jxeT2A== 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-SenderADCheck; bh=DNgq2J6Sh1RlMt1cNyWfNvoJSn3H2WgLsiPA50k+OVE=; b=VMaR5tfd2f3zFJghSPSI52/f+0NsjL2LgyQ5jALhE+32SGVPr6EjtMe3Y4J08aEGrHJW8GnLiRBEOjbJUwRsRQVuoEQBi1XxJV68oh+6eSj32g8d6x0Wtj1KNicStPj6USue7PYzMgZm6+51RL/ptlahJeM1gcI1NlarvhjaIusldcADlMVqJEG6OQcTrYoZUtjEceWlICD39PnHNYNSfevO7kKVr7bYwsuOm7eVZoXHKrwZMWiZjGrbABseghjTKcrc64U5eOr7t/tCoKLFVoVV1a/shHtk/iSYjabb65wMS+wnDIYDOK8KjmtvDSy3aB3JIoSOYN9zV6bW/xb01A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=mellanox.com; dmarc=pass action=none header.from=mellanox.com; dkim=pass header.d=mellanox.com; arc=none 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=DNgq2J6Sh1RlMt1cNyWfNvoJSn3H2WgLsiPA50k+OVE=; b=rzPx3ZBL1BoxC0ZwSA+Ok0uddZPMBEPAb5wkWmFIHc3CDGLhEqAL7gkSb4Ul2Dj7qBgkbDX2C2Qyk99Onunl4D3T7VHuchduwwUcKO4Bq5FQUpvdEcBKtbi3LpRdQWR9QHqbr/IRqEmPsv7izvQMPdW45VFJwcvadEYptZw1j5w= Received: from AM0PR05MB5313.eurprd05.prod.outlook.com (2603:10a6:208:f2::28) by AM0PR05MB6738.eurprd05.prod.outlook.com (2603:10a6:20b:144::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.13; Tue, 28 Apr 2020 08:11:49 +0000 Received: from AM0PR05MB5313.eurprd05.prod.outlook.com ([fe80::3069:d8f4:fadc:4d7]) by AM0PR05MB5313.eurprd05.prod.outlook.com ([fe80::3069:d8f4:fadc:4d7%5]) with mapi id 15.20.2937.023; Tue, 28 Apr 2020 08:11:49 +0000 From: Tal Shnaiderman To: Narcisa Ana Maria Vasile CC: "dev@dpdk.org" , Thomas Monjalon , "pallavi.kadam@intel.com" , "dmitry.kozliuk@gmail.com" , "david.marchand@redhat.com" , "grive@u256.net" Thread-Topic: [dpdk-dev] [PATCH 7/7] bus/pci: support Windows with bifurcated drivers Thread-Index: AQHWGHehwJcJ9/fUlEe9VokrL/7pUKiNnecAgACZvEA= Date: Tue, 28 Apr 2020 08:11:49 +0000 Message-ID: References: <20200422072747.15960-1-talshn@mellanox.com> <20200422072747.15960-8-talshn@mellanox.com> <20200427225852.GA62222@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> In-Reply-To: <20200427225852.GA62222@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: linux.microsoft.com; dkim=none (message not signed) header.d=none;linux.microsoft.com; dmarc=none action=none header.from=mellanox.com; x-originating-ip: [37.142.1.17] x-ms-publictraffictype: Email x-ms-office365-filtering-ht: Tenant x-ms-office365-filtering-correlation-id: 9d206388-8e9f-4249-e2e8-08d7eb4bcd66 x-ms-traffictypediagnostic: AM0PR05MB6738: x-ld-processed: a652971c-7d2e-4d9b-a6a4-d149256f461b,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:2201; x-forefront-prvs: 0387D64A71 x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM0PR05MB5313.eurprd05.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(346002)(39860400002)(396003)(366004)(376002)(26005)(55016002)(5660300002)(81156014)(7696005)(478600001)(71200400001)(9686003)(8676002)(4326008)(33656002)(54906003)(8936002)(86362001)(2906002)(6506007)(52536014)(6916009)(66446008)(64756008)(66556008)(66476007)(66946007)(316002)(76116006)(186003); DIR:OUT; SFP:1101; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5jPRGR/4iP9w8eJeYdoS1ck846RUPrhsrUEZC1PuB7sJJwzxlAWOnb38lWwzZyOkHSQfhrmp7I22Q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YlHPaCpHqYXrBZbsKlcA1QvCC6iEX7nnxnLgmrPxzyHEyvGuubvnzCpWCUcUol/yW+tcQIQR3UM3A+J7aREtVTNqsddY63rikSEuhL9oDV8= x-ms-exchange-transport-forked: True 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: 9d206388-8e9f-4249-e2e8-08d7eb4bcd66 X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Apr 2020 08:11:49.5592 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: a652971c-7d2e-4d9b-a6a4-d149256f461b X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: lHJt4jhQ2U++/nKcyhFrZIcWBIXcxMt6/oaALgBVvktRogNRETljv20U8CqS1q2Z4R2AEkKf2RGT5aUuCExq5A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR05MB6738 Subject: Re: [dpdk-dev] [PATCH 7/7] bus/pci: support Windows with bifurcated drivers 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > Subject: Re: [dpdk-dev] [PATCH 7/7] bus/pci: support Windows with > bifurcated drivers >=20 > On Wed, Apr 22, 2020 at 10:27:47AM +0300, talshn@mellanox.com wrote: > > From: Tal Shnaiderman > > > > Uses SetupAPI.h functions to scan PCI tree. > > Uses DEVPKEY_Device_Numa_Node to get the PCI Numa node. > > scanning currently supports types RTE_KDRV_NONE. > > > > Signed-off-by: Tal Shnaiderman > > --- > > drivers/bus/pci/windows/pci.c | 342 > ++++++++++++++++++++++++++- > > lib/librte_eal/rte_eal_exports.def | 1 + > > lib/librte_eal/windows/include/rte_windows.h | 1 + > > 3 files changed, 342 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/bus/pci/windows/pci.c > > b/drivers/bus/pci/windows/pci.c index 7eff39173..d5ee938fa 100644 > > --- a/drivers/bus/pci/windows/pci.c > > +++ b/drivers/bus/pci/windows/pci.c > > @@ -1,14 +1,24 @@ > > /* SPDX-License-Identifier: BSD-3-Clause > > * Copyright 2020 Mellanox Technologies, Ltd > > */ > > + > > +static > > +int get_device_resource_info(HDEVINFO hDevInfo, > > + PSP_DEVINFO_DATA pDeviceInfoData , struct rte_pci_device *dev) { > > + int ret =3D -1; > > + DEVPROPTYPE uPropertyType; > > + DWORD uNumaNode; > > + BOOL bResult; > > + > > + switch (dev->kdrv) { > > + case RTE_KDRV_NONE: > > + /* Get NUMA node using DEVPKEY_Device_Numa_Node */ > > + bResult =3D SetupDiGetDevicePropertyW(hDevInfo, > pDeviceInfoData, > > + &DEVPKEY_Device_Numa_Node, &uPropertyType, > > + (BYTE *)&uNumaNode, sizeof(uNumaNode), NULL, > 0); > > + if (!bResult) { > > + ret =3D GetLastError(); > > + break; >=20 > Here 'ret' is correctly set to an error code, but after breaking out of t= he > switch, it is overwritten to ERROR_SUCCESS. > Maybe 'goto end' instead of 'break'. >=20 > > + } > > + dev->device.numa_node =3D uNumaNode; > > + /* mem_resource - Uneeded for RTE_KDRV_NONE */ > > + dev->mem_resource[0].phys_addr =3D 0; > > + dev->mem_resource[0].len =3D 0; > > + dev->mem_resource[0].addr =3D NULL; > > + break; > > + default: > > + ret =3D -1; >=20 > Same thing here, ret is overwritten after breaking from the switch. Agreed, I'll fix both in v2, thank you. >=20 > > + break; > > + } > > + > > + ret =3D ERROR_SUCCESS; > > +end: > > + return ret; > > +} > > + > > + > > +/*