eth_dev->data->mac_addrs = NULL;
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
- return rte_eth_dev_release_port_secondary(eth_dev);
+ return rte_eth_dev_release_port(eth_dev);
internals = eth_dev->data->dev_private;
for (q = 0; q < internals->nb_queues; q++) {
return -ENODEV;
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
- return rte_eth_dev_release_port_secondary(eth_dev);
+ return rte_eth_dev_release_port(eth_dev);
RTE_ASSERT(eth_dev->device == &dev->device);
eth_dev->data->mac_addrs = NULL;
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
- return rte_eth_dev_release_port_secondary(eth_dev);
+ return rte_eth_dev_release_port(eth_dev);
eth_kni_dev_stop(eth_dev);
if (eth_dev == NULL)
return -1;
- if (rte_eal_process_type() != RTE_PROC_PRIMARY)
- return rte_eth_dev_release_port_secondary(eth_dev);
+ if (rte_eal_process_type() == RTE_PROC_PRIMARY)
+ /* mac_addrs must not be freed alone because part of dev_private */
+ eth_dev->data->mac_addrs = NULL;
- /* mac_addrs must not be freed alone because part of dev_private */
- eth_dev->data->mac_addrs = NULL;
rte_eth_dev_release_port(eth_dev);
return 0;
return -ENODEV;
if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
- rte_eth_dev_release_port_secondary(eth_dev);
+ rte_eth_dev_release_port(eth_dev);
continue;
}
if (eth_dev == NULL)
return -1;
- if (rte_eal_process_type() != RTE_PROC_PRIMARY)
- return rte_eth_dev_release_port_secondary(eth_dev);
+ if (rte_eal_process_type() == RTE_PROC_PRIMARY) {
+ internals = eth_dev->data->dev_private;
+ if (internals != NULL && internals->phy_mac == 0)
+ /* not dynamically allocated, must not be freed */
+ eth_dev->data->mac_addrs = NULL;
+ }
- internals = eth_dev->data->dev_private;
- if (internals != NULL && internals->phy_mac == 0)
- /* not dynamically allocated, must not be freed */
- eth_dev->data->mac_addrs = NULL;
rte_eth_dev_release_port(eth_dev);
return 0;
eth_dev->data->mac_addrs = NULL;
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
- return rte_eth_dev_release_port_secondary(eth_dev);
+ return rte_eth_dev_release_port(eth_dev);
internals = eth_dev->data->dev_private;
process_private = eth_dev->process_private;
return -ENODEV;
if (rte_eal_process_type() != RTE_PROC_PRIMARY)
- return rte_eth_dev_release_port_secondary(eth_dev);
+ return rte_eth_dev_release_port(eth_dev);
eth_dev_close(eth_dev);
return eth_dev;
}
-int
-rte_eth_dev_release_port_secondary(struct rte_eth_dev *eth_dev)
-{
- if (eth_dev == NULL)
- return -EINVAL;
-
- _rte_eth_dev_callback_process(eth_dev, RTE_ETH_EVENT_DESTROY, NULL);
- eth_dev->state = RTE_ETH_DEV_UNUSED;
-
- return 0;
-}
-
int
rte_eth_dev_release_port(struct rte_eth_dev *eth_dev)
{
return ret;
}
- if (rte_eal_process_type() != RTE_PROC_PRIMARY)
- return rte_eth_dev_release_port_secondary(ethdev);
-
return rte_eth_dev_release_port(ethdev);
}
*/
int rte_eth_dev_release_port(struct rte_eth_dev *eth_dev);
-/**
- * @internal
- * Release the specified ethdev port in the local process.
- * Only set ethdev state to unused, but not reset shared data since
- * it assume other processes is still using it. typically it is
- * called by a secondary process.
- *
- * @param eth_dev
- * Device to be detached.
- * @return
- * - 0 on success, negative on error
- */
-int rte_eth_dev_release_port_secondary(struct rte_eth_dev *eth_dev);
-
/**
* @internal
* Release device queues and clear its configuration to force the user
static inline void
rte_eth_dev_pci_release(struct rte_eth_dev *eth_dev)
{
- if (rte_eal_process_type() != RTE_PROC_PRIMARY) {
- eth_dev->device = NULL;
- eth_dev->intr_handle = NULL;
- rte_eth_dev_release_port_secondary(eth_dev);
- return;
- }
-
eth_dev->device = NULL;
eth_dev->intr_handle = NULL;
} DPDK_18.05;
-DPDK_18.11 {
- global:
-
- rte_eth_dev_release_port_secondary;
-
-} DPDK_18.08;
-
EXPERIMENTAL {
global: