summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorThomas Monjalon <thomas@monjalon.net>2018-10-19 04:07:56 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2018-10-26 22:14:05 +0200
commit662dbc322d0467e0dcdcbbb2b2283a43a5b849e7 (patch)
tree6a4d08bff092534e7b48dca28a51638bd2bcc44f /drivers
parente16adf08e54d5b1ff3b1116c372bbca279fced9d (diff)
downloaddpdk-662dbc322d0467e0dcdcbbb2b2283a43a5b849e7.zip
dpdk-662dbc322d0467e0dcdcbbb2b2283a43a5b849e7.tar.gz
dpdk-662dbc322d0467e0dcdcbbb2b2283a43a5b849e7.tar.xz
ethdev: remove release function for secondary process
After previous changes, the function rte_eth_dev_release_port() can be used for primary or secondary process as well. The only difference with rte_eth_dev_release_port_secondary() is the shared lock used in rte_eth_dev_release_port(). The function rte_eth_dev_release_port_secondary() was recently added in 18.11 cycle. Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: Andrew Rybchenko <arybchenko@solarflare.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/af_packet/rte_eth_af_packet.c2
-rw-r--r--drivers/net/bonding/rte_eth_bond_pmd.c2
-rw-r--r--drivers/net/kni/rte_eth_kni.c2
-rw-r--r--drivers/net/null/rte_eth_null.c7
-rw-r--r--drivers/net/octeontx/octeontx_ethdev.c2
-rw-r--r--drivers/net/pcap/rte_eth_pcap.c12
-rw-r--r--drivers/net/tap/rte_eth_tap.c2
-rw-r--r--drivers/net/vhost/rte_eth_vhost.c2
8 files changed, 15 insertions, 16 deletions
diff --git a/drivers/net/af_packet/rte_eth_af_packet.c b/drivers/net/af_packet/rte_eth_af_packet.c
index 2efc177..95a98c6 100644
--- a/drivers/net/af_packet/rte_eth_af_packet.c
+++ b/drivers/net/af_packet/rte_eth_af_packet.c
@@ -990,7 +990,7 @@ rte_pmd_af_packet_remove(struct rte_vdev_device *dev)
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++) {
diff --git a/drivers/net/bonding/rte_eth_bond_pmd.c b/drivers/net/bonding/rte_eth_bond_pmd.c
index 77fb3dc..e7a4be9 100644
--- a/drivers/net/bonding/rte_eth_bond_pmd.c
+++ b/drivers/net/bonding/rte_eth_bond_pmd.c
@@ -3267,7 +3267,7 @@ bond_remove(struct rte_vdev_device *dev)
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);
diff --git a/drivers/net/kni/rte_eth_kni.c b/drivers/net/kni/rte_eth_kni.c
index f43ee7d..a1e9970 100644
--- a/drivers/net/kni/rte_eth_kni.c
+++ b/drivers/net/kni/rte_eth_kni.c
@@ -467,7 +467,7 @@ eth_kni_remove(struct rte_vdev_device *vdev)
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);
diff --git a/drivers/net/null/rte_eth_null.c b/drivers/net/null/rte_eth_null.c
index b77283a..159c1c1 100644
--- a/drivers/net/null/rte_eth_null.c
+++ b/drivers/net/null/rte_eth_null.c
@@ -679,11 +679,10 @@ rte_pmd_null_remove(struct rte_vdev_device *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;
diff --git a/drivers/net/octeontx/octeontx_ethdev.c b/drivers/net/octeontx/octeontx_ethdev.c
index 7465079..0681486 100644
--- a/drivers/net/octeontx/octeontx_ethdev.c
+++ b/drivers/net/octeontx/octeontx_ethdev.c
@@ -1129,7 +1129,7 @@ octeontx_remove(struct rte_vdev_device *dev)
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;
}
diff --git a/drivers/net/pcap/rte_eth_pcap.c b/drivers/net/pcap/rte_eth_pcap.c
index 1790a80..7bbe72e 100644
--- a/drivers/net/pcap/rte_eth_pcap.c
+++ b/drivers/net/pcap/rte_eth_pcap.c
@@ -1228,13 +1228,13 @@ pmd_pcap_remove(struct rte_vdev_device *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) {
+ 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;
diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index 4905c08..e7817e8 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -2265,7 +2265,7 @@ rte_pmd_tap_remove(struct rte_vdev_device *dev)
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;
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index 0ad9248..b38a4b6 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -1446,7 +1446,7 @@ rte_pmd_vhost_remove(struct rte_vdev_device *dev)
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);