]> git.droids-corp.org - dpdk.git/commitdiff
ethdev: add deferred intermediate device state
authorGaetan Rivet <gaetan.rivet@6wind.com>
Tue, 18 Jul 2017 12:48:12 +0000 (14:48 +0200)
committerFerruh Yigit <ferruh.yigit@intel.com>
Wed, 19 Jul 2017 08:59:39 +0000 (11:59 +0300)
This device state means that the device is managed externally, by
whichever party has set this state (PMD or application).

Note: this new device state is only an information. The related device
structure and operators are still valid and can be used normally.

It is however made private by device management helpers within ethdev,
making the device invisible to applications.

Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
lib/librte_ether/rte_ethdev.c
lib/librte_ether/rte_ethdev.h

index a1b744704f3a5125a5d51e75aeda82ef9ce224fa..81b398de2f1e4e3f35acd19d7b03c2c44f90247e 100644 (file)
@@ -291,7 +291,8 @@ int
 rte_eth_dev_is_valid_port(uint8_t port_id)
 {
        if (port_id >= RTE_MAX_ETHPORTS ||
-           rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED)
+           (rte_eth_devices[port_id].state != RTE_ETH_DEV_ATTACHED &&
+            rte_eth_devices[port_id].state != RTE_ETH_DEV_DEFERRED))
                return 0;
        else
                return 1;
index 55fda95834e7a6a8b0ffc0ca1f82ffce4c2968a0..ae6e18c4de69688c73ab765d0044bf7ec63b654d 100644 (file)
@@ -1615,6 +1615,7 @@ struct rte_eth_rxtx_callback {
 enum rte_eth_dev_state {
        RTE_ETH_DEV_UNUSED = 0,
        RTE_ETH_DEV_ATTACHED,
+       RTE_ETH_DEV_DEFERRED,
 };
 
 /**