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 4D590A00C5; Thu, 28 Jul 2022 17:29:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 97C7342C21; Thu, 28 Jul 2022 17:29:00 +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 7792E42C22 for ; Thu, 28 Jul 2022 17:28:59 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1659022139; 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=GvbWjszEHULw0YrEv+5qfuq9Bzyb/uU3eponRsXV/bQ=; b=LZncrW2Ig3PKp0T8YKhbHCrZixGJehzIEtASMDP0paYVClAQJs5+h2apiSEMVVkN+KLbXe bjLgdG8iFrEcFreiriFE7FK0djvGDKN17do/xO12wjr6BKbhslfqANCJ9fJild2hspzrMa dHlhFsOmAX6tanX7Hm6+B/loKzlghW0= 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-184-OTKy--1zNtSPoIBXYYqM6g-1; Thu, 28 Jul 2022 11:28:57 -0400 X-MC-Unique: OTKy--1zNtSPoIBXYYqM6g-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 861053C10141; Thu, 28 Jul 2022 15:28:57 +0000 (UTC) Received: from fchome.redhat.com (unknown [10.40.195.18]) by smtp.corp.redhat.com (Postfix) with ESMTP id 996E51415121; Thu, 28 Jul 2022 15:28:56 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: Ray Kinsella , Maxime Coquelin , Chenbo Xia Subject: [RFC v3 26/26] dev: hide device object Date: Thu, 28 Jul 2022 17:26:40 +0200 Message-Id: <20220728152640.547725-27-david.marchand@redhat.com> In-Reply-To: <20220728152640.547725-1-david.marchand@redhat.com> References: <20220628144643.1213026-1-david.marchand@redhat.com> <20220728152640.547725-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 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 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 --- 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 3512f01539..429ef298c5 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -43,13 +43,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 ff1a2d6543..cff2667f39 100644 --- a/doc/guides/rel_notes/release_22_11.rst +++ b/doc/guides/rel_notes/release_22_11.rst @@ -94,8 +94,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 be8bbe79ee..b58cbd2236 100644 --- a/lib/eal/include/rte_dev.h +++ b/lib/eal/include/rte_dev.h @@ -72,90 +72,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); @@ -165,19 +141,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 bdebcbe565..aaf3f267e9 100644 --- a/lib/vhost/vdpa.c +++ b/lib/vhost/vdpa.c @@ -10,6 +10,7 @@ #include +#include #include #include #include -- 2.36.1