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 9FDF5A0561; Thu, 18 Mar 2021 11:48:20 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1E41A406B4; Thu, 18 Mar 2021 11:48:20 +0100 (CET) Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id 4A01340698; Thu, 18 Mar 2021 11:48:18 +0100 (CET) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id E5C285C0117; Thu, 18 Mar 2021 06:48:17 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 18 Mar 2021 06:48:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=Kv9pyZctOMYtb c/QBwCYVoLf3CFOr5km6G95WrM0yfA=; b=T51bek3fZTbOP5919p0yhECtb39s2 ZX9JvkcReYfz1S1kxje4TONKgoDfyxYo7TJZsip3jR7wiqyJmOOK314OKivOGfIY gaAV2IWOb9NW4EZukIDOOffTIez5LYkjxEarf5UCqfBJX2aalE7R5eP75TEAuI3o gdd8twe0v1tG/hYXk8q8zhESvM47V4PFZMPf+et+4kqRXJDCJW4ce8D4HM32Wz6l nFLFVCyV2QCL2jaPphEHRGPoEJCHLGbbYWtpSAtm2wpSil1+B8+QdzNM4AK167Oh k7kskvRBn/LlSooZ1+j8i6B4EL0HM367JpcrACq5o6xgl38+vrsV01/VQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=Kv9pyZctOMYtbc/QBwCYVoLf3CFOr5km6G95WrM0yfA=; b=XjXApfmU lJ4u+9+IbCGBJf+iV4+FrSJtMtgM7RTYBcO43YaRGtJMnH5j9+8Rp5LAtKwJ0p5o +3TjaGRcCMmhysJtPntkQWE2Iq+sBHS7JrwYG2TsLySZE+uSOUeRvfCpHwfE9W+F SNmQ9lAYGQLfzoE/iSJHUK/27ME+6aZUKb45URJaAGtSgLIFXGDG8rBnNHA7bgLp kXwVrM8zXzNlCBZ1BT3RRjLibxWumDNqVCpsZ2hXN8FgGgu7NHaXgNG4AkX11YuO cLcp5KBUnA4uG1AYUXh2f164wg5PZ2CMZZ6xkolVAkM/9p5Ylxasj9mJZrWKrTRV 6RM0nz1faTIJcw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudefiedgvdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepvdehgfeivdejgedtveehfefhteelfefgieevgfffveefjeegtdfg uedthedtgeevnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght 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 2E0B3240054; Thu, 18 Mar 2021 06:48:16 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: dmitry.kozliuk@gmail.com, stable@dpdk.org, Tal Shnaiderman , Ranjit Menon , Narcisa Vasile , Pallavi Kadam , John Alexander Date: Thu, 18 Mar 2021 11:48:07 +0100 Message-Id: <20210318104807.1882334-1-thomas@monjalon.net> X-Mailer: git-send-email 2.30.1 In-Reply-To: <20210316231153.724029-1-thomas@monjalon.net> References: <20210316231153.724029-1-thomas@monjalon.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v2] 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. This value covers the mlx case where the kernel driver is in place, offering a bifurcated mode to the userspace driver. When the kernel driver is listed as unknown, there is no special treatment in DPDK probing, contrary to UIO modes. The value 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 (at the end for ABI compatibility), 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 Acked-by: Dmitry Kozlyuk --- v2: improve comments and commit message --- 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..876abddefb 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, /* may be misc UIO or bifurcated driver */ + RTE_PCI_KDRV_IGB_UIO, /* igb_uio for Linux */ + RTE_PCI_KDRV_VFIO, /* VFIO for Linux */ + RTE_PCI_KDRV_UIO_GENERIC, /* uio_pci_generic for Linux */ + RTE_PCI_KDRV_NIC_UIO, /* nic_uio for FreeBSD */ + RTE_PCI_KDRV_NONE, /* no attached driver */ + 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..d39a7748b8 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: + /* bifurcated driver case - 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