From: Tonghao Zhang <[email protected]> When ports were removed from bridge, we should flush the offload rules on the ports. The main reason is two factors:
* The ports removed from bridge, will be managed by OvS, so flush the rules which installed by OvS. * If using the TC flower offload, for example, tc rules still are on the ports. And the information still are maintained by OvS, such as the mapping for tc and ufid. Then if adding the port to bridge and installing the rules to it again, *del_filter_and_ufid_mapping will be invoked, and delete the tc rule using tc handle which may not exist (offload init api flushed them.) on kernel or is used by other previous rules (if so, that rules will be deleted that is not we expected.). Cc: Simon Horman <[email protected]> Cc: Paul Blakey <[email protected]> Cc: Roi Dayan <[email protected]> Cc: Ben Pfaff <[email protected]> Cc: William Tu <[email protected]> Cc: Ilya Maximets <[email protected]> Tested-at: https://travis-ci.com/github/ovn-open-virtual-networks/ovs/builds/170832624 Co-authored-by: Wengang Hou <[email protected]> Signed-off-by: Tonghao Zhang <[email protected]> --- lib/netdev-offload.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/netdev-offload.c b/lib/netdev-offload.c index ab97a292ebac..964566caab1e 100644 --- a/lib/netdev-offload.c +++ b/lib/netdev-offload.c @@ -593,6 +593,7 @@ netdev_ports_remove(odp_port_t port_no, const struct dpif_class *dpif_class) data = netdev_ports_lookup(port_no, dpif_class); if (data) { dpif_port_destroy(&data->dpif_port); + netdev_flow_flush(data->netdev); /* flush offloaded rules. */ netdev_close(data->netdev); /* unref and possibly close */ hmap_remove(&port_to_netdev, &data->portno_node); hmap_remove(&ifindex_to_port, &data->ifindex_node); -- 2.26.1 _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
