summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFaicker Mo <faicker.mo@ucloud.cn>2023-03-30 17:27:23 +0800
committerIlya Maximets <i.maximets@ovn.org>2023-04-03 20:39:33 +0200
commitf9507c1ea4343efddbc5c5425c8938b74d3a6260 (patch)
tree352ec52dd58502bd8d8d30c8c3a7a18579ab8e98 /lib
parentdaeab9548acc07fec839a46fd6bfd2a392bb91a0 (diff)
downloadopenvswitch-f9507c1ea4343efddbc5c5425c8938b74d3a6260.tar.gz
netdev-offload-tc: Del ufid mapping if device not exist.
The device may be deleted and added with ifindex changed. The tc rules on the device will be deleted if the device is deleted. The func tc_del_filter will fail when flow del. The mapping of ufid to tc will not be deleted. The traffic will trigger the same flow(with same ufid) to put to tc on the new device. Duplicated ufid mapping will be added. If the hashmap is expanded, the old mapping entry will be the first entry, and now the dp flow can't be deleted. Signed-off-by: Faicker Mo <faicker.mo@ucloud.cn> Acked-by: Eelco Chaudron <echaudro@redhat.com> Reviewed-by: Simon Horman <simon.horman@corigine.com> Tested-by: Simon Horman <simon.horman@corigine.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/netdev-offload-tc.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/netdev-offload-tc.c b/lib/netdev-offload-tc.c
index 4721f0160..c9662081f 100644
--- a/lib/netdev-offload-tc.c
+++ b/lib/netdev-offload-tc.c
@@ -276,8 +276,9 @@ del_filter_and_ufid_mapping(struct tcf_id *id, const ovs_u128 *ufid,
}
err = tc_del_flower_filter(id);
- if (!err) {
+ if (!err || err == ENODEV) {
del_ufid_tc_mapping(ufid);
+ return 0;
}
return err;
}