[ovs-dev] [PATCH ovs-dev, dpdk-latest V2 2/2] netdev-dpdk: Remove usage of RTE_ETH_DEV_CLOSE_REMOVE flag

Eli Britstein elibr at nvidia.com
Mon Oct 12 14:36:47 UTC 2020


Following DPDK commit [1], RTE_ETH_DEV_CLOSE_REMOVE flag is obsolete.
Behavior is equivalent to "always on". Remove the usage of that flag.

[1] 638d40ba9622 ("ethdev: remove old close behaviour")

Signed-off-by: Eli Britstein <elibr at nvidia.com>
---
 lib/netdev-dpdk.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index c048aaa75..76eec449a 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -1447,7 +1447,6 @@ netdev_dpdk_destruct(struct netdev *netdev)
     struct netdev_dpdk *dev = netdev_dpdk_cast(netdev);
     struct rte_device *rte_dev;
     struct rte_eth_dev *eth_dev;
-    bool remove_on_close;
 
     ovs_mutex_lock(&dpdk_mutex);
 
@@ -1459,20 +1458,15 @@ netdev_dpdk_destruct(struct netdev *netdev)
          * FIXME: avoid direct access to DPDK internal array rte_eth_devices.
          */
         eth_dev = &rte_eth_devices[dev->port_id];
-        remove_on_close =
-            eth_dev->data &&
-                (eth_dev->data->dev_flags & RTE_ETH_DEV_CLOSE_REMOVE);
         rte_dev = eth_dev->device;
 
         /* Remove the eth device. */
         rte_eth_dev_close(dev->port_id);
 
-        /* Remove this rte device and all its eth devices if flag
-         * RTE_ETH_DEV_CLOSE_REMOVE is not supported (which means representors
-         * are not supported), or if all the eth devices belonging to the rte
-         * device are closed.
+        /* Remove this rte device and all its eth devices if all the eth
+         * devices belonging to the rte device are closed.
          */
-        if (!remove_on_close || !netdev_dpdk_get_num_ports(rte_dev)) {
+        if (!netdev_dpdk_get_num_ports(rte_dev)) {
             int ret = rte_dev_remove(rte_dev);
 
             if (ret < 0) {
-- 
2.28.0.546.g385c171



More information about the dev mailing list