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 8C8CFA054A; Mon, 5 Sep 2022 10:42:46 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C7E1E4282B; Mon, 5 Sep 2022 10:41:53 +0200 (CEST) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id F396942B82 for ; Mon, 5 Sep 2022 10:41:51 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1662367311; 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=z/Ytw/dsVnSEuVknuG6C/wm1CmmadHzuC5pI5HzSYTw=; b=VV2Wn5vvtOgiMFIdaCt1x10KVlrPU9RHQ1JP4gljS6i7dh0vtYxz8R9tlt10jtzkJ87Yvg WJ7WuKgqr0X/dkQC7mEbKYuHcpuzuOEz6hlwc5cd3hUzemy25TQUC2VyT4NICD5UdBvHH4 j25txQwXR1vLHeHOn1eYqOp/3c3+5lo= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-54-GRXTX2uaPWurlPgJTJqHWg-1; Mon, 05 Sep 2022 04:41:48 -0400 X-MC-Unique: GRXTX2uaPWurlPgJTJqHWg-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 34CA429AB3EF; Mon, 5 Sep 2022 08:41:48 +0000 (UTC) Received: from fchome.redhat.com (unknown [10.40.193.251]) by smtp.corp.redhat.com (Postfix) with ESMTP id EC8D62166B26; Mon, 5 Sep 2022 08:41:46 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, bruce.richardson@intel.com, Ray Kinsella , Maxime Coquelin , Chenbo Xia Subject: [PATCH v5 27/27] dev: hide device object Date: Mon, 5 Sep 2022 10:39:33 +0200 Message-Id: <20220905083933.2506819-28-david.marchand@redhat.com> In-Reply-To: <20220905083933.2506819-1-david.marchand@redhat.com> References: <20220628144643.1213026-1-david.marchand@redhat.com> <20220905083933.2506819-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true 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 Make rte_device opaque for non internal users. This will make extending this object possible without breaking the ABI. Some applications may have been dereferencing rte_device objects, mark this object's accessors as stable. Signed-off-by: David Marchand Acked-by: Bruce Richardson --- Changes since RFC v2: - updated release notes, - marked accessors as stable, --- doc/guides/rel_notes/deprecation.rst | 7 ----- doc/guides/rel_notes/release_22_11.rst | 4 +-- lib/eal/common/eal_private.h | 2 +- lib/eal/include/dev_driver.h | 13 +++++++++ lib/eal/include/rte_dev.h | 37 -------------------------- lib/eal/version.map | 14 +++++----- lib/vhost/vdpa.c | 1 + 7 files changed, 23 insertions(+), 55 deletions(-) diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 98a00da385..64668500c7 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -47,13 +47,6 @@ Deprecation Notices * mempool: The mempool API macros ``MEMPOOL_PG_*`` are deprecated and will be removed in DPDK 22.11. -* drivers: As a follow-up of the work on the ``rte_bus`` object, - the ``rte_driver`` and ``rte_device`` objects (and as a domino effect, - their bus-specific counterparts) will be made opaque in DPDK 22.11. - Registering a driver on a bus will be marked as an internal API: - external users may still register their drivers using the bus-specific - driver header (see ``enable_driver_sdk`` meson option). - * bus: The ``dev->device.numa_node`` field is set by each bus driver for every device it manages to indicate on which NUMA node this device lies. When this information is unknown, the assigned value is not consistent diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst index 4e20345b7a..43502349bd 100644 --- a/doc/guides/rel_notes/release_22_11.rst +++ b/doc/guides/rel_notes/release_22_11.rst @@ -98,8 +98,8 @@ API Changes ``vdev``, ``vmbus`` buses has been marked as an internal API. External users may still register their driver using the associated driver headers (see ``enable_driver_sdk`` meson option). - The ``rte_driver`` object is now opaque and must be manipulated through added - accessors. + The ``rte_driver`` and ``rte_device`` objects are now opaque and must be + manipulated through added accessors. * raw/ifgpa: The function ``rte_pmd_ifpga_get_pci_bus`` has been removed. diff --git a/lib/eal/common/eal_private.h b/lib/eal/common/eal_private.h index 44d14241f0..3ca9ce2ffc 100644 --- a/lib/eal/common/eal_private.h +++ b/lib/eal/common/eal_private.h @@ -10,7 +10,7 @@ #include #include -#include +#include #include #include diff --git a/lib/eal/include/dev_driver.h b/lib/eal/include/dev_driver.h index 015188abd5..5efa8c437e 100644 --- a/lib/eal/include/dev_driver.h +++ b/lib/eal/include/dev_driver.h @@ -21,6 +21,19 @@ struct rte_driver { const char *alias; /**< Driver alias. */ }; +/** + * A structure describing a generic device. + */ +struct rte_device { + RTE_TAILQ_ENTRY(rte_device) next; /**< Next device */ + const char *name; /**< Device name */ + const char *bus_info; /**< Device bus specific information */ + const struct rte_driver *driver; /**< Driver assigned after probing */ + const struct rte_bus *bus; /**< Bus handle assigned on scan */ + int numa_node; /**< NUMA node connection */ + struct rte_devargs *devargs; /**< Arguments for latest probing */ +}; + #ifdef __cplusplus } #endif diff --git a/lib/eal/include/rte_dev.h b/lib/eal/include/rte_dev.h index f010dd6441..dc1acc8953 100644 --- a/lib/eal/include/rte_dev.h +++ b/lib/eal/include/rte_dev.h @@ -86,90 +86,66 @@ rte_driver_name(const struct rte_driver *driver); /** * Retrieve a device bus. * - * @warning - * @b EXPERIMENTAL: this API may change without prior notice - * * @param dev * A pointer to a device structure. * @return * A pointer to this device bus. */ -__rte_experimental const struct rte_bus * rte_dev_bus(const struct rte_device *dev); /** * Retrieve bus specific information for a device. * - * @warning - * @b EXPERIMENTAL: this API may change without prior notice - * * @param dev * A pointer to a device structure. * @return * A string describing this device or NULL if none is available. */ -__rte_experimental const char * rte_dev_bus_info(const struct rte_device *dev); /** * Retrieve a device arguments. * - * @warning - * @b EXPERIMENTAL: this API may change without prior notice - * * @param dev * A pointer to a device structure. * @return * A pointer to this device devargs. */ -__rte_experimental const struct rte_devargs * rte_dev_devargs(const struct rte_device *dev); /** * Retrieve a device driver. * - * @warning - * @b EXPERIMENTAL: this API may change without prior notice - * * @param dev * A pointer to a device structure. * @return * A pointer to this device driver. */ -__rte_experimental const struct rte_driver * rte_dev_driver(const struct rte_device *dev); /** * Retrieve a device name. * - * @warning - * @b EXPERIMENTAL: this API may change without prior notice - * * @param dev * A pointer to a device structure. * @return * A pointer to this device name. */ -__rte_experimental const char * rte_dev_name(const struct rte_device *dev); /** * Retrieve a device numa node. * - * @warning - * @b EXPERIMENTAL: this API may change without prior notice - * * @param dev * A pointer to a device structure. * @return * A pointer to this device numa node. */ -__rte_experimental int rte_dev_numa_node(const struct rte_device *dev); @@ -179,19 +155,6 @@ rte_dev_numa_node(const struct rte_device *dev); */ #define RTE_DEV_NAME_MAX_LEN 64 -/** - * A structure describing a generic device. - */ -struct rte_device { - RTE_TAILQ_ENTRY(rte_device) next; /**< Next device */ - const char *name; /**< Device name */ - const char *bus_info; /**< Device bus specific information */ - const struct rte_driver *driver; /**< Driver assigned after probing */ - const struct rte_bus *bus; /**< Bus handle assigned on scan */ - int numa_node; /**< NUMA node connection */ - struct rte_devargs *devargs; /**< Arguments for latest probing */ -}; - /** * Query status of a device. * diff --git a/lib/eal/version.map b/lib/eal/version.map index 0cf321605e..3c14cf2724 100644 --- a/lib/eal/version.map +++ b/lib/eal/version.map @@ -26,7 +26,13 @@ DPDK_23 { rte_delay_us_block; rte_delay_us_callback_register; rte_delay_us_sleep; + rte_dev_bus; + rte_dev_bus_info; + rte_dev_devargs; + rte_dev_driver; rte_dev_is_probed; + rte_dev_name; + rte_dev_numa_node; rte_dev_probe; rte_dev_remove; rte_devargs_add; @@ -424,14 +430,6 @@ EXPERIMENTAL { rte_thread_self; rte_thread_set_affinity_by_id; rte_thread_set_priority; - - # added in 22.11 - rte_dev_bus; - rte_dev_bus_info; - rte_dev_devargs; - rte_dev_driver; - rte_dev_name; - rte_dev_numa_node; }; INTERNAL { diff --git a/lib/vhost/vdpa.c b/lib/vhost/vdpa.c index a6ca785b29..bb828577cb 100644 --- a/lib/vhost/vdpa.c +++ b/lib/vhost/vdpa.c @@ -10,6 +10,7 @@ #include +#include #include #include #include -- 2.37.2