From mboxrd@z Thu Jan 1 00:00:00 1970 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) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jan 2018 12:40:41 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,374,1511856000"; d="scan'208";a="20577943" Received: from fyigit-mobl1.ger.corp.intel.com (HELO [10.237.220.48]) ([10.237.220.48]) by FMSMGA003.fm.intel.com with ESMTP; 17 Jan 2018 12:40:39 -0800 To: Matan Azrad , Adrien Mazarguil , Gaetan Rivet Cc: Thomas Monjalon , dev@dpdk.org, Neil Horman , Andrew Rybchenko , Ivan Malov 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> From: Ferruh Yigit Message-ID: <8490d1ae-9a32-0b39-fce4-a30616fe9615@intel.com> Date: Wed, 17 Jan 2018 20:40:38 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <1516220357-13013-2-git-send-email-matan@mellanox.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH v5 1/6] ethdev: add devop to check removal status 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: , X-List-Received-Date: Wed, 17 Jan 2018 20:40:44 -0000 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 { ... };