[ovs-dev] [PATCH 18/25] netdev-offload-dpdk: Implement flow dump create/destroy APIs

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


When offloading vports, we don't configure rte_flow on the vport itself,
as it is not a physical dpdk port, but rather on uplinks. Implement
those APIs as a pre-step to enable iterate over the ports.

Signed-off-by: Eli Britstein <elibr at mellanox.com>
Reviewed-by: Roni Bar Yanai <roniba at mellanox.com>
---
 lib/netdev-offload-dpdk.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/lib/netdev-offload-dpdk.c b/lib/netdev-offload-dpdk.c
index 4611caa8f..669110e4a 100644
--- a/lib/netdev-offload-dpdk.c
+++ b/lib/netdev-offload-dpdk.c
@@ -1871,6 +1871,27 @@ netdev_offload_dpdk_hw_miss_packet_recover(struct netdev *netdev,
     return 0;
 }
 
+static int
+netdev_offload_dpdk_flow_dump_create(struct netdev *netdev,
+                                     struct netdev_flow_dump **dump_out)
+{
+    struct netdev_flow_dump *dump;
+
+    dump = xzalloc(sizeof *dump);
+    dump->netdev = netdev_ref(netdev);
+
+    *dump_out = dump;
+    return 0;
+}
+
+static int
+netdev_offload_dpdk_flow_dump_destroy(struct netdev_flow_dump *dump)
+{
+    netdev_close(dump->netdev);
+    free(dump);
+    return 0;
+}
+
 const struct netdev_flow_api netdev_offload_dpdk = {
     .type = "dpdk_flow_api",
     .flow_put = netdev_offload_dpdk_flow_put,
@@ -1878,4 +1899,6 @@ const struct netdev_flow_api netdev_offload_dpdk = {
     .init_flow_api = netdev_offload_dpdk_init_flow_api,
     .flow_get = netdev_offload_dpdk_flow_get,
     .hw_miss_packet_recover = netdev_offload_dpdk_hw_miss_packet_recover,
+    .flow_dump_create = netdev_offload_dpdk_flow_dump_create,
+    .flow_dump_destroy = netdev_offload_dpdk_flow_dump_destroy,
 };
-- 
2.14.5



More information about the dev mailing list