On 14/04/2017 04:15, Joe Stringer wrote:
On 7 April 2017 at 06:13, Roi Dayan <[email protected]> wrote:
From: Paul Blakey <[email protected]>

Signed-off-by: Paul Blakey <[email protected]>
Reviewed-by: Roi Dayan <[email protected]>
Reviewed-by: Simon Horman <[email protected]>
---
 lib/netdev-tc-offloads.c | 33 ++++++++++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)

diff --git a/lib/netdev-tc-offloads.c b/lib/netdev-tc-offloads.c
index 4ef29d1..d5961e2 100644
--- a/lib/netdev-tc-offloads.c
+++ b/lib/netdev-tc-offloads.c
@@ -874,10 +874,37 @@ netdev_tc_flow_get(struct netdev *netdev OVS_UNUSED,

 int
 netdev_tc_flow_del(struct netdev *netdev OVS_UNUSED,
-                   const ovs_u128 *ufid OVS_UNUSED,
-                   struct dpif_flow_stats *stats OVS_UNUSED)
+                   const ovs_u128 *ufid,
+                   struct dpif_flow_stats *stats)
 {
-    return EOPNOTSUPP;
+    struct netdev *dev;
+    int prio = 0;
+    int ifindex;
+    int handle;
+    int error;
+
+    handle = get_ufid_tc_mapping(ufid, &prio, &dev);
+    if (!handle) {
+        return ENOENT;
+    }
+
+    ifindex = netdev_get_ifindex(dev);
+    if (ifindex < 0) {
+        VLOG_ERR_RL(&rl_err, "failed to get ifindex for %s: %s",
+                    netdev_get_name(dev), ovs_strerror(-ifindex));
+        netdev_close(dev);

Whose reference is this?

If the ifindex can't be gotten, was it ever inserted into the
ufid_tc_mapping in the first place?

If I follow, there's one reference on the netdev associated with the
flow, then two associated with the ufid_tc mapping.. is the caller
also likely to have a reference?

the reference is from calling get_ufid_tc_mapping() in the start of the function.


+        return -ifindex;
+    }
+
+    error = tc_del_filter(ifindex, prio, handle);
+    del_ufid_tc_mapping(ufid);
+
+    netdev_close(dev);
+
+    if (stats) {
+        memset(stats, 0, sizeof(*stats));
+    }
+    return error;
 }

 int
--
2.7.4

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to