On 14/02/2017 01:56, Chandran, Sugesh wrote:
Regards
_Sugesh
-----Original Message-----
From: Roi Dayan [mailto:[email protected]]
Sent: Wednesday, February 8, 2017 3:29 PM
To: [email protected]
Cc: Paul Blakey <[email protected]>; Or Gerlitz
<[email protected]>; Hadar Hen Zion <[email protected]>; Shahar
Klein <[email protected]>; Mark Bloch <[email protected]>; Rony
Efraim <[email protected]>; Fastabend, John R
<[email protected]>; Joe Stringer <[email protected]>; Andy
Gospodarek <[email protected]>; Lance Richardson
<[email protected]>; Marcelo Ricardo Leitner <[email protected]>;
Simon Horman <[email protected]>; Jiri Pirko
<[email protected]>; Chandran, Sugesh <[email protected]>
Subject: [PATCH ovs V3 15/25] dpif-netlink: Delete a flow from netdev
From: Paul Blakey <[email protected]>
+ }
+ dbg_print_flow(del->key, del->key_len, NULL, 0, NULL, 0,
+ del->ufid, "DEL");
+ return netdev_ports_flow_del(DPIF_HMAP_KEY(&dpif->dpif), del-
ufid,
+ del->stats);
+ }
case DPIF_OP_FLOW_GET:
case DPIF_OP_EXECUTE:
default:
diff --git a/lib/netdev.c b/lib/netdev.c index a0206b0..c6a4582 100644
--- a/lib/netdev.c
+++ b/lib/netdev.c
@@ -2269,6 +2269,21 @@ netdev_ports_flow_dumps_create(const void
*obj, int *ports)
return dumps;
}
+int
+netdev_ports_flow_del(const void *obj, const ovs_u128 *ufid,
+ struct dpif_flow_stats *stats) {
+ struct port_to_netdev_data *data;
+
[Sugesh]every flow delete may need to loop through all the netdev ovs ports
even though there is no hardware offload flows are exists.
I would suggest to keep a hash map of installed hardware flows and do the
lookup on it using the ufid at the time of delete.
good idea, we'll do that, thanks.
+ HMAP_FOR_EACH(data, node, &port_to_netdev) {
+ if (data->obj == obj && !netdev_flow_del(data->netdev, stats, ufid)) {
+ return 0;
+ }
+ }
+
+ return ENOENT;
+}
+
bool netdev_flow_api_enabled = false;
void
--
2.7.4
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev