[ovs-dev] [PATCH ovs V2 16/21] netdev-tc-offloads: netdev flow del using tc interface

Paul Blakey paulb at mellanox.com
Sun Dec 25 11:39:44 UTC 2016


Signed-off-by: Paul Blakey <paulb at mellanox.com>
Reviewed-by: Roi Dayan <roid at mellanox.com>
---
 lib/netdev-tc-offloads.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/lib/netdev-tc-offloads.c b/lib/netdev-tc-offloads.c
index 4acc8ea..25df598 100644
--- a/lib/netdev-tc-offloads.c
+++ b/lib/netdev-tc-offloads.c
@@ -568,10 +568,24 @@ netdev_tc_flow_get(struct netdev *netdev OVS_UNUSED,
 
 int
 netdev_tc_flow_del(struct netdev *netdev OVS_UNUSED,
-                      struct dpif_flow_stats *stats OVS_UNUSED,
-                      ovs_u128 *ufid OVS_UNUSED)
+                      struct dpif_flow_stats *stats,
+                      ovs_u128 *ufid)
 {
-    return EOPNOTSUPP;
+    struct netdev *dev;
+    int old_prio = 0;
+    int old_handle = get_ufid_tc_mapping(ufid, &old_prio, &dev);
+
+    if (old_handle && old_prio) {
+        int err = tc_del_flower(netdev_get_ifindex(dev), old_handle, old_prio);
+
+        del_ufid_tc_mapping(ufid);
+        netdev_close(dev);
+        if (stats) {
+            memset(stats, 0, sizeof(*stats));
+        }
+        return err;
+    }
+    return ENOENT;
 }
 
 int
-- 
1.8.3.1



More information about the dev mailing list