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 196CEA0C45; Thu, 28 Oct 2021 10:35:15 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 57A164113A; Thu, 28 Oct 2021 10:35:11 +0200 (CEST) Received: from out2-smtp.messagingengine.com (out2-smtp.messagingengine.com [66.111.4.26]) by mails.dpdk.org (Postfix) with ESMTP id 0AC334113D for ; Thu, 28 Oct 2021 10:35:08 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 8AC745C0265; Thu, 28 Oct 2021 04:35:07 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Thu, 28 Oct 2021 04:35:07 -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=fm2; bh=ETVYL+gLDPp6NmNPE0enl6x11N RWqX2qKgaXtKpmrMk=; b=EBtGT+6zF4BjoYPLgCKthAlvfugFzqOjVZlHpf2QuP Ye6jEHffc5x9UudDr1nu7nM0U6+1SWriAUtJ0hkvgLEeVINhiLHbglsks8vO0yi2 GLYoJxTOzYOK306Ok+2sGxJRlr+dgia3b7iZVIDchMD+YRX1XCTHnUt8V49PFz87 Ty4WUnEZ8z8neGZzTYiZ5ld92i9jXuyXivkC7qba8wbsKaIzmYKqSyMvJQ4xlLvD QCExWpXsj8jWMKxSKzZnOZw0UpfIIFS/tUrC2bFWAAsyEwg9LNTBK6Oj5lRvA5XN r1XK8Z2lFx1v75zk28bY+gpaPdkgTSqAr/1QxPOZzXiQ== 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=fm1; bh=ETVYL+gLDPp6NmNPE 0enl6x11NRWqX2qKgaXtKpmrMk=; b=TD5Xzr6ni8BXPRkvCZlnJat/g2969mvfB ekHRhPqNPA/WSpItp2qhLNIHwzKaSiC+zNt9Ca+vuBbK49JqEteuL0xh7m3WWKI1 dy7yw3J3yUMXbMDx4W5uucN2AUtad/m+ei9wXDZvtZ03mIpilccHvUkXjDdbZTkD BMJX47fxjdExYxraFEWkfa6Yjdz0AdwBNB/QtfiBqJ75hhejlaHtdK4x7b6cPJqt NjExTFnuFYz27Bb4Bdyd3WrLJ8iSOGoniHJQxNaoJLFvTFaIKnGhK/whivrQPKlW qh6hc4TlyAVgkyY97Poyp7fy0fbHekroNjGHeKp80ohwBGFeDnpjA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvdegvddgtddvucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefvhhhomhgrshcu ofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecuggftrf grthhtvghrnhepvdelvdduhedvudduveeuvdevheegudelgeeigfejheduhedttdegudff jeeihffgnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epthhhohhmrghssehmohhnjhgrlhhonhdrnhgvth X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 28 Oct 2021 04:35:05 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: matan@nvidia.com, Ferruh Yigit , Andrew Rybchenko , Ray Kinsella Date: Thu, 28 Oct 2021 10:34:57 +0200 Message-Id: <20211028083457.3024272-1-thomas@monjalon.net> X-Mailer: git-send-email 2.33.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] ethdev: promote port ownership API as stable 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" The port ownership concept was introduced in ethdev in DPDK 18.02. Not sure it is used by applications except those using failsafe or netvsc. It can also be used by libraries or applications to sort out how ports are controlled. Hiding sub-ports controlled by failsafe or netvsc look to be enough justification to promote this API as stable. Signed-off-by: Thomas Monjalon --- doc/guides/prog_guide/poll_mode_drv.rst | 6 +++++- lib/ethdev/rte_ethdev.h | 20 -------------------- lib/ethdev/version.map | 12 +++++------- 3 files changed, 10 insertions(+), 28 deletions(-) diff --git a/doc/guides/prog_guide/poll_mode_drv.rst b/doc/guides/prog_guide/poll_mode_drv.rst index 6831289844..9d081b1cba 100644 --- a/doc/guides/prog_guide/poll_mode_drv.rst +++ b/doc/guides/prog_guide/poll_mode_drv.rst @@ -146,14 +146,18 @@ Based on their PCI identifier, NIC ports are assigned two other identifiers: Port Ownership ~~~~~~~~~~~~~~ + The Ethernet devices ports can be owned by a single DPDK entity (application, library, PMD, process, etc). The ownership mechanism is controlled by ethdev APIs and allows to set/remove/get a port owner by DPDK entities. -Allowing this should prevent any multiple management of Ethernet port by different entities. +It prevents Ethernet ports to be managed by different entities. .. note:: It is the DPDK entity responsibility to set the port owner before using it and to manage the port usage synchronization between different threads or processes. +It is recommended to set port ownership early, +like during the probing notification ``RTE_ETH_EVENT_NEW``. + Device Configuration ~~~~~~~~~~~~~~~~~~~~ diff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h index 09d60351a3..154465c3ab 100644 --- a/lib/ethdev/rte_ethdev.h +++ b/lib/ethdev/rte_ethdev.h @@ -2193,9 +2193,6 @@ rte_eth_find_next_sibling(uint16_t port_id_start, uint16_t ref_port_id); port_id = rte_eth_find_next_sibling(port_id + 1, ref_port_id)) /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Get a new unique owner identifier. * An owner identifier is used to owns Ethernet devices by only one DPDK entity * to avoid multiple management of device by different entities. @@ -2205,13 +2202,9 @@ rte_eth_find_next_sibling(uint16_t port_id_start, uint16_t ref_port_id); * @return * Negative errno value on error, 0 on success. */ -__rte_experimental int rte_eth_dev_owner_new(uint64_t *owner_id); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Set an Ethernet device owner. * * @param port_id @@ -2221,14 +2214,10 @@ int rte_eth_dev_owner_new(uint64_t *owner_id); * @return * Negative errno value on error, 0 on success. */ -__rte_experimental int rte_eth_dev_owner_set(const uint16_t port_id, const struct rte_eth_dev_owner *owner); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Unset Ethernet device owner to make the device ownerless. * * @param port_id @@ -2238,14 +2227,10 @@ int rte_eth_dev_owner_set(const uint16_t port_id, * @return * 0 on success, negative errno value on error. */ -__rte_experimental int rte_eth_dev_owner_unset(const uint16_t port_id, const uint64_t owner_id); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Remove owner from all Ethernet devices owned by a specific owner. * * @param owner_id @@ -2253,13 +2238,9 @@ int rte_eth_dev_owner_unset(const uint16_t port_id, * @return * 0 on success, negative errno value on error. */ -__rte_experimental int rte_eth_dev_owner_delete(const uint64_t owner_id); /** - * @warning - * @b EXPERIMENTAL: this API may change without prior notice. - * * Get the owner of an Ethernet device. * * @param port_id @@ -2269,7 +2250,6 @@ int rte_eth_dev_owner_delete(const uint64_t owner_id); * @return * 0 on success, negative errno value on error.. */ -__rte_experimental int rte_eth_dev_owner_get(const uint16_t port_id, struct rte_eth_dev_owner *owner); diff --git a/lib/ethdev/version.map b/lib/ethdev/version.map index c2fb0669a4..15a69e67eb 100644 --- a/lib/ethdev/version.map +++ b/lib/ethdev/version.map @@ -36,6 +36,11 @@ DPDK_22 { rte_eth_dev_logtype; rte_eth_dev_mac_addr_add; rte_eth_dev_mac_addr_remove; + rte_eth_dev_owner_delete; + rte_eth_dev_owner_get; + rte_eth_dev_owner_new; + rte_eth_dev_owner_set; + rte_eth_dev_owner_unset; rte_eth_dev_pool_ops_supported; rte_eth_dev_priority_flow_ctrl_set; rte_eth_dev_reset; @@ -148,13 +153,6 @@ EXPERIMENTAL { rte_mtr_stats_read; rte_mtr_stats_update; - # added in 18.02 - rte_eth_dev_owner_delete; - rte_eth_dev_owner_get; - rte_eth_dev_owner_new; - rte_eth_dev_owner_set; - rte_eth_dev_owner_unset; - # added in 18.05 rte_eth_dev_get_module_eeprom; rte_eth_dev_get_module_info; -- 2.33.0