From e1e5eac5b0167c65c802bd60ed37605b1e1c9c92 Mon Sep 17 00:00:00 2001 From: Eelco Chaudron Date: Fri, 27 Jan 2023 12:16:36 +0100 Subject: tc: Add TCA_KIND flower to delete and get operation to avoid rtnl_lock(). A long long time ago, an effort was made to make tc flower rtnl_lock() free. However, on the OVS part we forgot to add the TCA_KIND "flower" attribute, which tell the kernel to skip the lock. This patch corrects this by adding the attribute for the delete and get operations. The kernel code calls tcf_proto_is_unlocked() to determine the rtnl_lock() is needed for the specific tc protocol. It does this in the tc_new_tfilter(), tc_del_tfilter(), and in tc_get_tfilter(). If the name is not set, tcf_proto_is_unlocked() will always return false. If set, the specific protocol is queried for unlocked support. Fixes: f98e418fbdb6 ("tc: Add tc flower functions") Signed-off-by: Eelco Chaudron Reviewed-by: Roi Dayan Signed-off-by: Ilya Maximets --- lib/netdev-linux.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/netdev-linux.c') diff --git a/lib/netdev-linux.c b/lib/netdev-linux.c index f6d7a1b97..65bdd51db 100644 --- a/lib/netdev-linux.c +++ b/lib/netdev-linux.c @@ -2735,7 +2735,7 @@ tc_del_matchall_policer(struct netdev *netdev) } id = tc_make_tcf_id(ifindex, block_id, prio, TC_INGRESS); - err = tc_del_filter(&id); + err = tc_del_filter(&id, "matchall"); if (err) { return err; } -- cgit v1.2.1