From: Paul Blakey <pa...@mellanox.com> If a flow was offloaded to a netdev we delete it using netdev flow api.
Signed-off-by: Paul Blakey <pa...@mellanox.com> Reviewed-by: Roi Dayan <r...@mellanox.com> Reviewed-by: Simon Horman <simon.hor...@netronome.com> --- lib/dpif-netlink.c | 12 +++++++++++- lib/netdev.c | 15 +++++++++++++++ lib/netdev.h | 2 ++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/lib/dpif-netlink.c b/lib/dpif-netlink.c index 7e6c647..5ad0b49 100644 --- a/lib/dpif-netlink.c +++ b/lib/dpif-netlink.c @@ -2076,7 +2076,17 @@ try_send_to_netdev(struct dpif_netlink *dpif, struct dpif_op *op) (put->flags & DPIF_FP_MODIFY ? "PUT(MODIFY)" : "PUT")); return parse_flow_put(dpif, put); } - case DPIF_OP_FLOW_DEL: + case DPIF_OP_FLOW_DEL: { + struct dpif_flow_del *del = &op->u.flow_del; + + if (!del->ufid) { + break; + } + 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 48d177a..6cf87b4 100644 --- a/lib/netdev.c +++ b/lib/netdev.c @@ -2278,6 +2278,21 @@ netdev_ports_flow_dump_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; + + HMAP_FOR_EACH(data, node, &port_to_netdev) { + if (data->obj == obj && !netdev_flow_del(data->netdev, ufid, stats)) { + return 0; + } + } + + return ENOENT; +} + bool netdev_flow_api_enabled = false; #ifdef __linux__ diff --git a/lib/netdev.h b/lib/netdev.h index 327df99..c47746d 100644 --- a/lib/netdev.h +++ b/lib/netdev.h @@ -189,6 +189,8 @@ odp_port_t netdev_ifindex_to_odp_port(int ifindex); struct netdev_flow_dump **netdev_ports_flow_dump_create(const void *obj, int *ports); void netdev_ports_flow_flush(const void *obj); +int netdev_ports_flow_del(const void *obj, const ovs_u128 *ufid, + struct dpif_flow_stats *stats); /* native tunnel APIs */ /* Structure to pass parameters required to build a tunnel header. */ -- 2.7.4 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev