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 <[email protected]> Reviewed-by: Roni Bar Yanai <[email protected]> --- 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 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
