[ovs-dev,ovs,V4,07/24] netdev-tc-offloads: Implement netdev flow flush using tc interface

Submitted by Roi Dayan on March 13, 2017, 1:36 p.m.

Details

Message ID 1489412234-30916-8-git-send-email-roid@mellanox.com
State Superseded
Headers show

Commit Message

Roi Dayan March 13, 2017, 1:36 p.m.
From: Paul Blakey <paulb@mellanox.com>

Signed-off-by: Paul Blakey <paulb@mellanox.com>
Reviewed-by: Roi Dayan <roid@mellanox.com>
---
 lib/netdev-tc-offloads.c |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/lib/netdev-tc-offloads.c b/lib/netdev-tc-offloads.c
index 946c2a6..2ea7fe3 100644
--- a/lib/netdev-tc-offloads.c
+++ b/lib/netdev-tc-offloads.c
@@ -75,10 +75,20 @@ 
 
 VLOG_DEFINE_THIS_MODULE(netdev_tc_offloads);
 
+static struct vlog_rate_limit rl_err = VLOG_RATE_LIMIT_INIT(9999, 5);
+
 int
-netdev_tc_flow_flush(struct netdev *netdev OVS_UNUSED)
+netdev_tc_flow_flush(struct netdev *netdev)
 {
-    return EOPNOTSUPP;
+    int ifindex = netdev_get_ifindex(netdev);
+
+    if (ifindex < 0) {
+        VLOG_ERR_RL(&rl_err, "failed to get ifindex for %s: %s",
+                    netdev_get_name(netdev), ovs_strerror(-ifindex));
+        return -ifindex;
+    }
+
+    return tc_flush(ifindex);
 }
 
 int