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 860B1A04C0; Tue, 29 Sep 2020 10:28:37 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 656641D735; Tue, 29 Sep 2020 10:28:36 +0200 (CEST) Received: from nat-hk.nvidia.com (nat-hk.nvidia.com [203.18.50.4]) by dpdk.org (Postfix) with ESMTP id E8ADF1BC82 for ; Tue, 29 Sep 2020 10:28:34 +0200 (CEST) Received: from HKMAIL104.nvidia.com (Not Verified[10.18.92.77]) by nat-hk.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Tue, 29 Sep 2020 16:28:32 +0800 Received: from HKMAIL104.nvidia.com (10.18.16.13) by HKMAIL104.nvidia.com (10.18.16.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 29 Sep 2020 08:28:24 +0000 Received: from NAM10-MW2-obe.outbound.protection.outlook.com (104.47.55.107) by HKMAIL104.nvidia.com (10.18.16.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Tue, 29 Sep 2020 08:28:24 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gxI5pKNt2FaXrib6UfdH3Nks17ydG0RbmBsu/ElrfnSLGWv23jiKhXVUi2sHCXDNzz5UFxkOgBlMPlh/Q9jrA/QCcZEiubfl54+P9Be6NGC3B+23eRIc/KWsuT1rGZlCWLnlN/oT3mQk9AQZMl8MgvreNiJXuaDSCLtGuIGdlccf/ns1hxN5UZnkriuNZgaorRwrChoHedr25kvNCZlznvOEg+LELSOE02ummPbQyKgih/53obVBUijrBwmU1awgD/zd4SnpyVmHDFBO+8mgPxKGk8rUZt5aqa4WqNM0VMS5j56KSRJ9+e640+FH7JWoNeuVGWfk1LdnI/agkFiIpQ== 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=fSM10bdz/lBzaKwP/JYu9KnOVcjiJYI10tjRcziwo9Y=; b=E9M8BvDnIJEndnK24emdmW2C5pPjH8mmwQSCcA7qatuln5G2XSCvUkEdX7b5SD2ZOuJtwVf2btgQXiiUSumBABDv9Wbff7TRjomgWTH1scGCc113wT6iGib/iCmh3EHif4NT7DVxpxMGsUKnzCAsJI3R0i5L17Geh0HT4/myKqgJJeOoYdir2S19PqzB8cXJC9WP39wDOfXoppC90irfZK3YcihIhVl+zfiPfqn5w/ISPepSl8A5rNrXPD8NS3504J0ALnngDiuVmbaDUkNxBf3asZvylDm3hHGI7PRQdpJ9+pIAqAXsov2c+0mcfvNnBj2QLFcCGhwjVgbUvGFRKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none Received: from DM6PR12MB4329.namprd12.prod.outlook.com (2603:10b6:5:211::9) by DM5PR12MB1370.namprd12.prod.outlook.com (2603:10b6:3:76::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3412.24; Tue, 29 Sep 2020 08:28:22 +0000 Received: from DM6PR12MB4329.namprd12.prod.outlook.com ([fe80::d523:5a22:d21c:32d6]) by DM6PR12MB4329.namprd12.prod.outlook.com ([fe80::d523:5a22:d21c:32d6%6]) with mapi id 15.20.3412.029; Tue, 29 Sep 2020 08:28:22 +0000 From: Tal Shnaiderman To: Pallavi Kadam , "dev@dpdk.org" , NBU-Contact-Thomas Monjalon CC: "ranjit.menon@intel.com" , "John.Alexander@datapath.co.uk" , "dmitry.kozliuk@gmail.com" , "Narcisa.Vasile@microsoft.com" Thread-Topic: [PATCH v5] bus/pci: netuio interface for windows Thread-Index: AQHWkt9SB19NMOso/UKlSCu4tcwJ96l/QDCQ Date: Tue, 29 Sep 2020 08:28:22 +0000 Message-ID: References: <20200922030531.6928-1-pallavi.kadam@intel.com> <20200925015327.2916-1-pallavi.kadam@intel.com> In-Reply-To: <20200925015327.2916-1-pallavi.kadam@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=nvidia.com; x-originating-ip: [37.142.1.52] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: a41c5d4d-a4cb-44a7-3934-08d86451a0f6 x-ms-traffictypediagnostic: DM5PR12MB1370: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5BL/8btWl1APMU/u++ngLQ410LtcpsSdlJ/4YdnOuTJ7WVyVHlYvrh7habJ0offhMelq+XmPlHyReClfeibKK01abZyE+VwnCH9eELenvJn37IrpcvAefAeRznHhnodVTDe+8Y2sXsqTYJsH/TL0kwupinJLyiMsm8UJaTkzyWsC6KvLs1/XGA56DhC7/OMu0hV7ceUzEf4bpmPhuwV+bTSAhiDi7/o9YCgaMcnIPGanje+1+ikO1bD/qLqp3I4Dse5WDS69piB13189u9/qvnLgGKDiIkGG0WfpRL0IPuZdfKHUyHwp/BPSEVf8EORaHiH7tfL+wwCzJJAZTwMfnXrlLyq1h57tuYFLsJLVau1DpFQnsunk+BwGNh6tzlMf x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB4329.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(376002)(366004)(136003)(39860400002)(346002)(2906002)(316002)(8676002)(54906003)(76116006)(186003)(110136005)(66946007)(52536014)(26005)(6506007)(83380400001)(8936002)(7696005)(9686003)(55016002)(66556008)(71200400001)(66476007)(4326008)(33656002)(64756008)(86362001)(5660300002)(66446008)(478600001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: eLJazoYFbN24kOw190tqawuiHwRHksLx32VutBjKrjI8KAXsoUnhOZJieGcELtnUmFjS+Mr3CPlFvlkG43dIhmvtpwA4Xr/vXQe8OqZvh7jpm9jFeLFVyWJWJIlj1rHhvu4YE4IKAESuCfL6Kj4YOB7OmA7C4zHxQU9P2WobAC1jS9BO4dDrmsx0yNFnjTl0HNTnLOoH8mbqI0psW2mfoiV99aknbSlJd9PP3p62wiYWrtFLSiRVPjJyT33dumCjcy8OMUNbLBi8J3wZe1+KGz5Ul5Pn4ZSFckLhWp/W1w0XItPlyd6PFUq7IynVt7bAJ82Pbd/NBP4hkoIvmI9uRb919gyGb03vXCh0qlrpXaWE0v1VX0hYcXgos/Vp2hyUnRGqTrck9cXODhzMk3qg5ba/4scwht2VWyfFr1PTg4aEyQcrLdVwzRlB5dtIU6VookEvpbBrcY4jeDpQWYKsPuC0TNNmzBreNDP5Srg+0yen4vFejIgDMvNv1RbF8D60jS/+9uinlakiEOfmCiNTZzmA7TcXuNShFt1+lVXHaDUMtots0cpW1yxM22w2f7gIwThDrqn4GAFMBNfaGKS+4Q+5m7AWvX4WdBwb7ZzKVtPbJbrFbyngVQq0pd1PUdz+PWOwtoblzliQruBEdxwsNQ== x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4329.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a41c5d4d-a4cb-44a7-3934-08d86451a0f6 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Sep 2020 08:28:22.7131 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ZRQO1bNPNuk1pYrc9axI/m8dBAkKJJb5HNB/wCzwl5Xf1lVgkcOnzy0vdwoLsJ6FLIes0cPTlHa90ak/Sj/mjA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1370 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1601368112; bh=fSM10bdz/lBzaKwP/JYu9KnOVcjiJYI10tjRcziwo9Y=; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To: CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References: In-Reply-To:Accept-Language:Content-Language:X-MS-Has-Attach: X-MS-TNEF-Correlator:authentication-results:x-originating-ip: x-ms-publictraffictype:x-ms-office365-filtering-correlation-id: x-ms-traffictypediagnostic:x-ld-processed: x-microsoft-antispam-prvs:x-ms-oob-tlc-oobclassifiers: x-ms-exchange-senderadcheck:x-microsoft-antispam: x-microsoft-antispam-message-info:x-forefront-antispam-report: x-ms-exchange-antispam-messagedata:x-ms-exchange-transport-forked: Content-Type:Content-Transfer-Encoding:MIME-Version: X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-AuthSource: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-originalarrivaltime: X-MS-Exchange-CrossTenant-fromentityheader: X-MS-Exchange-CrossTenant-id:X-MS-Exchange-CrossTenant-mailboxtype: X-MS-Exchange-CrossTenant-userprincipalname: X-MS-Exchange-Transport-CrossTenantHeadersStamped:X-OriginatorOrg; b=XZlY1C3levFKEe2ceaPWLbTduneHtV0eJtbdkpxotUQFD381dpBQGaf8UTE6vJJ0o KHOi058oOlrlcDEOUsDkaiQaWlXqzMg84CkVpafoA3azwAYwjeYPOgDNODj1wgZ/5D srdm/ATRwabpTjYWBhKw8oras6lHR9UJnxQrP+j8qDQ8O327zGvxr601vwDGJli6Aj vXMH8GOdksZKNrG1Gbfj0mHzaa0diqky7GA46hC5U0KSv9ek2eyXioWPxVgL2GvpnL LgXeqe8kPMkvXkT7szDmrPs5ctED24u4zOWkk1t94hJd0L/+p23vBjqx+fUCjEmhP9 MfscIcjRgQqJQ== Subject: Re: [dpdk-dev] [PATCH v5] bus/pci: netuio interface for windows 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: [PATCH v5] bus/pci: netuio interface for windows >=20 > This patch adds implementations to probe PCI devices bound to netuio with > the help of "netuio" class device changes. > Now Windows will support both "netuio" and "net" device class and can set > kernel driver type based on the device class selection. >=20 > Note: Few definitions and structures have been copied from > netuio_interface.h file from ("[v4] windows/netuio: add Windows NetUIO > kernel driver") series and this will be fixed once the exact path for net= uio > source code is known. >=20 > v5 changes: > Changed when netuio driver handle is closed >=20 > v4 changes: > Removed 'reserved' member as it is not used >=20 > v3 changes: > Removed the casts >=20 > v2 changes: > - Moved all netuio specific definitions and functions to > pci_netuio.c and pci_netuio.h files > - Added a single function call to scan all the devices >=20 > Signed-off-by: John Alexander > Signed-off-by: Pallavi Kadam > Reviewed-by: Ranjit Menon > --- [snip] > +/* > + * get device resource information by sending ioctl to netuio driver > +*/ int get_netuio_device_info(HDEVINFO dev_info, PSP_DEVINFO_DATA > +dev_info_data, > + struct rte_pci_device *dev) > +{ [snip] > + /* get NUMA node using DEVPKEY_Device_Numa_Node */ > + res =3D SetupDiGetDevicePropertyW(dev_info, dev_info_data, > + &DEVPKEY_Device_Numa_Node, &property_type, > + (BYTE *)&numa_node, sizeof(numa_node), NULL, 0); > + if (!res) { > + RTE_LOG_WIN32_ERR( > + > "SetupDiGetDevicePropertyW(DEVPKEY_Device_Numa_Node)"); > + goto end; > + } > + dev->device.numa_node =3D numa_node; The is the same code RTE_PCI_KDRV_NONE devices are using to get numa node i= d, I suggest removing it and changing the original code in get_device_resou= rce_info to work on both RTE_PCI_KDRV_NONE and RTE_PCI_KDRV_NIC_UIO In general: Regarding the issue Ranjit mentioned in the last community call on duplicat= ed detection of netuio devices both as GUID_DEVCLASS_NETUIO and GUID_DEVCLA= SS_NET, in pci_scan_one there is actually code that take cares of duplicate= d detection by leaving only one in the device list, up until nor I saw it i= n action only in virtualization where BDF of several devices was equal. Assuming this is resolved with the addition of segment id as domain id the = change we need is to give precedence to GUID_DEVCLASS_NETUIO, something lik= e: @@ -372,11 +372,15 @@ pci_scan_one(HDEVINFO dev_info, PSP_DEVINFO_DATA devi= ce_info_data) } else if (ret < 0) { rte_pci_insert_device(dev2, dev); } else { /* already registered */ + if (IsEqualGUID(&(device_info_data.ClassGuid), + &GUID_DEVCLASS_NETUIO) { dev2->kdrv =3D dev->kdrv; dev2->max_vfs =3D dev->max_vfs; memmove(dev2->mem_resource, dev->mem_resource, sizeof(dev->mem_resource)); + } free(dev); } return 0; } The other pci.c changes of the patch LGTM, I'd prefer someone from MSFT to = review in depth the pci_netuio.c/.h, the only other comment I have on it is= a suggestion to break down the get_netuio_device_info function into severa= l helper functions (get_netuio_device_information_set, allocate_netuio_inte= rface_detail, etc)