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 9600CA054F; Wed, 17 Mar 2021 00:12:21 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1A9B440A4B; Wed, 17 Mar 2021 00:12:21 +0100 (CET) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id CBB5040040; Wed, 17 Mar 2021 00:12:19 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 084735C00D5; Tue, 16 Mar 2021 19:12:18 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 16 Mar 2021 19:12:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=HyizUQMpwbZC7dYd1fVOPs8Xpq 19G77ouwC6VcphCGU=; b=j3hDaHBodm9NLrnZOHJvdn9WmVV1Ow6nmtXHsYZbay hZoFoc1DnSUx/iYRlCNFF/ZCNbt53VRSD8AOjEvqC/4LnJkLo+fPryzrt7KxTKCG INgw5sdoIhvyWEWIBOYu2hMMrfpdX4BIQZQ2YOyWDGmdWDqZjfEhlzg4kAXNMjQx ghyGaSgkjPO5t6foo54TBfX/qaCoMXJ+RUYMp7RFaqA1AbE0OL/oE52poWR/bffe 1q5h11yVsZTJ7RgqZ7DinP5VXr17/gP0jpmeYKf9rhHINPfBzbqv/jD4H2DgxR6H 2I4fTS/BMNrrPsgepzO5vh6I8w+1xuLnHs8tZaiwJmmg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=HyizUQMpwbZC7dYd1 fVOPs8Xpq19G77ouwC6VcphCGU=; b=aPMDb09bz6JnEtxDpRQViIAzOwt1sraFT ICC3L0DvQFIemtv8PzS7j8UP29MSURMhC2EkyN3DTjafye4v5erXpsVl2Q0NIqVb UFOpI2KB9yuwob2X1i+X0xgpw9GcL8BGS/TSMwHd2p2Q42mskPuZvpa97A4B1WpI 3L1FeaHfAOVffDHmdf/cqRt6LHCUjSFadKxbkeA1HhjUGoSlpM71HmSgROD9Vuno Ov7DpRpRV6VNyS0d8obZM6cxHPKvgGAA1U949Fuolo0mPIXgVlJ0JnLmANWKCSW0 lKyL4/PJOxM8T3fhzf6kHflVrK+la+l0s+aejR19ylPhsRVtT1QsA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeffedgtdefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgrshcu ofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecuggftrf grthhtvghrnhepvdelvdduhedvudduveeuvdevheegudelgeeigfejheduhedttdegudff jeeihffgnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghlohhn rdhnvght X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id B09FF1080054; Tue, 16 Mar 2021 19:12:16 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: dmitry.kozliuk@gmail.com, stable@dpdk.org, Tal Shnaiderman , Narcisa Vasile , Ranjit Menon , John Alexander , Pallavi Kadam Date: Wed, 17 Mar 2021 00:11:53 +0100 Message-Id: <20210316231153.724029-1-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] bus/pci: fix Windows kernel driver categories 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 Sender: "dev" In Windows probing, the value RTE_PCI_KDRV_NONE was used instead of RTE_PCI_KDRV_UNKNOWN (mlx case), and RTE_PCI_KDRV_NIC_UIO (FreeBSD) was re-used instead of having a new RTE_PCI_KDRV_NET_UIO for Windows NetUIO. While adding the new value RTE_PCI_KDRV_NET_UIO, the enum of kernel driver categories is annotated. Fixes: b762221ac24f ("bus/pci: support Windows with bifurcated drivers") Fixes: c76ec01b4591 ("bus/pci: support netuio on Windows") Cc: stable@dpdk.org Signed-off-by: Thomas Monjalon --- drivers/bus/pci/rte_bus_pci.h | 13 +++++++------ drivers/bus/pci/windows/pci.c | 14 +++++++------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h index fdda046515..3d009cc74b 100644 --- a/drivers/bus/pci/rte_bus_pci.h +++ b/drivers/bus/pci/rte_bus_pci.h @@ -52,12 +52,13 @@ TAILQ_HEAD(rte_pci_driver_list, rte_pci_driver); struct rte_devargs; enum rte_pci_kernel_driver { - RTE_PCI_KDRV_UNKNOWN = 0, - RTE_PCI_KDRV_IGB_UIO, - RTE_PCI_KDRV_VFIO, - RTE_PCI_KDRV_UIO_GENERIC, - RTE_PCI_KDRV_NIC_UIO, - RTE_PCI_KDRV_NONE, + RTE_PCI_KDRV_UNKNOWN = 0, /* not listed - may be a bifurcated driver */ + RTE_PCI_KDRV_IGB_UIO, /* igb_uio for Linux */ + RTE_PCI_KDRV_VFIO, /* VFIO for Linux */ + RTE_PCI_KDRV_UIO_GENERIC, /* uio_generic for Linux */ + RTE_PCI_KDRV_NIC_UIO, /* nic_uio for FreeBSD */ + RTE_PCI_KDRV_NONE, /* error */ + RTE_PCI_KDRV_NET_UIO, /* NetUIO for Windows */ }; /** diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c index 8f906097f4..3f0ce1fb83 100644 --- a/drivers/bus/pci/windows/pci.c +++ b/drivers/bus/pci/windows/pci.c @@ -38,7 +38,7 @@ rte_pci_map_device(struct rte_pci_device *dev) * Devices that are bound to netuio are mapped at * the bus probing stage. */ - if (dev->kdrv == RTE_PCI_KDRV_NIC_UIO) + if (dev->kdrv == RTE_PCI_KDRV_NET_UIO) return 0; else return -1; @@ -207,14 +207,14 @@ get_device_resource_info(HDEVINFO dev_info, int ret; switch (dev->kdrv) { - case RTE_PCI_KDRV_NONE: - /* mem_resource - Unneeded for RTE_PCI_KDRV_NONE */ + case RTE_PCI_KDRV_UNKNOWN: + /* mem_resource is unneeded */ dev->mem_resource[0].phys_addr = 0; dev->mem_resource[0].len = 0; dev->mem_resource[0].addr = NULL; break; - case RTE_PCI_KDRV_NIC_UIO: - /* get device info from netuio kernel driver */ + case RTE_PCI_KDRV_NET_UIO: + /* get device info from NetUIO kernel driver */ ret = get_netuio_device_info(dev_info, dev_info_data, dev); if (ret != 0) { RTE_LOG(DEBUG, EAL, @@ -323,9 +323,9 @@ set_kernel_driver_type(PSP_DEVINFO_DATA device_info_data, { /* set kernel driver type based on device class */ if (IsEqualGUID(&(device_info_data->ClassGuid), &GUID_DEVCLASS_NETUIO)) - dev->kdrv = RTE_PCI_KDRV_NIC_UIO; + dev->kdrv = RTE_PCI_KDRV_NET_UIO; else - dev->kdrv = RTE_PCI_KDRV_NONE; + dev->kdrv = RTE_PCI_KDRV_UNKNOWN; } static int -- 2.30.1