[ovs-dev] [PATCH 20/25] netdev-dpdk: Getter function for dpdk devargs API

Eli Britstein elibr at mellanox.com
Mon Jan 20 15:08:25 UTC 2020


When a vport is offloaded it has no explicit matching physical port so
rte_flows are created on each of the uplink ports. Those ports should be
kept for later deletion of the flow. While ODP number or dpdk port id may
be changed between adding and removing the flow, devargs is a unique
identifier. Introduce a getter function to get it.

Signed-off-by: Eli Britstein <elibr at mellanox.com>
Reviewed-by: Roni Bar Yanai <roniba at mellanox.com>
---
 lib/netdev-dpdk.c | 18 ++++++++++++++++++
 lib/netdev-dpdk.h |  2 ++
 2 files changed, 20 insertions(+)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index 52a3bc153..c094a33a5 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -5316,6 +5316,24 @@ out:
     return ret;
 }
 
+const char *
+netdev_dpdk_get_port_devargs(struct netdev *netdev)
+{
+    const char *devargs = NULL;
+    struct netdev_dpdk *dev;
+
+    if (!is_dpdk_class(netdev->netdev_class)) {
+        goto out;
+    }
+
+    dev = netdev_dpdk_cast(netdev);
+    ovs_mutex_lock(&dev->mutex);
+    devargs = dev->devargs;
+    ovs_mutex_unlock(&dev->mutex);
+out:
+    return devargs;
+}
+
 bool
 netdev_dpdk_flow_api_supported(struct netdev *netdev)
 {
diff --git a/lib/netdev-dpdk.h b/lib/netdev-dpdk.h
index abda4a865..3deadafff 100644
--- a/lib/netdev-dpdk.h
+++ b/lib/netdev-dpdk.h
@@ -57,6 +57,8 @@ int
 netdev_dpdk_get_port_id(struct netdev *netdev);
 bool
 netdev_dpdk_is_uplink_port(struct netdev *netdev);
+const char *
+netdev_dpdk_get_port_devargs(struct netdev *netdev);
 
 #else
 
-- 
2.14.5



More information about the dev mailing list