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 F0665A04C9; Sun, 13 Sep 2020 20:43:03 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 535981DB9; Sun, 13 Sep 2020 20:43:03 +0200 (CEST) Received: from hqnvemgate24.nvidia.com (hqnvemgate24.nvidia.com [216.228.121.143]) by dpdk.org (Postfix) with ESMTP id 23243E07 for ; Sun, 13 Sep 2020 20:43:01 +0200 (CEST) Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Sun, 13 Sep 2020 11:40:41 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Sun, 13 Sep 2020 11:43:00 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Sun, 13 Sep 2020 11:43:00 -0700 Received: from HQMAIL107.nvidia.com (172.20.187.13) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Sun, 13 Sep 2020 18:42:54 +0000 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.176) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3 via Frontend Transport; Sun, 13 Sep 2020 18:42:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gpzUsloqw5iKyIm7+DE8niVBjn//X0RJr38qwYf8qGB9kqm4PpyZoAMygH/HqtgdgqpMdmMFUttektsduEK2HwSg7nXES7sz5x4fwLlWq6HQ1fF356KK1oGHbic1CpcUGxX8BdpHElDhMfj8tcD5DxJ1AS3b58k0QvPnCIvK1TivoOPHO/prj9iPjSRgBSaJNbi/WIN37wbJJ3DiHz925HLGnI4mURP54wEGhWkDzX+ClXCG0X1zEJ9MKVJmV8bDVIKyAaW36R32mG33ehhbFwkJGO+fbmFESA/yuAFus97b3yqLxjesb4IwdSvi/0K6Ipcc/T0FIMoz7j2RY9QUfw== 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=quEY0ru+s7bnB2n7oyPVawrjm5+lR6oJGsSiBsCJ5Ao=; b=gsSpj+pnt5WAtAew3uRoXGx5yznzeDR7DgBnEf/iCp3tzzEb0EAToGsENdlX20NWBVkOV51C9FMfeZhowUVWsT33pVrOHdeI47NSh2uI5P1xX0718VTjKQaGobR8S6O6A/rQHOM9UVZn9QG/JL/VpHEO3avYxuGlkpmKw2zlZo8sETFMnb5K0sSGgGrrcc2g4cGNnoZ+r6AiLbENAQfxmYGQLqgopBbnXvK/Qx3ySpe76Ez8w674CDv6s60/8E+waaYAKldIWOAagP8/NbYENIOL571y0Lrsf14NaAiwoznGxdCVP15qI6R7sC1Jynw6gie3ZOud7+YNfXxkLGYtfQ== 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 BY5PR12MB4323.namprd12.prod.outlook.com (2603:10b6:a03:211::10) by BYAPR12MB3222.namprd12.prod.outlook.com (2603:10b6:a03:12c::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3370.16; Sun, 13 Sep 2020 18:42:52 +0000 Received: from BY5PR12MB4323.namprd12.prod.outlook.com ([fe80::7deb:c09a:50d6:e561]) by BY5PR12MB4323.namprd12.prod.outlook.com ([fe80::7deb:c09a:50d6:e561%3]) with mapi id 15.20.3370.019; Sun, 13 Sep 2020 18:42:51 +0000 From: Tal Shnaiderman To: Pallavi Kadam , "dev@dpdk.org" , NBU-Contact-Thomas Monjalon CC: "ranjit.menon@intel.com" , "dmitry.kozliuk@gmail.com" , "Narcisa.Vasile@microsoft.com" Thread-Topic: [PATCH] bus/pci: netuio interface for windows Thread-Index: AQHWh9/cELBvzWJCiUWuA2WFCkNPJ6lm3/GA Date: Sun, 13 Sep 2020 18:42:51 +0000 Message-ID: References: <20200911015947.20044-1-pallavi.kadam@intel.com> In-Reply-To: <20200911015947.20044-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.6.33] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 8995569f-a296-4f8f-7ce6-08d85814d207 x-ms-traffictypediagnostic: BYAPR12MB3222: x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:3513; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: gGV1g9zzoilexe5+EHQ03uoFZjcxBgCpPSOg01zRYQjWjTy0LXJUHWpPd4IAHq5mJ+yyXeAivRUQUOOV/DLfz+Oj/gWzuDRmocapZSukDxndhy2dxKci4objOU9aRFMb4m7STFgseGrwYy0G/wehYtrpApH8Qvk3k4uEwMzqE+pzqk/gIwIHyk/KFIFJAAAR0D/r67ZAiq/8xlq8mOmJVcnvtH+m1gy0FZ3snp9UL+zKtH4hbiAC3Kj0zZ9mw8CoAEGofRaMz9/8lrQiRelRKaqJX9sse2SHnQt2gBE3k3D4LimY6fq470SfMzmBSJvFlOkOCkwNpIS1uwYw782R2Q== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BY5PR12MB4323.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(136003)(396003)(39860400002)(376002)(346002)(366004)(9686003)(4326008)(186003)(7696005)(478600001)(52536014)(5660300002)(316002)(33656002)(76116006)(86362001)(66446008)(66946007)(66476007)(66556008)(64756008)(71200400001)(110136005)(55016002)(54906003)(2906002)(8676002)(83380400001)(8936002)(6506007)(26005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: EEn8IETbs45etTNqYvnrqufnYMMO+Mum4UI1ODFBXfBMrLKXQ1G5MIDxu+uE/LbDXwsDWCBYDixi9YjfZWTxsvAjNyC8rWi4Hl3Ae4fDHu2wEYaDxOgEoOri8KUN3HWs5ubwIHXwrmEMQnfDeZqCkpiJ8DsaBU1dzhJitb1w1Gl8ZEkHd5X0WaSPHpjhQyvqXjjUXEVM7xaakNzy3BhH5lv0wxiF/VysUgnymX8BCP1yX8+3ORfpxopzWbHj1hFWSGmNGTjtP3Cj8J5zg1MAIpwKA6mjB9GDiPSoc3Wi+MZJKJHtwgKcaiMVDfRVQAhyEEZe7b0qEQrf6agVigN7Ybwof+Hf2POZYRTYrGIY0GGmL8mKV5QiE1Jm98kWYOG10nA4P9kMgGdKznlAgf0MWQq9YoYsi6RsF8ELH03zqO98++rijFcrh9T/TOeiTOmE/VbIhD3uh+ScXqU+Cl0zPJabPhENZJctSAgqfMAWVPdoxlKVAb5CQb3kyA2fQTbwKEj9nDG9xNst8OAFSsqeoOJVsQNSq2XvQOIFphKvluocZEUw5xwe6A2W4o5yCGhfRAcEHHAZWXI0QWi12xMM55mKSpFiQxFq8ruj3JHQ6bTU6cofOgbWWvyacBwSK6empPWf9VKvzBUafkg35h17kg== 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: BY5PR12MB4323.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 8995569f-a296-4f8f-7ce6-08d85814d207 X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Sep 2020 18:42:51.7369 (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: daErzcpjTTXeCUQoxFl0hS5jgcn5v1k7DIzQ79XDT9IP1vzNbgqcK4IbrSasyPJlHvdzDe+krdC6rz8VXrlVlw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR12MB3222 X-OriginatorOrg: Nvidia.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1600022441; bh=quEY0ru+s7bnB2n7oyPVawrjm5+lR6oJGsSiBsCJ5Ao=; h=X-PGP-Universal: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=G7EOHHjmkJyXQXtOxBYCkpZdkfqp5WPKnqg0bcPDoN+usjPUmM2CvF+zIYmRgwUdt GMvVpdsYwZLVQsBQKvyjNM8GvghvWvobKZvwoRpS2vLE2E4ESztJ1X43sPdsZBwoex Yc1GM0qEpI88NNTe1fZ9mTSAururzwX5oJXn3LUTOqVXvP5WkKiQ1ejBlzZOdwaSEH gvwLlQmSR6yaT0d8vzuqRGxyvA0R93pv0UyV0N1vCxpNEVbEIftCbYGdjH+Be5hMNX Uv+VqCrUc3oOQnayVLCcUIBh+xPRxAoKnZnPgKQ4XPXItzsW6yQj46LlfSpk0GYYxC WjgcwBorpSq5w== Subject: Re: [dpdk-dev] [PATCH] 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] 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 ("[v3] 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 > Signed-off-by: Pallavi Kadam > Reviewed-by: Ranjit Menon > --- > drivers/bus/pci/windows/pci.c | 293 +++++++++++++++++++++++++++++-- > --- > 1 file changed, 257 insertions(+), 36 deletions(-) >=20 > diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.= c > index c80bd5571..38db87a2a 100644 > --- a/drivers/bus/pci/windows/pci.c > +++ b/drivers/bus/pci/windows/pci.c I think it will be better to split the pci implementation into 2 files and = add pci_netuio.c (similarly to Linux with pci_uio.c and pci_vfio.c), moving all of the netui= o-specific definitions and functions in this patch to the new file. [snip] > -int > -rte_pci_scan(void) > +static int > +pci_scan_device_class(const GUID *guid) > { > int ret =3D -1; > DWORD device_index =3D 0, found_device =3D 0; > HDEVINFO dev_info; > SP_DEVINFO_DATA device_info_data; > + const char *class; >=20 > - /* for debug purposes, PCI can be disabled */ > - if (!rte_eal_has_pci()) > - return 0; > + if (IsEqualGUID((const void *)guid, > + (const void *)&GUID_DEVCLASS_NETUIO)) > + class =3D netuio_class; > + else > + class =3D net_class; >=20 > - dev_info =3D SetupDiGetClassDevs(&GUID_DEVCLASS_NET, TEXT("PCI"), > NULL, > - DIGCF_PRESENT); > + dev_info =3D SetupDiGetClassDevs(guid, TEXT("PCI"), NULL, > + DIGCF_PRESENT); Is there a way to get both GUID_DEVCLASS_NET and GUID_DEVCLASS_NETUIO in a = single call here? We could avoid calling this function twice if we could get all of the devic= es. > if (dev_info =3D=3D INVALID_HANDLE_VALUE) { > RTE_LOG_WIN32_ERR("SetupDiGetClassDevs(pci_scan)"); > - RTE_LOG(ERR, EAL, "Unable to enumerate PCI devices.\n"); > + RTE_LOG(ERR, EAL, "Unable to enumerate %s PCI devices.\n"= , > + class); > goto end; > } >=20 > @@ -415,7 +614,8 @@ rte_pci_scan(void) > device_info_data.cbSize =3D sizeof(SP_DEVINFO_DATA); > } >=20 > - RTE_LOG(DEBUG, EAL, "PCI scan found %lu devices\n", found_device)= ; > + RTE_LOG(DEBUG, EAL, "PCI scan found %lu %s devices\n", > + found_device, class); > ret =3D 0; > end: > if (dev_info !=3D INVALID_HANDLE_VALUE) @@ -423,3 +623,24 @@ > rte_pci_scan(void) >=20 > return ret; > } > + > +/* > + * Scan the contents of the PCI bus looking for devices */ int > +rte_pci_scan(void) > +{ > + int ret =3D -1; > + > + /* for debug purposes, PCI can be disabled */ > + if (!rte_eal_has_pci()) > + return 0; > + > + /* first, scan for netUIO class devices */ > + ret =3D pci_scan_device_class(&GUID_DEVCLASS_NETUIO); ret is overwritten later on. > + > + /* then, scan for the standard net class devices */ > + ret =3D pci_scan_device_class(&GUID_DEVCLASS_NET); > + > + return ret; > +} > -- > 2.18.0.windows.1