From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ferruh Yigit Subject: Re: [PATCH v5 1/6] ethdev: add devop to check removal status Date: Wed, 17 Jan 2018 20:40:38 +0000 Message-ID: <8490d1ae-9a32-0b39-fce4-a30616fe9615@intel.com> References: <1515587465-9304-1-git-send-email-matan@mellanox.com> <1516220357-13013-1-git-send-email-matan@mellanox.com> <1516220357-13013-2-git-send-email-matan@mellanox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: Thomas Monjalon , dev@dpdk.org, Neil Horman , Andrew Rybchenko , Ivan Malov To: Matan Azrad , Adrien Mazarguil , Gaetan Rivet Return-path: Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by dpdk.org (Postfix) with ESMTP id ABEE01B2E5 for ; Wed, 17 Jan 2018 21:40:43 +0100 (CET) In-Reply-To: <1516220357-13013-2-git-send-email-matan@mellanox.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 1/17/2018 8:19 PM, Matan Azrad wrote: > There is time between the physical removal of the device until PMDs get > a RMV interrupt. At this time DPDK PMDs and applications still don't > know about the removal. > > Current removal detection is achieved only by registration to device RMV > event and the notification comes asynchronously. So, there is no option > to detect a device removal synchronously. > Applications and other DPDK entities may want to check a device removal > synchronously and to take an immediate decision accordingly. > > Add new dev op called is_removed to allow DPDK entities to check an > Ethernet device removal status immediately. > > Signed-off-by: Matan Azrad > Acked-by: Thomas Monjalon As Thomas mentioned [1] new APIs needs to be EXPERIMENTAL. [1] https://dpdk.org/ml/archives/dev/2018-January/087719.html > @@ -1970,6 +1976,17 @@ int rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_queue, > void _rte_eth_dev_reset(struct rte_eth_dev *dev); > > /** > + * Check if an Ethernet device was physically removed. > + * A EXPERIMENTAL api documentation required, something like: /** * @warning * @b EXPERIMENTAL: this API may change without prior notice .... > + * @param port_id > + * The port identifier of the Ethernet device. > + * @return > + * - 0 when the Ethernet device is removed, otherwise 1. > + */ > +int > +rte_eth_dev_is_removed(uint16_t port_id); > + > +/** > * Allocate and set up a receive queue for an Ethernet device. > * > * The function allocates a contiguous block of memory for *nb_rx_desc* > diff --git a/lib/librte_ether/rte_ethdev_version.map b/lib/librte_ether/rte_ethdev_version.map > index e9681ac..78547ff 100644 > --- a/lib/librte_ether/rte_ethdev_version.map > +++ b/lib/librte_ether/rte_ethdev_version.map > @@ -198,6 +198,13 @@ DPDK_17.11 { > > } DPDK_17.08; > > +DPDK_18.02 { > + global: > + > + rte_eth_dev_is_removed; > + > +} DPDK_17.11; > + How to use EXPERIMENTAL tag in linker script it not documented, following makes sense to me any comment is welcome: Version script has tags and they are linked to previous version: DPDK_17.05 { .... } DPDK_17.08; DPDK_17.11 { .... } DPDK_17.08; DPDK_18.02 { .... } DPDK_17.11; But as far as I understand that is only information only for linker. So we can drop that part from EXPERIMENTAL and can make sure it is the *last* item in file, like: DPDK_17.05 { .... } DPDK_17.08; DPDK_17.11 { .... } DPDK_17.08; DPDK_18.02 { .... } DPDK_17.11; EXPERIMENTAL { ... };