[dpdk-dev] [PATCH v5 1/6] ethdev: add devop to check removal status

Ferruh Yigit ferruh.yigit at intel.com
Wed Jan 17 21:40:38 CET 2018


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 <matan at mellanox.com>
> Acked-by: Thomas Monjalon <thomas at monjalon.net>

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 {
   ...
};


More information about the dev mailing list