LKML Archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: openvswitch: fix unwanted error log on timeout policy probing
@ 2024-04-03 20:38 Ilya Maximets
  2024-04-04  7:27 ` [ovs-dev] " Eelco Chaudron
  2024-04-06  6:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Ilya Maximets @ 2024-04-03 20:38 UTC (permalink / raw
  To: netdev
  Cc: Pravin B Shelar, David S. Miller, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, Yi-Hung Wei, dev, linux-kernel, Ilya Maximets

On startup, ovs-vswitchd probes different datapath features including
support for timeout policies.  While probing, it tries to execute
certain operations with OVS_PACKET_ATTR_PROBE or OVS_FLOW_ATTR_PROBE
attributes set.  These attributes tell the openvswitch module to not
log any errors when they occur as it is expected that some of the
probes will fail.

For some reason, setting the timeout policy ignores the PROBE attribute
and logs a failure anyway.  This is causing the following kernel log
on each re-start of ovs-vswitchd:

  kernel: Failed to associated timeout policy `ovs_test_tp'

Fix that by using the same logging macro that all other messages are
using.  The message will still be printed at info level when needed
and will be rate limited, but with a net rate limiter instead of
generic printk one.

The nf_ct_set_timeout() itself will still print some info messages,
but at least this change makes logging in openvswitch module more
consistent.

Fixes: 06bd2bdf19d2 ("openvswitch: Add timeout support to ct action")
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
---
 net/openvswitch/conntrack.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/openvswitch/conntrack.c b/net/openvswitch/conntrack.c
index 3019a4406ca4..74b63cdb5992 100644
--- a/net/openvswitch/conntrack.c
+++ b/net/openvswitch/conntrack.c
@@ -1380,8 +1380,9 @@ int ovs_ct_copy_action(struct net *net, const struct nlattr *attr,
 	if (ct_info.timeout[0]) {
 		if (nf_ct_set_timeout(net, ct_info.ct, family, key->ip.proto,
 				      ct_info.timeout))
-			pr_info_ratelimited("Failed to associated timeout "
-					    "policy `%s'\n", ct_info.timeout);
+			OVS_NLERR(log,
+				  "Failed to associated timeout policy '%s'",
+				  ct_info.timeout);
 		else
 			ct_info.nf_ct_timeout = rcu_dereference(
 				nf_ct_timeout_find(ct_info.ct)->timeout);
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [ovs-dev] [PATCH net] net: openvswitch: fix unwanted error log on timeout policy probing
  2024-04-03 20:38 [PATCH net] net: openvswitch: fix unwanted error log on timeout policy probing Ilya Maximets
@ 2024-04-04  7:27 ` Eelco Chaudron
  2024-04-06  6:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Eelco Chaudron @ 2024-04-04  7:27 UTC (permalink / raw
  To: Ilya Maximets
  Cc: netdev, dev, linux-kernel, Eric Dumazet, Jakub Kicinski,
	Paolo Abeni, David S. Miller



On 3 Apr 2024, at 22:38, Ilya Maximets wrote:

> On startup, ovs-vswitchd probes different datapath features including
> support for timeout policies.  While probing, it tries to execute
> certain operations with OVS_PACKET_ATTR_PROBE or OVS_FLOW_ATTR_PROBE
> attributes set.  These attributes tell the openvswitch module to not
> log any errors when they occur as it is expected that some of the
> probes will fail.
>
> For some reason, setting the timeout policy ignores the PROBE attribute
> and logs a failure anyway.  This is causing the following kernel log
> on each re-start of ovs-vswitchd:
>
>   kernel: Failed to associated timeout policy `ovs_test_tp'
>
> Fix that by using the same logging macro that all other messages are
> using.  The message will still be printed at info level when needed
> and will be rate limited, but with a net rate limiter instead of
> generic printk one.
>
> The nf_ct_set_timeout() itself will still print some info messages,
> but at least this change makes logging in openvswitch module more
> consistent.
>
> Fixes: 06bd2bdf19d2 ("openvswitch: Add timeout support to ct action")
> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
> ---

Thanks for fixing this annoying startup message! The change looks good to me.

Acked-by: Eelco Chaudron <echaudro@redhat.com>


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: openvswitch: fix unwanted error log on timeout policy probing
  2024-04-03 20:38 [PATCH net] net: openvswitch: fix unwanted error log on timeout policy probing Ilya Maximets
  2024-04-04  7:27 ` [ovs-dev] " Eelco Chaudron
@ 2024-04-06  6:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2024-04-06  6:10 UTC (permalink / raw
  To: Ilya Maximets
  Cc: netdev, pshelar, davem, edumazet, kuba, pabeni, yihung.wei, dev,
	linux-kernel

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Wed,  3 Apr 2024 22:38:01 +0200 you wrote:
> On startup, ovs-vswitchd probes different datapath features including
> support for timeout policies.  While probing, it tries to execute
> certain operations with OVS_PACKET_ATTR_PROBE or OVS_FLOW_ATTR_PROBE
> attributes set.  These attributes tell the openvswitch module to not
> log any errors when they occur as it is expected that some of the
> probes will fail.
> 
> [...]

Here is the summary with links:
  - [net] net: openvswitch: fix unwanted error log on timeout policy probing
    https://git.kernel.org/netdev/net/c/4539f91f2a80

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-04-06  6:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-04-03 20:38 [PATCH net] net: openvswitch: fix unwanted error log on timeout policy probing Ilya Maximets
2024-04-04  7:27 ` [ovs-dev] " Eelco Chaudron
2024-04-06  6:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).