From patchwork Thu Sep 17 11:28:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 78042 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 5C6BBA04AF; Thu, 17 Sep 2020 13:29:01 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 3379A1D61D; Thu, 17 Sep 2020 13:28:54 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by dpdk.org (Postfix) with ESMTP id 3B0521D61B for ; Thu, 17 Sep 2020 13:28:52 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600342131; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7pIultnuFT0DZWNg3bf8HhuJWdFgOaYmNlwbF7ZSgx8=; b=JXnx7+lGi49kAF0JitAAtnU7fv/+phqsW26ljPVywlw6KaOiPJLUeA0c7zCsMdH37eKSqG +M0U8OxCnj3EAHRd1qZg9iSjLfsIYeVNaNQHXUos/f7mFJCjZHkOvz7FmMpmw30py0tJFX apX8fDV9F1gVhg/WnXsn0kezdFqNRxQ= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-423-TcJqZmxSNNqsNTHrxZQJ7w-1; Thu, 17 Sep 2020 07:28:47 -0400 X-MC-Unique: TcJqZmxSNNqsNTHrxZQJ7w-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 73E081008558; Thu, 17 Sep 2020 11:28:44 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.193.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id E519B5DA30; Thu, 17 Sep 2020 11:28:38 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: arybchenko@solarflare.com, Ray Kinsella , Neil Horman , John McNamara , Marko Kovacevic , Zyta Szpak , Liron Himi , Harman Kalra , Bruce Richardson , Jasvinder Singh , Cristian Dumitrescu , Thomas Monjalon , Ferruh Yigit Date: Thu, 17 Sep 2020 13:28:18 +0200 Message-Id: <20200917112823.10534-2-david.marchand@redhat.com> In-Reply-To: <20200917112823.10534-1-david.marchand@redhat.com> References: <20200914081727.12215-1-david.marchand@redhat.com> <20200917112823.10534-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH v3 1/6] ethdev: remove unused kernel driver field 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" This field was not generic as it was filled with PCI kernel drivers only. It has no known in-tree user (and I could not find opensource projects using it). Signed-off-by: David Marchand Acked-by: Andrew Rybchenko --- doc/guides/rel_notes/deprecation.rst | 3 --- doc/guides/rel_notes/release_20_11.rst | 3 +++ drivers/net/mvneta/mvneta_ethdev.c | 1 - drivers/net/mvpp2/mrvl_ethdev.c | 1 - drivers/net/octeontx/octeontx_ethdev.c | 1 - drivers/net/ring/rte_eth_ring.c | 1 - drivers/net/softnic/rte_eth_softnic.c | 1 - lib/librte_ethdev/rte_ethdev_core.h | 1 - lib/librte_ethdev/rte_ethdev_pci.h | 1 - lib/librte_ethdev/rte_ethdev_vdev.h | 1 - 10 files changed, 3 insertions(+), 11 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 1f888fa90e..394b55d8ca 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -127,9 +127,6 @@ Deprecation Notices * pci: The ``rte_kernel_driver`` enum defined in rte_dev.h will be made private to the PCI subsystem as it is used only by the PCI bus driver and PCI drivers. - The associated field ``kdrv`` in the ethdev ``rte_eth_dev_data`` structure - will be removed as it gave no useful abstracted information to the - applications and had no user (neither internal nor external). * mbuf: Some fields will be converted to dynamic API in DPDK 20.11 in order to reserve more space for the dynamic fields, as explained in diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index cc726095a7..684da5157d 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -91,6 +91,9 @@ API Changes the structures ``rte_mbuf`` and ``rte_mbuf_ext_shared_info``. The field ``refcnt`` is remaining from the old unions. +* ethdev: Removed the ``kdrv`` field in the ethdev ``rte_eth_dev_data`` + structure as it gave no useful abstracted information to the applications. + * rawdev: Added a structure size parameter to the functions ``rte_rawdev_queue_setup()``, ``rte_rawdev_queue_conf_get()``, ``rte_rawdev_info_get()`` and ``rte_rawdev_configure()``, diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c index 673a8e2b3a..5bf3ebc4bd 100644 --- a/drivers/net/mvneta/mvneta_ethdev.c +++ b/drivers/net/mvneta/mvneta_ethdev.c @@ -827,7 +827,6 @@ mvneta_eth_dev_create(struct rte_vdev_device *vdev, const char *name) memcpy(eth_dev->data->mac_addrs[0].addr_bytes, req.ifr_addr.sa_data, RTE_ETHER_ADDR_LEN); - eth_dev->data->kdrv = RTE_KDRV_NONE; eth_dev->device = &vdev->device; eth_dev->rx_pkt_burst = mvneta_rx_pkt_burst; mvneta_set_tx_function(eth_dev); diff --git a/drivers/net/mvpp2/mrvl_ethdev.c b/drivers/net/mvpp2/mrvl_ethdev.c index 96b27dfd30..f5e77d07bf 100644 --- a/drivers/net/mvpp2/mrvl_ethdev.c +++ b/drivers/net/mvpp2/mrvl_ethdev.c @@ -2856,7 +2856,6 @@ mrvl_eth_dev_create(struct rte_vdev_device *vdev, const char *name) memcpy(eth_dev->data->mac_addrs[0].addr_bytes, req.ifr_addr.sa_data, RTE_ETHER_ADDR_LEN); - eth_dev->data->kdrv = RTE_KDRV_NONE; eth_dev->device = &vdev->device; eth_dev->rx_pkt_burst = mrvl_rx_pkt_burst; mrvl_set_tx_function(eth_dev); diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c index 76c69294d0..653ab9b458 100644 --- a/drivers/net/octeontx/octeontx_ethdev.c +++ b/drivers/net/octeontx/octeontx_ethdev.c @@ -1363,7 +1363,6 @@ octeontx_create(struct rte_vdev_device *dev, int port, uint8_t evdev, eth_dev->device = &dev->device; eth_dev->intr_handle = NULL; - eth_dev->data->kdrv = RTE_KDRV_NONE; eth_dev->data->numa_node = dev->device.numa_node; data->port_id = eth_dev->data->port_id; diff --git a/drivers/net/ring/rte_eth_ring.c b/drivers/net/ring/rte_eth_ring.c index 733c898259..40fe1ca4ba 100644 --- a/drivers/net/ring/rte_eth_ring.c +++ b/drivers/net/ring/rte_eth_ring.c @@ -326,7 +326,6 @@ do_eth_dev_ring_create(const char *name, data->all_multicast = 1; eth_dev->dev_ops = &ops; - data->kdrv = RTE_KDRV_NONE; data->numa_node = numa_node; /* finally assign rx and tx ops */ diff --git a/drivers/net/softnic/rte_eth_softnic.c b/drivers/net/softnic/rte_eth_softnic.c index 866d17a93c..e453fd1486 100644 --- a/drivers/net/softnic/rte_eth_softnic.c +++ b/drivers/net/softnic/rte_eth_softnic.c @@ -391,7 +391,6 @@ pmd_ethdev_register(struct rte_vdev_device *vdev, dev->data->dev_link.link_status = ETH_LINK_DOWN; dev->data->mac_addrs = ð_addr; dev->data->promiscuous = 1; - dev->data->kdrv = RTE_KDRV_NONE; dev->data->numa_node = params->cpu_id; rte_eth_dev_probing_finish(dev); diff --git a/lib/librte_ethdev/rte_ethdev_core.h b/lib/librte_ethdev/rte_ethdev_core.h index 32407dd418..78c7902897 100644 --- a/lib/librte_ethdev/rte_ethdev_core.h +++ b/lib/librte_ethdev/rte_ethdev_core.h @@ -866,7 +866,6 @@ struct rte_eth_dev_data { uint8_t tx_queue_state[RTE_MAX_QUEUES_PER_PORT]; /**< Queues state: HAIRPIN(2) / STARTED(1) / STOPPED(0). */ uint32_t dev_flags; /**< Capabilities. */ - enum rte_kernel_driver kdrv; /**< Kernel driver passthrough. */ int numa_node; /**< NUMA node connection. */ struct rte_vlan_filter_conf vlan_filter_conf; /**< VLAN filter configuration. */ diff --git a/lib/librte_ethdev/rte_ethdev_pci.h b/lib/librte_ethdev/rte_ethdev_pci.h index a999602fdd..6ac6ea41f5 100644 --- a/lib/librte_ethdev/rte_ethdev_pci.h +++ b/lib/librte_ethdev/rte_ethdev_pci.h @@ -67,7 +67,6 @@ rte_eth_copy_pci_info(struct rte_eth_dev *eth_dev, if (pci_dev->driver->drv_flags & RTE_PCI_DRV_INTR_RMV) eth_dev->data->dev_flags |= RTE_ETH_DEV_INTR_RMV; - eth_dev->data->kdrv = pci_dev->kdrv; eth_dev->data->numa_node = pci_dev->device.numa_node; } } diff --git a/lib/librte_ethdev/rte_ethdev_vdev.h b/lib/librte_ethdev/rte_ethdev_vdev.h index b3ef12398e..64fa689ed3 100644 --- a/lib/librte_ethdev/rte_ethdev_vdev.h +++ b/lib/librte_ethdev/rte_ethdev_vdev.h @@ -74,7 +74,6 @@ rte_eth_vdev_allocate(struct rte_vdev_device *dev, size_t private_data_size) eth_dev->device = &dev->device; eth_dev->intr_handle = NULL; - eth_dev->data->kdrv = RTE_KDRV_NONE; eth_dev->data->numa_node = dev->device.numa_node; return eth_dev; } From patchwork Thu Sep 17 11:28:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 78043 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id C06E9A04AF; Thu, 17 Sep 2020 13:29:13 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 003871D61A; Thu, 17 Sep 2020 13:29:02 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by dpdk.org (Postfix) with ESMTP id D155A1D61A for ; Thu, 17 Sep 2020 13:29:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600342140; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=IU3PJq+4wN36ZD49qfH+OoVpwtpade9XSrrH/1rmA+8=; b=eTHJKkCaWg3Dn/6FghUwqIEX9/X7y6joX8Ha/FfKOstPb3i+/U9iYMkCTcn9QjrhYrDDco H63cO6eVKRNRAeknYTJpJmOEOQkFV5bMGEbT16XhWy6lTMZ9f4y9+EbE7S0zNxZoiPugRy F5DVMbHktPqpzNr/OuzNedv9/DOUxBA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-27-IVMZWG4TNQqt5WpJEyn8EA-1; Thu, 17 Sep 2020 07:28:57 -0400 X-MC-Unique: IVMZWG4TNQqt5WpJEyn8EA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5025464089; Thu, 17 Sep 2020 11:28:54 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.193.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0AD7D5DEB8; Thu, 17 Sep 2020 11:28:44 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: arybchenko@solarflare.com, Ray Kinsella , Neil Horman , John McNamara , Marko Kovacevic , Ferruh Yigit , Ziyang Xuan , Xiaoyun Wang , Guoyang Zhou , "Wei Hu (Xavier)" , "Min Hu (Connor)" , Yisen Zhuang , Shijith Thotton , Srisivasubramanian Srinivasan , Heinrich Kuhn , Maxime Coquelin , Chenbo Xia , Zhihong Wang Date: Thu, 17 Sep 2020 13:28:19 +0200 Message-Id: <20200917112823.10534-3-david.marchand@redhat.com> In-Reply-To: <20200917112823.10534-1-david.marchand@redhat.com> References: <20200914081727.12215-1-david.marchand@redhat.com> <20200917112823.10534-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH v3 2/6] bus/pci: switch to private kernel driver enum 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" The rte_kernel_driver enum actually only pointed at PCI drivers and is only used in the PCI subsystem. Remove it from the generic device API and use a private enum in the PCI code. Signed-off-by: David Marchand Acked-by: Andrew Rybchenko --- doc/guides/rel_notes/deprecation.rst | 4 -- doc/guides/rel_notes/release_20_11.rst | 3 ++ drivers/bus/pci/bsd/pci.c | 17 ++++--- drivers/bus/pci/linux/pci.c | 64 ++++++++++++------------- drivers/bus/pci/linux/pci_uio.c | 2 +- drivers/bus/pci/pci_common.c | 16 +++---- drivers/bus/pci/rte_bus_pci.h | 11 ++++- drivers/bus/pci/windows/pci.c | 6 +-- drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +- drivers/net/hns3/hns3_ethdev_vf.c | 4 +- drivers/net/liquidio/lio_ethdev.c | 4 +- drivers/net/nfp/nfp_net.c | 2 +- drivers/net/virtio/virtio_pci.c | 2 +- lib/librte_eal/include/rte_dev.h | 12 ----- 14 files changed, 72 insertions(+), 77 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 394b55d8ca..83ba567632 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -124,10 +124,6 @@ Deprecation Notices With this removal, there won't be a need for the mentioned workaround which will be reverted. -* pci: The ``rte_kernel_driver`` enum defined in rte_dev.h will be made private - to the PCI subsystem as it is used only by the PCI bus driver and PCI - drivers. - * mbuf: Some fields will be converted to dynamic API in DPDK 20.11 in order to reserve more space for the dynamic fields, as explained in `this presentation `_. diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index 684da5157d..a76e7a2941 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -87,6 +87,9 @@ API Changes * eal: The ``rte_logs`` struct and global symbol was made private and is no longer part of the API. +* pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and + replaced with a private enum in the PCI subsystem. + * mbuf: Removed the unioned field ``refcnt_atomic`` from the structures ``rte_mbuf`` and ``rte_mbuf_ext_shared_info``. The field ``refcnt`` is remaining from the old unions. diff --git a/drivers/bus/pci/bsd/pci.c b/drivers/bus/pci/bsd/pci.c index 6ec27b4b5b..a07fc241fe 100644 --- a/drivers/bus/pci/bsd/pci.c +++ b/drivers/bus/pci/bsd/pci.c @@ -65,7 +65,7 @@ rte_pci_map_device(struct rte_pci_device *dev) /* try mapping the NIC resources */ switch (dev->kdrv) { - case RTE_KDRV_NIC_UIO: + case RTE_PCI_KDRV_NIC_UIO: /* map resources for devices that use uio */ ret = pci_uio_map_resource(dev); break; @@ -85,7 +85,7 @@ rte_pci_unmap_device(struct rte_pci_device *dev) { /* try unmapping the NIC resources */ switch (dev->kdrv) { - case RTE_KDRV_NIC_UIO: + case RTE_PCI_KDRV_NIC_UIO: /* unmap resources for devices that use uio */ pci_uio_unmap_resource(dev); break; @@ -255,7 +255,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) pci_name_set(dev); /* FreeBSD has only one pass through driver */ - dev->kdrv = RTE_KDRV_NIC_UIO; + dev->kdrv = RTE_PCI_KDRV_NIC_UIO; /* parse resources */ switch (conf->pc_hdr & PCIM_HDRTYPE) { @@ -395,8 +395,7 @@ enum rte_iova_mode pci_device_iova_mode(const struct rte_pci_driver *pdrv __rte_unused, const struct rte_pci_device *pdev) { - /* Supports only RTE_KDRV_NIC_UIO */ - if (pdev->kdrv != RTE_KDRV_NIC_UIO) + if (pdev->kdrv != RTE_PCI_KDRV_NIC_UIO) RTE_LOG(DEBUG, EAL, "Unsupported kernel driver? Defaulting to IOVA as 'PA'\n"); return RTE_IOVA_PA; @@ -548,7 +547,7 @@ rte_pci_ioport_map(struct rte_pci_device *dev, int bar, switch (dev->kdrv) { #if defined(RTE_ARCH_X86) - case RTE_KDRV_NIC_UIO: + case RTE_PCI_KDRV_NIC_UIO: if (rte_eal_iopl_init() != 0) { RTE_LOG(ERR, EAL, "%s(): insufficient ioport permissions for PCI device %s\n", __func__, dev->name); @@ -606,7 +605,7 @@ rte_pci_ioport_read(struct rte_pci_ioport *p, void *data, size_t len, off_t offset) { switch (p->dev->kdrv) { - case RTE_KDRV_NIC_UIO: + case RTE_PCI_KDRV_NIC_UIO: pci_uio_ioport_read(p, data, len, offset); break; default: @@ -648,7 +647,7 @@ rte_pci_ioport_write(struct rte_pci_ioport *p, const void *data, size_t len, off_t offset) { switch (p->dev->kdrv) { - case RTE_KDRV_NIC_UIO: + case RTE_PCI_KDRV_NIC_UIO: pci_uio_ioport_write(p, data, len, offset); break; default: @@ -663,7 +662,7 @@ rte_pci_ioport_unmap(struct rte_pci_ioport *p) switch (p->dev->kdrv) { #if defined(RTE_ARCH_X86) - case RTE_KDRV_NIC_UIO: + case RTE_PCI_KDRV_NIC_UIO: ret = 0; break; #endif diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c index a2198abf43..bf275947f4 100644 --- a/drivers/bus/pci/linux/pci.c +++ b/drivers/bus/pci/linux/pci.c @@ -68,14 +68,14 @@ rte_pci_map_device(struct rte_pci_device *dev) /* try mapping the NIC resources using VFIO if it exists */ switch (dev->kdrv) { - case RTE_KDRV_VFIO: + case RTE_PCI_KDRV_VFIO: #ifdef VFIO_PRESENT if (pci_vfio_is_enabled()) ret = pci_vfio_map_resource(dev); #endif break; - case RTE_KDRV_IGB_UIO: - case RTE_KDRV_UIO_GENERIC: + case RTE_PCI_KDRV_IGB_UIO: + case RTE_PCI_KDRV_UIO_GENERIC: if (rte_eal_using_phys_addrs()) { /* map resources for devices that use uio */ ret = pci_uio_map_resource(dev); @@ -97,14 +97,14 @@ rte_pci_unmap_device(struct rte_pci_device *dev) { /* try unmapping the NIC resources using VFIO if it exists */ switch (dev->kdrv) { - case RTE_KDRV_VFIO: + case RTE_PCI_KDRV_VFIO: #ifdef VFIO_PRESENT if (pci_vfio_is_enabled()) pci_vfio_unmap_resource(dev); #endif break; - case RTE_KDRV_IGB_UIO: - case RTE_KDRV_UIO_GENERIC: + case RTE_PCI_KDRV_IGB_UIO: + case RTE_PCI_KDRV_UIO_GENERIC: /* unmap resources for devices that use uio */ pci_uio_unmap_resource(dev); break; @@ -323,15 +323,15 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) if (!ret) { if (!strcmp(driver, "vfio-pci")) - dev->kdrv = RTE_KDRV_VFIO; + dev->kdrv = RTE_PCI_KDRV_VFIO; else if (!strcmp(driver, "igb_uio")) - dev->kdrv = RTE_KDRV_IGB_UIO; + dev->kdrv = RTE_PCI_KDRV_IGB_UIO; else if (!strcmp(driver, "uio_pci_generic")) - dev->kdrv = RTE_KDRV_UIO_GENERIC; + dev->kdrv = RTE_PCI_KDRV_UIO_GENERIC; else - dev->kdrv = RTE_KDRV_UNKNOWN; + dev->kdrv = RTE_PCI_KDRV_UNKNOWN; } else { - dev->kdrv = RTE_KDRV_NONE; + dev->kdrv = RTE_PCI_KDRV_NONE; return 0; } /* device is valid, add in list (sorted) */ @@ -608,7 +608,7 @@ pci_device_iova_mode(const struct rte_pci_driver *pdrv, enum rte_iova_mode iova_mode = RTE_IOVA_DC; switch (pdev->kdrv) { - case RTE_KDRV_VFIO: { + case RTE_PCI_KDRV_VFIO: { #ifdef VFIO_PRESENT static int is_vfio_noiommu_enabled = -1; @@ -626,8 +626,8 @@ pci_device_iova_mode(const struct rte_pci_driver *pdrv, break; } - case RTE_KDRV_IGB_UIO: - case RTE_KDRV_UIO_GENERIC: + case RTE_PCI_KDRV_IGB_UIO: + case RTE_PCI_KDRV_UIO_GENERIC: iova_mode = RTE_IOVA_PA; break; @@ -647,11 +647,11 @@ int rte_pci_read_config(const struct rte_pci_device *device, const struct rte_intr_handle *intr_handle = &device->intr_handle; switch (device->kdrv) { - case RTE_KDRV_IGB_UIO: - case RTE_KDRV_UIO_GENERIC: + case RTE_PCI_KDRV_IGB_UIO: + case RTE_PCI_KDRV_UIO_GENERIC: return pci_uio_read_config(intr_handle, buf, len, offset); #ifdef VFIO_PRESENT - case RTE_KDRV_VFIO: + case RTE_PCI_KDRV_VFIO: return pci_vfio_read_config(intr_handle, buf, len, offset); #endif default: @@ -671,11 +671,11 @@ int rte_pci_write_config(const struct rte_pci_device *device, const struct rte_intr_handle *intr_handle = &device->intr_handle; switch (device->kdrv) { - case RTE_KDRV_IGB_UIO: - case RTE_KDRV_UIO_GENERIC: + case RTE_PCI_KDRV_IGB_UIO: + case RTE_PCI_KDRV_UIO_GENERIC: return pci_uio_write_config(intr_handle, buf, len, offset); #ifdef VFIO_PRESENT - case RTE_KDRV_VFIO: + case RTE_PCI_KDRV_VFIO: return pci_vfio_write_config(intr_handle, buf, len, offset); #endif default: @@ -760,15 +760,15 @@ rte_pci_ioport_map(struct rte_pci_device *dev, int bar, switch (dev->kdrv) { #ifdef VFIO_PRESENT - case RTE_KDRV_VFIO: + case RTE_PCI_KDRV_VFIO: if (pci_vfio_is_enabled()) ret = pci_vfio_ioport_map(dev, bar, p); break; #endif - case RTE_KDRV_IGB_UIO: + case RTE_PCI_KDRV_IGB_UIO: ret = pci_uio_ioport_map(dev, bar, p); break; - case RTE_KDRV_UIO_GENERIC: + case RTE_PCI_KDRV_UIO_GENERIC: #if defined(RTE_ARCH_X86) ret = pci_ioport_map(dev, bar, p); #else @@ -791,14 +791,14 @@ rte_pci_ioport_read(struct rte_pci_ioport *p, { switch (p->dev->kdrv) { #ifdef VFIO_PRESENT - case RTE_KDRV_VFIO: + case RTE_PCI_KDRV_VFIO: pci_vfio_ioport_read(p, data, len, offset); break; #endif - case RTE_KDRV_IGB_UIO: + case RTE_PCI_KDRV_IGB_UIO: pci_uio_ioport_read(p, data, len, offset); break; - case RTE_KDRV_UIO_GENERIC: + case RTE_PCI_KDRV_UIO_GENERIC: pci_uio_ioport_read(p, data, len, offset); break; default: @@ -812,14 +812,14 @@ rte_pci_ioport_write(struct rte_pci_ioport *p, { switch (p->dev->kdrv) { #ifdef VFIO_PRESENT - case RTE_KDRV_VFIO: + case RTE_PCI_KDRV_VFIO: pci_vfio_ioport_write(p, data, len, offset); break; #endif - case RTE_KDRV_IGB_UIO: + case RTE_PCI_KDRV_IGB_UIO: pci_uio_ioport_write(p, data, len, offset); break; - case RTE_KDRV_UIO_GENERIC: + case RTE_PCI_KDRV_UIO_GENERIC: pci_uio_ioport_write(p, data, len, offset); break; default: @@ -834,15 +834,15 @@ rte_pci_ioport_unmap(struct rte_pci_ioport *p) switch (p->dev->kdrv) { #ifdef VFIO_PRESENT - case RTE_KDRV_VFIO: + case RTE_PCI_KDRV_VFIO: if (pci_vfio_is_enabled()) ret = pci_vfio_ioport_unmap(p); break; #endif - case RTE_KDRV_IGB_UIO: + case RTE_PCI_KDRV_IGB_UIO: ret = pci_uio_ioport_unmap(p); break; - case RTE_KDRV_UIO_GENERIC: + case RTE_PCI_KDRV_UIO_GENERIC: #if defined(RTE_ARCH_X86) ret = 0; #else diff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c index 097dc19225..a354920d5f 100644 --- a/drivers/bus/pci/linux/pci_uio.c +++ b/drivers/bus/pci/linux/pci_uio.c @@ -248,7 +248,7 @@ pci_uio_alloc_resource(struct rte_pci_device *dev, goto error; } - if (dev->kdrv == RTE_KDRV_IGB_UIO) + if (dev->kdrv == RTE_PCI_KDRV_IGB_UIO) dev->intr_handle.type = RTE_INTR_HANDLE_UIO; else { dev->intr_handle.type = RTE_INTR_HANDLE_UIO_INTX; diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c index a8e5fd52c1..dddf2b2aad 100644 --- a/drivers/bus/pci/pci_common.c +++ b/drivers/bus/pci/pci_common.c @@ -465,7 +465,7 @@ pci_hot_unplug_handler(struct rte_device *dev) switch (pdev->kdrv) { #ifdef HAVE_VFIO_DEV_REQ_INTERFACE - case RTE_KDRV_VFIO: + case RTE_PCI_KDRV_VFIO: /* * vfio kernel module guaranty the pci device would not be * deleted until the user space release the resource, so no @@ -476,9 +476,9 @@ pci_hot_unplug_handler(struct rte_device *dev) RTE_DEV_EVENT_REMOVE); break; #endif - case RTE_KDRV_IGB_UIO: - case RTE_KDRV_UIO_GENERIC: - case RTE_KDRV_NIC_UIO: + case RTE_PCI_KDRV_IGB_UIO: + case RTE_PCI_KDRV_UIO_GENERIC: + case RTE_PCI_KDRV_NIC_UIO: /* BARs resource is invalid, remap it to be safe. */ ret = pci_uio_remap_resource(pdev); break; @@ -552,7 +552,7 @@ pci_dma_map(struct rte_device *dev, void *addr, uint64_t iova, size_t len) * In case driver don't provides any specific mapping * try fallback to VFIO. */ - if (pdev->kdrv == RTE_KDRV_VFIO) + if (pdev->kdrv == RTE_PCI_KDRV_VFIO) return rte_vfio_container_dma_map (RTE_VFIO_DEFAULT_CONTAINER_FD, (uintptr_t)addr, iova, len); @@ -575,7 +575,7 @@ pci_dma_unmap(struct rte_device *dev, void *addr, uint64_t iova, size_t len) * In case driver don't provides any specific mapping * try fallback to VFIO. */ - if (pdev->kdrv == RTE_KDRV_VFIO) + if (pdev->kdrv == RTE_PCI_KDRV_VFIO) return rte_vfio_container_dma_unmap (RTE_VFIO_DEFAULT_CONTAINER_FD, (uintptr_t)addr, iova, len); @@ -622,8 +622,8 @@ rte_pci_get_iommu_class(void) iommu_no_va = pci_device_iommu_support_va(dev) ? 0 : 1; - if (dev->kdrv == RTE_KDRV_UNKNOWN || - dev->kdrv == RTE_KDRV_NONE) + if (dev->kdrv == RTE_PCI_KDRV_UNKNOWN || + dev->kdrv == RTE_PCI_KDRV_NONE) continue; FOREACH_DRIVER_ON_PCIBUS(drv) { enum rte_iova_mode dev_iova_mode; diff --git a/drivers/bus/pci/rte_bus_pci.h b/drivers/bus/pci/rte_bus_pci.h index 29bea6d70d..ff6f072470 100644 --- a/drivers/bus/pci/rte_bus_pci.h +++ b/drivers/bus/pci/rte_bus_pci.h @@ -51,6 +51,15 @@ 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, +}; + /** * A structure describing a PCI device. */ @@ -64,7 +73,7 @@ struct rte_pci_device { struct rte_intr_handle intr_handle; /**< Interrupt handle */ struct rte_pci_driver *driver; /**< PCI driver used in probing */ uint16_t max_vfs; /**< sriov enable if not zero */ - enum rte_kernel_driver kdrv; /**< Kernel driver passthrough */ + enum rte_pci_kernel_driver kdrv; /**< Kernel driver passthrough */ char name[PCI_PRI_STR_SIZE+1]; /**< PCI location (ASCII) */ struct rte_intr_handle vfio_req_intr_handle; /**< Handler of VFIO request interrupt */ diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c index c80bd55716..9e5c8fafb0 100644 --- a/drivers/bus/pci/windows/pci.c +++ b/drivers/bus/pci/windows/pci.c @@ -211,7 +211,7 @@ get_device_resource_info(HDEVINFO dev_info, BOOL res; switch (dev->kdrv) { - case RTE_KDRV_NONE: + case RTE_PCI_KDRV_NONE: /* Get NUMA node using DEVPKEY_Device_Numa_Node */ res = SetupDiGetDevicePropertyW(dev_info, dev_info_data, &DEVPKEY_Device_Numa_Node, &property_type, @@ -223,7 +223,7 @@ get_device_resource_info(HDEVINFO dev_info, return -1; } dev->device.numa_node = numa_node; - /* mem_resource - Unneeded for RTE_KDRV_NONE */ + /* mem_resource - Unneeded for RTE_PCI_KDRV_NONE */ dev->mem_resource[0].phys_addr = 0; dev->mem_resource[0].len = 0; dev->mem_resource[0].addr = NULL; @@ -292,7 +292,7 @@ get_kernel_driver_type(struct rte_pci_device *dev) * If another kernel driver is supported the relevant checking * functions should be here */ - dev->kdrv = RTE_KDRV_NONE; + dev->kdrv = RTE_PCI_KDRV_NONE; } static int diff --git a/drivers/net/hinic/base/hinic_pmd_hwif.c b/drivers/net/hinic/base/hinic_pmd_hwif.c index d7fc1af707..26fa1e27d4 100644 --- a/drivers/net/hinic/base/hinic_pmd_hwif.c +++ b/drivers/net/hinic/base/hinic_pmd_hwif.c @@ -280,7 +280,7 @@ void hinic_set_msix_state(void *hwdev, u16 msix_idx, enum hinic_msix_state flag) /* vfio-pci does not mmap msi-x vector table to user space, * we can not access the space when kernel driver is vfio-pci */ - if (hw->pcidev_hdl->kdrv == RTE_KDRV_VFIO) + if (hw->pcidev_hdl->kdrv == RTE_PCI_KDRV_VFIO) return; mask_bits = readl(hwif->intr_regs_base + offset); diff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c index 1d2941f0e3..63089d0bd4 100644 --- a/drivers/net/hns3/hns3_ethdev_vf.c +++ b/drivers/net/hns3/hns3_ethdev_vf.c @@ -2425,8 +2425,8 @@ hns3vf_reinit_dev(struct hns3_adapter *hns) * UIO enables msix by writing the pcie configuration space * vfio_pci enables msix in rte_intr_enable. */ - if (pci_dev->kdrv == RTE_KDRV_IGB_UIO || - pci_dev->kdrv == RTE_KDRV_UIO_GENERIC) { + if (pci_dev->kdrv == RTE_PCI_KDRV_IGB_UIO || + pci_dev->kdrv == RTE_PCI_KDRV_UIO_GENERIC) { if (hns3vf_enable_msix(pci_dev, true)) hns3_err(hw, "Failed to enable msix"); } diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c index 2258838c4c..2c2b27e62a 100644 --- a/drivers/net/liquidio/lio_ethdev.c +++ b/drivers/net/liquidio/lio_ethdev.c @@ -1563,7 +1563,7 @@ lio_dev_close(struct rte_eth_dev *eth_dev) /* Reset ioq regs */ lio_dev->fn_list.setup_device_regs(lio_dev); - if (lio_dev->pci_dev->kdrv == RTE_KDRV_IGB_UIO) { + if (lio_dev->pci_dev->kdrv == RTE_PCI_KDRV_IGB_UIO) { cn23xx_vf_ask_pf_to_do_flr(lio_dev); rte_delay_ms(LIO_PCI_FLR_WAIT); } @@ -2012,7 +2012,7 @@ lio_first_time_init(struct lio_device *lio_dev, goto error; /* Request and wait for device reset. */ - if (pdev->kdrv == RTE_KDRV_IGB_UIO) { + if (pdev->kdrv == RTE_PCI_KDRV_IGB_UIO) { cn23xx_vf_ask_pf_to_do_flr(lio_dev); /* FLR wait time doubled as a precaution. */ rte_delay_ms(LIO_PCI_FLR_WAIT * 2); diff --git a/drivers/net/nfp/nfp_net.c b/drivers/net/nfp/nfp_net.c index 99946279db..1cf949a9ab 100644 --- a/drivers/net/nfp/nfp_net.c +++ b/drivers/net/nfp/nfp_net.c @@ -3614,7 +3614,7 @@ static int nfp_pf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, * interface. Here we avoid this telling to the CPP init code to * use a lock file if UIO is being used. */ - if (dev->kdrv == RTE_KDRV_VFIO) + if (dev->kdrv == RTE_PCI_KDRV_VFIO) cpp = nfp_cpp_from_device_name(dev, 0); else cpp = nfp_cpp_from_device_name(dev, 1); diff --git a/drivers/net/virtio/virtio_pci.c b/drivers/net/virtio/virtio_pci.c index 29a354bf76..9915eabf68 100644 --- a/drivers/net/virtio/virtio_pci.c +++ b/drivers/net/virtio/virtio_pci.c @@ -704,7 +704,7 @@ vtpci_init(struct rte_pci_device *dev, struct virtio_hw *hw) PMD_INIT_LOG(INFO, "trying with legacy virtio pci."); if (rte_pci_ioport_map(dev, 0, VTPCI_IO(hw)) < 0) { rte_pci_unmap_device(dev); - if (dev->kdrv == RTE_KDRV_UNKNOWN && + if (dev->kdrv == RTE_PCI_KDRV_UNKNOWN && (!dev->device.devargs || dev->device.devargs->bus != rte_bus_find_by_name("pci"))) { diff --git a/lib/librte_eal/include/rte_dev.h b/lib/librte_eal/include/rte_dev.h index c8d985fb5c..53c8bc6fab 100644 --- a/lib/librte_eal/include/rte_dev.h +++ b/lib/librte_eal/include/rte_dev.h @@ -54,18 +54,6 @@ typedef void (*rte_dev_event_cb_fn)(const char *device_name, return; \ } while (0) -/** - * Device driver. - */ -enum rte_kernel_driver { - RTE_KDRV_UNKNOWN = 0, - RTE_KDRV_IGB_UIO, - RTE_KDRV_VFIO, - RTE_KDRV_UIO_GENERIC, - RTE_KDRV_NIC_UIO, - RTE_KDRV_NONE, -}; - /** * Device policies. */ From patchwork Thu Sep 17 11:28:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 78046 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 695ACA04AF; Thu, 17 Sep 2020 13:29:44 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 667D81D63F; Thu, 17 Sep 2020 13:29:13 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id B21341D638 for ; Thu, 17 Sep 2020 13:29:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600342149; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=OW1t+ujpJGxPo2IFyVhUtY2BePUCh18tkEKfUjoh4gg=; b=GssYnJdYEGYIy/UiQIe7z9v4GAG4vLkoie7kd1ZJYkKkFPUbIn6QbLs5QyNgCguj6yCHvu 3sc+jYeh8Z4Bf+d96HNgGR14XkmSf6NKR6MEE2qkNnlGwwW3DoCJeM2U3Xo5GPUX4o96Bp XjWFcRyn+kcOCY+nZmlM2PF0iq2Dew8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-230-LIVoNymAM-izrBzXtTt24w-1; Thu, 17 Sep 2020 07:28:59 -0400 X-MC-Unique: LIVoNymAM-izrBzXtTt24w-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C70416408A; Thu, 17 Sep 2020 11:28:57 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.193.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id F1BC85DEBB; Thu, 17 Sep 2020 11:28:54 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: arybchenko@solarflare.com, Ray Kinsella , Neil Horman , John McNamara , Marko Kovacevic , Ferruh Yigit , Gaetan Rivet Date: Thu, 17 Sep 2020 13:28:20 +0200 Message-Id: <20200917112823.10534-4-david.marchand@redhat.com> In-Reply-To: <20200917112823.10534-1-david.marchand@redhat.com> References: <20200914081727.12215-1-david.marchand@redhat.com> <20200917112823.10534-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH v3 3/6] pci: move resource mapping to the PCI bus 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" As reported during 20.08 work for Windows, the pci_map_resource API was built with the assumption that its flags would be passed to mmap(). This introduced a regression when adding the rte_mem_map API as reported in the workaround commit 9d2b24593724 ("pci: keep API compatibility with mmap values"). This API was only used in the PCI bus code, so move it there. There is no code change happening during the move. The only change is in the pci_map_resource description where the additional flags are now documented as rte_mem_map API flags: - * The additional flags for the mapping range. + * The additional rte_mem_map() flags for the mapping range. Signed-off-by: David Marchand Acked-by: Andrew Rybchenko Acked-by: Ray Kinsella --- doc/guides/rel_notes/deprecation.rst | 11 ----- doc/guides/rel_notes/release_20_11.rst | 6 +++ drivers/bus/pci/linux/pci_init.h | 2 + drivers/bus/pci/linux/pci_uio.c | 1 + drivers/bus/pci/pci_common.c | 41 ++++++++++++++++ drivers/bus/pci/private.h | 65 +++++++++++++++++++++++++ lib/librte_pci/rte_pci.c | 42 ---------------- lib/librte_pci/rte_pci.h | 66 -------------------------- lib/librte_pci/rte_pci_version.map | 2 - 9 files changed, 115 insertions(+), 121 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 83ba567632..8fca461045 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -113,17 +113,6 @@ Deprecation Notices us extending existing enum/define. One solution can be using a fixed size array instead of ``.*MAX.*`` value. -* pci: The PCI resources map API (``pci_map_resource`` and - ``pci_unmap_resource``) was not abstracting the Unix mmap flags (see the - workaround for Windows support implemented in the commit - 9d2b24593724 ("pci: keep API compatibility with mmap values")). - This API will be removed from the public API in 20.11 and moved to the PCI - bus driver along with the PCI resources lists and associated structures - (``pci_map``, ``pci_msix_table``, ``mapped_pci_resource`` and - ``mapped_pci_res_list``). - With this removal, there won't be a need for the mentioned workaround which - will be reverted. - * mbuf: Some fields will be converted to dynamic API in DPDK 20.11 in order to reserve more space for the dynamic fields, as explained in `this presentation `_. diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index a76e7a2941..185eeae731 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -90,6 +90,12 @@ API Changes * pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and replaced with a private enum in the PCI subsystem. +* pci: Removed the PCI resources map API from the public API + (``pci_map_resource`` and ``pci_unmap_resource``) and moved it to the + PCI bus driver along with the PCI resources lists and associated structures + (``pci_map``, ``pci_msix_table``, ``mapped_pci_resource`` and + ``mapped_pci_res_list``). + * mbuf: Removed the unioned field ``refcnt_atomic`` from the structures ``rte_mbuf`` and ``rte_mbuf_ext_shared_info``. The field ``refcnt`` is remaining from the old unions. diff --git a/drivers/bus/pci/linux/pci_init.h b/drivers/bus/pci/linux/pci_init.h index c2e603a374..dcea726186 100644 --- a/drivers/bus/pci/linux/pci_init.h +++ b/drivers/bus/pci/linux/pci_init.h @@ -7,6 +7,8 @@ #include +#include "private.h" + /** IO resource type: */ #define IORESOURCE_IO 0x00000100 #define IORESOURCE_MEM 0x00000200 diff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c index a354920d5f..9ab20a0b25 100644 --- a/drivers/bus/pci/linux/pci_uio.c +++ b/drivers/bus/pci/linux/pci_uio.c @@ -25,6 +25,7 @@ #include "eal_filesystem.h" #include "pci_init.h" +#include "private.h" void *pci_map_addr = NULL; diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c index dddf2b2aad..3a2ae07958 100644 --- a/drivers/bus/pci/pci_common.c +++ b/drivers/bus/pci/pci_common.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -79,6 +80,46 @@ pci_name_set(struct rte_pci_device *dev) dev->device.name = dev->name; } +/* map a particular resource from a file */ +void * +pci_map_resource(void *requested_addr, int fd, off_t offset, size_t size, + int additional_flags) +{ + void *mapaddr; + + /* Map the PCI memory resource of device */ + mapaddr = rte_mem_map(requested_addr, size, + RTE_PROT_READ | RTE_PROT_WRITE, + RTE_MAP_SHARED | additional_flags, fd, offset); + if (mapaddr == NULL) { + RTE_LOG(ERR, EAL, + "%s(): cannot map resource(%d, %p, 0x%zx, 0x%llx): %s (%p)\n", + __func__, fd, requested_addr, size, + (unsigned long long)offset, + rte_strerror(rte_errno), mapaddr); + mapaddr = MAP_FAILED; /* API uses mmap error code */ + } else + RTE_LOG(DEBUG, EAL, " PCI memory mapped at %p\n", mapaddr); + + return mapaddr; +} + +/* unmap a particular resource */ +void +pci_unmap_resource(void *requested_addr, size_t size) +{ + if (requested_addr == NULL) + return; + + /* Unmap the PCI memory resource of device */ + if (rte_mem_unmap(requested_addr, size)) { + RTE_LOG(ERR, EAL, "%s(): cannot mem unmap(%p, %#zx): %s\n", + __func__, requested_addr, size, + rte_strerror(rte_errno)); + } else + RTE_LOG(DEBUG, EAL, " PCI memory unmapped at %p\n", + requested_addr); +} /* * Match the PCI Driver and Device using the ID Table */ diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h index 367cdd9a65..7c89744b66 100644 --- a/drivers/bus/pci/private.h +++ b/drivers/bus/pci/private.h @@ -81,6 +81,71 @@ void rte_pci_insert_device(struct rte_pci_device *exist_pci_dev, */ int pci_update_device(const struct rte_pci_addr *addr); +/** + * A structure describing a PCI mapping. + */ +struct pci_map { + void *addr; + char *path; + uint64_t offset; + uint64_t size; + uint64_t phaddr; +}; + +struct pci_msix_table { + int bar_index; + uint32_t offset; + uint32_t size; +}; + +/** + * A structure describing a mapped PCI resource. + * For multi-process we need to reproduce all PCI mappings in secondary + * processes, so save them in a tailq. + */ +struct mapped_pci_resource { + TAILQ_ENTRY(mapped_pci_resource) next; + + struct rte_pci_addr pci_addr; + char path[PATH_MAX]; + int nb_maps; + struct pci_map maps[PCI_MAX_RESOURCE]; + struct pci_msix_table msix_table; +}; + +/** mapped pci device list */ +TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource); + +/** + * Map a particular resource from a file. + * + * @param requested_addr + * The starting address for the new mapping range. + * @param fd + * The file descriptor. + * @param offset + * The offset for the mapping range. + * @param size + * The size for the mapping range. + * @param additional_flags + * The additional rte_mem_map() flags for the mapping range. + * @return + * - On success, the function returns a pointer to the mapped area. + * - On error, MAP_FAILED is returned. + */ +void *pci_map_resource(void *requested_addr, int fd, off_t offset, + size_t size, int additional_flags); + +/** + * Unmap a particular resource. + * + * @param requested_addr + * The address for the unmapping range. + * @param size + * The size for the unmapping range. + */ +void pci_unmap_resource(void *requested_addr, size_t size); + /** * Map the PCI resource of a PCI device in virtual memory * diff --git a/lib/librte_pci/rte_pci.c b/lib/librte_pci/rte_pci.c index 1d1cbc75ac..c91be8b167 100644 --- a/lib/librte_pci/rte_pci.c +++ b/lib/librte_pci/rte_pci.c @@ -144,45 +144,3 @@ rte_pci_addr_parse(const char *str, struct rte_pci_addr *addr) return 0; return -1; } - - -/* map a particular resource from a file */ -void * -pci_map_resource(void *requested_addr, int fd, off_t offset, size_t size, - int additional_flags) -{ - void *mapaddr; - - /* Map the PCI memory resource of device */ - mapaddr = rte_mem_map(requested_addr, size, - RTE_PROT_READ | RTE_PROT_WRITE, - RTE_MAP_SHARED | additional_flags, fd, offset); - if (mapaddr == NULL) { - RTE_LOG(ERR, EAL, - "%s(): cannot map resource(%d, %p, 0x%zx, 0x%llx): %s (%p)\n", - __func__, fd, requested_addr, size, - (unsigned long long)offset, - rte_strerror(rte_errno), mapaddr); - mapaddr = MAP_FAILED; /* API uses mmap error code */ - } else - RTE_LOG(DEBUG, EAL, " PCI memory mapped at %p\n", mapaddr); - - return mapaddr; -} - -/* unmap a particular resource */ -void -pci_unmap_resource(void *requested_addr, size_t size) -{ - if (requested_addr == NULL) - return; - - /* Unmap the PCI memory resource of device */ - if (rte_mem_unmap(requested_addr, size)) { - RTE_LOG(ERR, EAL, "%s(): cannot mem unmap(%p, %#zx): %s\n", - __func__, requested_addr, size, - rte_strerror(rte_errno)); - } else - RTE_LOG(DEBUG, EAL, " PCI memory unmapped at %p\n", - requested_addr); -} diff --git a/lib/librte_pci/rte_pci.h b/lib/librte_pci/rte_pci.h index a03235da1f..567c8cd68d 100644 --- a/lib/librte_pci/rte_pci.h +++ b/lib/librte_pci/rte_pci.h @@ -64,42 +64,6 @@ struct rte_pci_addr { #define PCI_ANY_ID (0xffff) #define RTE_CLASS_ANY_ID (0xffffff) -/** - * A structure describing a PCI mapping. - */ -struct pci_map { - void *addr; - char *path; - uint64_t offset; - uint64_t size; - uint64_t phaddr; -}; - -struct pci_msix_table { - int bar_index; - uint32_t offset; - uint32_t size; -}; - -/** - * A structure describing a mapped PCI resource. - * For multi-process we need to reproduce all PCI mappings in secondary - * processes, so save them in a tailq. - */ -struct mapped_pci_resource { - TAILQ_ENTRY(mapped_pci_resource) next; - - struct rte_pci_addr pci_addr; - char path[PATH_MAX]; - int nb_maps; - struct pci_map maps[PCI_MAX_RESOURCE]; - struct pci_msix_table msix_table; -}; - - -/** mapped pci device list */ -TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource); - /** * Utility function to write a pci device name, this device name can later be * used to retrieve the corresponding rte_pci_addr using eal_parse_pci_* @@ -145,36 +109,6 @@ int rte_pci_addr_cmp(const struct rte_pci_addr *addr, */ int rte_pci_addr_parse(const char *str, struct rte_pci_addr *addr); -/** - * Map a particular resource from a file. - * - * @param requested_addr - * The starting address for the new mapping range. - * @param fd - * The file descriptor. - * @param offset - * The offset for the mapping range. - * @param size - * The size for the mapping range. - * @param additional_flags - * The additional flags for the mapping range. - * @return - * - On success, the function returns a pointer to the mapped area. - * - On error, MAP_FAILED is returned. - */ -void *pci_map_resource(void *requested_addr, int fd, off_t offset, - size_t size, int additional_flags); - -/** - * Unmap a particular resource. - * - * @param requested_addr - * The address for the unmapping range. - * @param size - * The size for the unmapping range. - */ -void pci_unmap_resource(void *requested_addr, size_t size); - #ifdef __cplusplus } #endif diff --git a/lib/librte_pci/rte_pci_version.map b/lib/librte_pci/rte_pci_version.map index cd77c9dc9e..1db19a5122 100644 --- a/lib/librte_pci/rte_pci_version.map +++ b/lib/librte_pci/rte_pci_version.map @@ -1,8 +1,6 @@ DPDK_21 { global: - pci_map_resource; - pci_unmap_resource; rte_pci_addr_cmp; rte_pci_addr_parse; rte_pci_device_name; From patchwork Thu Sep 17 11:28:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 78044 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 35FC4A04AF; Thu, 17 Sep 2020 13:29:25 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 469A61D62D; Thu, 17 Sep 2020 13:29:08 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 1F3E41D62C for ; Thu, 17 Sep 2020 13:29:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600342146; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=mTKhuOLBQkOMdBkoDPhIulnAocj4n1eUdrBgEBPSDcA=; b=RkAXGaeX6+yF9MS8aYr6yh1v2qfuKZ60D1nzZHvDJ6l4Bd8hzsEumM3BSoocuDerityztD rgzXTNvZSDapeWmEvPO9J6dXOTn+885APz9wv7LDInmhidnIXQoiYl4ygBeMzygKkFHt+a YrinLSntUnDX87pCMAYFeh9c3dtFDgo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-12-fhN8TAY_OUGTzold8S4MRw-1; Thu, 17 Sep 2020 07:29:02 -0400 X-MC-Unique: fhN8TAY_OUGTzold8S4MRw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 382DE6408A; Thu, 17 Sep 2020 11:29:01 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.193.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 620A55DA30; Thu, 17 Sep 2020 11:28:58 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: arybchenko@solarflare.com, Ferruh Yigit , Anatoly Burakov , Dmitry Kozlyuk , Narcisa Ana Maria Vasile , Dmitry Malloy , Pallavi Kadam Date: Thu, 17 Sep 2020 13:28:21 +0200 Message-Id: <20200917112823.10534-5-david.marchand@redhat.com> In-Reply-To: <20200917112823.10534-1-david.marchand@redhat.com> References: <20200914081727.12215-1-david.marchand@redhat.com> <20200917112823.10534-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH v3 4/6] mem: drop mapping API workaround 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" Now that the pci_map_resource API is private to the PCI bus, we can drop the compatibility workaround we had implemented in 20.08. Signed-off-by: David Marchand Acked-by: Andrew Rybchenko --- drivers/bus/pci/bsd/pci.c | 2 +- drivers/bus/pci/linux/pci_uio.c | 2 +- drivers/bus/pci/linux/pci_vfio.c | 4 ++-- drivers/bus/pci/pci_common.c | 1 - drivers/bus/pci/pci_common_uio.c | 2 +- drivers/bus/pci/private.h | 2 +- lib/librte_eal/include/rte_eal_paging.h | 10 ---------- lib/librte_eal/windows/include/rte_os.h | 6 ------ 8 files changed, 6 insertions(+), 23 deletions(-) diff --git a/drivers/bus/pci/bsd/pci.c b/drivers/bus/pci/bsd/pci.c index a07fc241fe..2ed8261349 100644 --- a/drivers/bus/pci/bsd/pci.c +++ b/drivers/bus/pci/bsd/pci.c @@ -192,7 +192,7 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx, mapaddr = pci_map_resource(NULL, fd, (off_t)offset, (size_t)dev->mem_resource[res_idx].len, 0); close(fd); - if (mapaddr == MAP_FAILED) + if (mapaddr == NULL) goto error; maps[map_idx].phaddr = dev->mem_resource[res_idx].phys_addr; diff --git a/drivers/bus/pci/linux/pci_uio.c b/drivers/bus/pci/linux/pci_uio.c index 9ab20a0b25..f3305a2f28 100644 --- a/drivers/bus/pci/linux/pci_uio.c +++ b/drivers/bus/pci/linux/pci_uio.c @@ -346,7 +346,7 @@ pci_uio_map_resource_by_index(struct rte_pci_device *dev, int res_idx, mapaddr = pci_map_resource(pci_map_addr, fd, 0, (size_t)dev->mem_resource[res_idx].len, 0); close(fd); - if (mapaddr == MAP_FAILED) + if (mapaddr == NULL) goto error; pci_map_addr = RTE_PTR_ADD(mapaddr, diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c index c15ed3bade..34b5da80df 100644 --- a/drivers/bus/pci/linux/pci_vfio.c +++ b/drivers/bus/pci/linux/pci_vfio.c @@ -565,7 +565,7 @@ pci_vfio_mmap_bar(int vfio_dev_fd, struct mapped_pci_resource *vfio_res, } /* if there's a second part, try to map it */ - if (map_addr != MAP_FAILED + if (map_addr != NULL && memreg[1].offset && memreg[1].size) { void *second_addr = RTE_PTR_ADD(bar_addr, (uintptr_t)(memreg[1].offset - @@ -577,7 +577,7 @@ pci_vfio_mmap_bar(int vfio_dev_fd, struct mapped_pci_resource *vfio_res, RTE_MAP_FORCE_ADDRESS); } - if (map_addr == NULL || map_addr == MAP_FAILED) { + if (map_addr == NULL) { munmap(bar_addr, bar->size); bar_addr = MAP_FAILED; RTE_LOG(ERR, EAL, "Failed to map pci BAR%d\n", diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c index 3a2ae07958..62d45041bb 100644 --- a/drivers/bus/pci/pci_common.c +++ b/drivers/bus/pci/pci_common.c @@ -97,7 +97,6 @@ pci_map_resource(void *requested_addr, int fd, off_t offset, size_t size, __func__, fd, requested_addr, size, (unsigned long long)offset, rte_strerror(rte_errno), mapaddr); - mapaddr = MAP_FAILED; /* API uses mmap error code */ } else RTE_LOG(DEBUG, EAL, " PCI memory mapped at %p\n", mapaddr); diff --git a/drivers/bus/pci/pci_common_uio.c b/drivers/bus/pci/pci_common_uio.c index f4dca9da91..793dfd0a7c 100644 --- a/drivers/bus/pci/pci_common_uio.c +++ b/drivers/bus/pci/pci_common_uio.c @@ -58,7 +58,7 @@ pci_uio_map_secondary(struct rte_pci_device *dev) "Cannot mmap device resource file %s to address: %p\n", uio_res->maps[i].path, uio_res->maps[i].addr); - if (mapaddr != MAP_FAILED) { + if (mapaddr != NULL) { /* unmap addrs correctly mapped */ for (j = 0; j < i; j++) pci_unmap_resource( diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h index 7c89744b66..fadc767236 100644 --- a/drivers/bus/pci/private.h +++ b/drivers/bus/pci/private.h @@ -131,7 +131,7 @@ TAILQ_HEAD(mapped_pci_res_list, mapped_pci_resource); * The additional rte_mem_map() flags for the mapping range. * @return * - On success, the function returns a pointer to the mapped area. - * - On error, MAP_FAILED is returned. + * - On error, NULL is returned. */ void *pci_map_resource(void *requested_addr, int fd, off_t offset, size_t size, int additional_flags); diff --git a/lib/librte_eal/include/rte_eal_paging.h b/lib/librte_eal/include/rte_eal_paging.h index 429f896c8c..ed98e70e9e 100644 --- a/lib/librte_eal/include/rte_eal_paging.h +++ b/lib/librte_eal/include/rte_eal_paging.h @@ -3,9 +3,6 @@ */ #include -#ifndef RTE_EXEC_ENV_WINDOWS -#include -#endif #include @@ -25,7 +22,6 @@ enum rte_mem_prot { /** Additional flags for memory mapping. */ enum rte_map_flags { -#ifdef RTE_EXEC_ENV_WINDOWS /** Changes to the mapped memory are visible to other processes. */ RTE_MAP_SHARED = 1 << 0, /** Mapping is not backed by a regular file. */ @@ -39,12 +35,6 @@ enum rte_map_flags { * it is not required to do so, thus mapping with this flag may fail. */ RTE_MAP_FORCE_ADDRESS = 1 << 3 -#else /* map mmap flags because they are exposed in pci_map_resource() API */ - RTE_MAP_SHARED = MAP_SHARED, - RTE_MAP_ANONYMOUS = MAP_ANONYMOUS, - RTE_MAP_PRIVATE = MAP_PRIVATE, - RTE_MAP_FORCE_ADDRESS = MAP_FIXED, -#endif }; /** diff --git a/lib/librte_eal/windows/include/rte_os.h b/lib/librte_eal/windows/include/rte_os.h index 2881bf2224..569ed92d51 100644 --- a/lib/librte_eal/windows/include/rte_os.h +++ b/lib/librte_eal/windows/include/rte_os.h @@ -25,12 +25,6 @@ extern "C" { #define PATH_MAX _MAX_PATH #endif -/* sys/mman.h - * The syscall mmap does not exist on Windows, - * but this error code is used in a badly defined DPDK API for PCI mapping. - */ -#define MAP_FAILED ((void *) -1) - #define sleep(x) Sleep(1000 * (x)) #define strerror_r(a, b, c) strerror_s(b, c, a) From patchwork Thu Sep 17 11:28:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 78045 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8693AA04AF; Thu, 17 Sep 2020 13:29:36 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 111981D634; Thu, 17 Sep 2020 13:29:12 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by dpdk.org (Postfix) with ESMTP id 7601F1D630 for ; Thu, 17 Sep 2020 13:29:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600342148; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iD7JlRKQcGgxWVv1elNX0ygp3o0NtVnuz01RZGYrQBo=; b=HcVID6TIo46QwsjEeuiQXozFVjrtKf8idz6LK7R/4W7fSAkFOmnYf7jAI/l2Ezgfq+BIJr JdMW+RTOcnC9JxL+WcTUURpFaCztqwjxM8Mguj17RMEOC95dK7gMBh7T7m4aDOV+dHpI7M qAekmP7VjalTzG6U1csB+6diVqNngN8= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-59-dlAvAeSjP1K46_ArRJcbhw-1; Thu, 17 Sep 2020 07:29:06 -0400 X-MC-Unique: dlAvAeSjP1K46_ArRJcbhw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6FD251008550; Thu, 17 Sep 2020 11:29:04 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.193.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 075395DA30; Thu, 17 Sep 2020 11:29:01 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: arybchenko@solarflare.com, Ray Kinsella , Neil Horman , John McNamara , Marko Kovacevic , Jianfeng Tan , Jeff Guo Date: Thu, 17 Sep 2020 13:28:22 +0200 Message-Id: <20200917112823.10534-6-david.marchand@redhat.com> In-Reply-To: <20200917112823.10534-1-david.marchand@redhat.com> References: <20200914081727.12215-1-david.marchand@redhat.com> <20200917112823.10534-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH v3 5/6] eal: hide internal device event structure 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" This structure is not used in the public API. Fixes: a753e53d517b ("eal: add device event monitor framework") Signed-off-by: David Marchand Acked-by: Jeff Guo Acked-by: Ray Kinsella --- doc/guides/rel_notes/deprecation.rst | 3 --- doc/guides/rel_notes/release_20_11.rst | 3 +++ lib/librte_eal/include/rte_dev.h | 6 ------ lib/librte_eal/linux/eal_dev.c | 6 ++++++ 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 8fca461045..3669d6533b 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -70,9 +70,6 @@ Deprecation Notices * eal: The function ``rte_eal_remote_launch`` will return new error codes after read or write error on the pipe, instead of calling ``rte_panic``. -* eal: The ``rte_dev_event`` structure will be made private to the EAL as no - public API makes use of it. - * rte_atomicNN_xxx: These APIs do not take memory order parameter. This does not allow for writing optimized code for all the CPU architectures supported in DPDK. DPDK will adopt C11 atomic operations semantics and provide wrappers diff --git a/doc/guides/rel_notes/release_20_11.rst b/doc/guides/rel_notes/release_20_11.rst index 185eeae731..e87509dfa7 100644 --- a/doc/guides/rel_notes/release_20_11.rst +++ b/doc/guides/rel_notes/release_20_11.rst @@ -87,6 +87,9 @@ API Changes * eal: The ``rte_logs`` struct and global symbol was made private and is no longer part of the API. +* eal: Made the ``rte_dev_event`` structure private to the EAL as no public API + used it. + * pci: Removed the ``rte_kernel_driver`` enum defined in rte_dev.h and replaced with a private enum in the PCI subsystem. diff --git a/lib/librte_eal/include/rte_dev.h b/lib/librte_eal/include/rte_dev.h index 53c8bc6fab..81905b3ae3 100644 --- a/lib/librte_eal/include/rte_dev.h +++ b/lib/librte_eal/include/rte_dev.h @@ -33,12 +33,6 @@ enum rte_dev_event_type { RTE_DEV_EVENT_MAX /**< max value of this enum */ }; -struct rte_dev_event { - enum rte_dev_event_type type; /**< device event type */ - int subsystem; /**< subsystem id */ - char *devname; /**< device name */ -}; - typedef void (*rte_dev_event_cb_fn)(const char *device_name, enum rte_dev_event_type event, void *cb_arg); diff --git a/lib/librte_eal/linux/eal_dev.c b/lib/librte_eal/linux/eal_dev.c index 83b6068264..2e15762b56 100644 --- a/lib/librte_eal/linux/eal_dev.c +++ b/lib/librte_eal/linux/eal_dev.c @@ -133,6 +133,12 @@ dev_uev_socket_fd_create(void) return ret; } +struct rte_dev_event { + enum rte_dev_event_type type; /**< device event type */ + int subsystem; /**< subsystem id */ + char *devname; /**< device name */ +}; + static int dev_uev_parse(const char *buf, struct rte_dev_event *event, int length) { From patchwork Thu Sep 17 11:28:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Marchand X-Patchwork-Id: 78047 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 97B7CA04AF; Thu, 17 Sep 2020 13:29:53 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C8FA81D64C; Thu, 17 Sep 2020 13:29:16 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by dpdk.org (Postfix) with ESMTP id 690661D629 for ; Thu, 17 Sep 2020 13:29:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1600342150; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HPnwboRc82/vFbThxSHSZoj5TuVIf1BLTwct0nQZHUs=; b=d3EZ8IBlJmA3Q6+nMor8NR3ZFSxxh5Os2JZYjj7BaA5sx9yEz3PN1Z3E3ll/4k++iLyIky AoJnkh2hR2j7aZyaFzLqeSMSa086ya9ekHpIUnXbGKen+qwtYzH5sooKq8Ky6X53p87Y0q p5bSKxtCGc41Z2vXlATdmN61+PRVQnk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-182-rhp_6rV4NKWSUYRAwNLHnA-1; Thu, 17 Sep 2020 07:29:08 -0400 X-MC-Unique: rhp_6rV4NKWSUYRAwNLHnA-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9B10B801AF2; Thu, 17 Sep 2020 11:29:07 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.193.44]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0C5795DA30; Thu, 17 Sep 2020 11:29:04 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: arybchenko@solarflare.com, stable@dpdk.org, Stephen Hemminger , Gaetan Rivet , Thomas Monjalon Date: Thu, 17 Sep 2020 13:28:23 +0200 Message-Id: <20200917112823.10534-7-david.marchand@redhat.com> In-Reply-To: <20200917112823.10534-1-david.marchand@redhat.com> References: <20200914081727.12215-1-david.marchand@redhat.com> <20200917112823.10534-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david.marchand@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [dpdk-dev] [PATCH v3 6/6] bus/pci: remove duplicate declaration 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" This declaration is the same as the one a few lines before. Fixes: 6844d146ff39 ("eal: add bus pointer in device structure") Cc: stable@dpdk.org Signed-off-by: David Marchand Acked-by: Andrew Rybchenko --- drivers/bus/pci/private.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h index fadc767236..16f997c701 100644 --- a/drivers/bus/pci/private.h +++ b/drivers/bus/pci/private.h @@ -15,8 +15,6 @@ extern struct rte_pci_bus rte_pci_bus; struct rte_pci_driver; struct rte_pci_device; -extern struct rte_pci_bus rte_pci_bus; - /** * Scan the content of the PCI bus, and the devices in the devices * list