[ovs-dev] netdev-dpdk: Fix dev attached flag.
diff mbox series

Message ID 1573203306-9860-1-git-send-email-wangzk320@163.com
State Rejected
Delegated to: Ilya Maximets
Headers show
Series
  • [ovs-dev] netdev-dpdk: Fix dev attached flag.
Related show

Commit Message

Zhike Wang Nov. 8, 2019, 8:55 a.m. UTC
If the dev was already probed correctly, the dev attached flag
should be set to true, or resource would leak during destruct.

Signed-off-by: Zhike Wang <wangzk320@163.com>
---
 lib/netdev-dpdk.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Ilya Maximets Nov. 8, 2019, 4:31 p.m. UTC | #1
On 08.11.2019 9:55, Zhike Wang wrote:
> If the dev was already probed correctly, the dev attached flag
> should be set to true, or resource would leak during destruct.

We're not detaching devices that wasn't attached by us.

If device is already probed in DPDK than it means that most likely it
was attached on dpdk_eal_init(), because user explicitly added this
device in EAL arguments with 'dpdk-extra' knob.

Previously there was non-detachable devices and we protected ourselves
from trying to detach them.  I beleive (hope) that in modern DPDK
all the devices are detachable, but still.  If user added devices
to EAL arguments than he/she wanted them to exist whole time while
OVS is running and we're not eligible to detach these devices.

If you really want to detach them, use special command
'ovs-appctl netdev-dpdk/detach' that was designed for this exact case.

Best regards, Ilya Maximets.

Patch
diff mbox series

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index a65540c..10e2fe9 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -1728,6 +1728,9 @@  netdev_dpdk_process_devargs(struct netdev_dpdk *dev,
                     new_port_id = DPDK_ETH_PORT_ID_INVALID;
                 }
             }
+        } else {
+            dev->attached = true;
+            VLOG_INFO("Device '%s' attached to DPDK", devargs);
         }
     }