]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-5.10/net-openvswitch-fix-unwanted-error-log-on-timeout-po.patch
6.1-stable patches
[thirdparty/kernel/stable-queue.git] / queue-5.10 / net-openvswitch-fix-unwanted-error-log-on-timeout-po.patch
1 From 83a1d0356b634cc4da3d5c4b058a3cf8eedc1e98 Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Wed, 3 Apr 2024 22:38:01 +0200
4 Subject: net: openvswitch: fix unwanted error log on timeout policy probing
5
6 From: Ilya Maximets <i.maximets@ovn.org>
7
8 [ Upstream commit 4539f91f2a801c0c028c252bffae56030cfb2cae ]
9
10 On startup, ovs-vswitchd probes different datapath features including
11 support for timeout policies. While probing, it tries to execute
12 certain operations with OVS_PACKET_ATTR_PROBE or OVS_FLOW_ATTR_PROBE
13 attributes set. These attributes tell the openvswitch module to not
14 log any errors when they occur as it is expected that some of the
15 probes will fail.
16
17 For some reason, setting the timeout policy ignores the PROBE attribute
18 and logs a failure anyway. This is causing the following kernel log
19 on each re-start of ovs-vswitchd:
20
21 kernel: Failed to associated timeout policy `ovs_test_tp'
22
23 Fix that by using the same logging macro that all other messages are
24 using. The message will still be printed at info level when needed
25 and will be rate limited, but with a net rate limiter instead of
26 generic printk one.
27
28 The nf_ct_set_timeout() itself will still print some info messages,
29 but at least this change makes logging in openvswitch module more
30 consistent.
31
32 Fixes: 06bd2bdf19d2 ("openvswitch: Add timeout support to ct action")
33 Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
34 Acked-by: Eelco Chaudron <echaudro@redhat.com>
35 Link: https://lore.kernel.org/r/20240403203803.2137962-1-i.maximets@ovn.org
36 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
37 Signed-off-by: Sasha Levin <sashal@kernel.org>
38 ---
39 net/openvswitch/conntrack.c | 5 +++--
40 1 file changed, 3 insertions(+), 2 deletions(-)
41
42 diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
43 index 0f0f380e81a40..d452a63d2f4b0 100644
44 --- a/net/openvswitch/conntrack.c
45 +++ b/net/openvswitch/conntrack.c
46 @@ -1692,8 +1692,9 @@ int ovs_ct_copy_action(struct net *net, const struct nlattr *attr,
47 if (ct_info.timeout[0]) {
48 if (nf_ct_set_timeout(net, ct_info.ct, family, key->ip.proto,
49 ct_info.timeout))
50 - pr_info_ratelimited("Failed to associated timeout "
51 - "policy `%s'\n", ct_info.timeout);
52 + OVS_NLERR(log,
53 + "Failed to associated timeout policy '%s'",
54 + ct_info.timeout);
55 else
56 ct_info.nf_ct_timeout = rcu_dereference(
57 nf_ct_timeout_find(ct_info.ct)->timeout);
58 --
59 2.43.0
60