netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] udp_tunnel: Fix typo using netdev_WARN instead of netdev_warn
@ 2025-09-03 19:57 Alok Tiwari
  2025-09-04  9:18 ` Simon Horman
  0 siblings, 1 reply; 7+ messages in thread
From: Alok Tiwari @ 2025-09-03 19:57 UTC (permalink / raw)
  To: dsahern, davem, edumazet, kuba, pabeni, horms, netdev; +Cc: alok.a.tiwari

There is no condition being tested, so it should be netdev_warn,
not netdev_WARN. Using netdev_WARN here is a typo or misuse.

Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
---
 net/ipv4/udp_tunnel_nic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ipv4/udp_tunnel_nic.c b/net/ipv4/udp_tunnel_nic.c
index ff66db48453c..944b3cf25468 100644
--- a/net/ipv4/udp_tunnel_nic.c
+++ b/net/ipv4/udp_tunnel_nic.c
@@ -930,7 +930,7 @@ udp_tunnel_nic_netdevice_event(struct notifier_block *unused,
 
 		err = udp_tunnel_nic_register(dev);
 		if (err)
-			netdev_WARN(dev, "failed to register for UDP tunnel offloads: %d", err);
+			netdev_warn(dev, "failed to register for UDP tunnel offloads: %d", err);
 		return notifier_from_errno(err);
 	}
 	/* All other events will need the udp_tunnel_nic state */
-- 
2.50.1


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

* Re: [PATCH net-next] udp_tunnel: Fix typo using netdev_WARN instead of netdev_warn
  2025-09-03 19:57 [PATCH net-next] udp_tunnel: Fix typo using netdev_WARN instead of netdev_warn Alok Tiwari
@ 2025-09-04  9:18 ` Simon Horman
  2025-09-04 13:45   ` [External] : " ALOK TIWARI
  0 siblings, 1 reply; 7+ messages in thread
From: Simon Horman @ 2025-09-04  9:18 UTC (permalink / raw)
  To: Alok Tiwari; +Cc: dsahern, davem, edumazet, kuba, pabeni, netdev

On Wed, Sep 03, 2025 at 12:57:12PM -0700, Alok Tiwari wrote:
> There is no condition being tested, so it should be netdev_warn,
> not netdev_WARN. Using netdev_WARN here is a typo or misuse.

Hi Alok,

I agree that using netdev_warn() seems more appropriate.

But doesn't the difference between netdev_warn() and netdev_WARN()
lie in the output they produce rather than testing of a condition
(or not)?

> 
> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>

...

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

* Re: [External] : Re: [PATCH net-next] udp_tunnel: Fix typo using netdev_WARN instead of netdev_warn
  2025-09-04  9:18 ` Simon Horman
@ 2025-09-04 13:45   ` ALOK TIWARI
  2025-09-04 14:28     ` Jakub Kicinski
  2025-09-04 18:48     ` Simon Horman
  0 siblings, 2 replies; 7+ messages in thread
From: ALOK TIWARI @ 2025-09-04 13:45 UTC (permalink / raw)
  To: Simon Horman; +Cc: dsahern, davem, edumazet, kuba, pabeni, netdev



On 9/4/2025 2:48 PM, Simon Horman wrote:
> On Wed, Sep 03, 2025 at 12:57:12PM -0700, Alok Tiwari wrote:
>> There is no condition being tested, so it should be netdev_warn,
>> not netdev_WARN. Using netdev_WARN here is a typo or misuse.
> 
> Hi Alok,
> 
> I agree that using netdev_warn() seems more appropriate.
> 
> But doesn't the difference between netdev_warn() and netdev_WARN()
> lie in the output they produce rather than testing of a condition
> (or not)?
> 
>>
>> Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
> 
> ...

Thanks Simon, agreed, I understand your point.

since WARN() triggers backtrace and dumps the file name
it is not require here. The failure in udp_tunnel_nic_register()
should just be treated as an expected operation failure, not as a kernel bug

Should I send a v2 with an updated commit message
(remove "condition being tested"), or drop these changes?”


Thanks for your review.

Thanks,
Alok

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

* Re: [External] : Re: [PATCH net-next] udp_tunnel: Fix typo using netdev_WARN instead of netdev_warn
  2025-09-04 13:45   ` [External] : " ALOK TIWARI
@ 2025-09-04 14:28     ` Jakub Kicinski
  2025-09-04 14:41       ` ALOK TIWARI
  2025-09-04 18:48     ` Simon Horman
  1 sibling, 1 reply; 7+ messages in thread
From: Jakub Kicinski @ 2025-09-04 14:28 UTC (permalink / raw)
  To: ALOK TIWARI; +Cc: Simon Horman, dsahern, davem, edumazet, pabeni, netdev

On Thu, 4 Sep 2025 19:15:57 +0530 ALOK TIWARI wrote:
> since WARN() triggers backtrace and dumps the file name
> it is not require here. The failure in udp_tunnel_nic_register()
> should just be treated as an expected operation failure, not as a kernel bug

You keep saying that without really explaining why.
I can make a guess, but the motivation should really be part of 
the commit msg.

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

* Re: [External] : Re: [PATCH net-next] udp_tunnel: Fix typo using netdev_WARN instead of netdev_warn
  2025-09-04 14:28     ` Jakub Kicinski
@ 2025-09-04 14:41       ` ALOK TIWARI
  2025-09-04 15:52         ` Jakub Kicinski
  0 siblings, 1 reply; 7+ messages in thread
From: ALOK TIWARI @ 2025-09-04 14:41 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: Simon Horman, dsahern, davem, edumazet, pabeni, netdev



On 9/4/2025 7:58 PM, Jakub Kicinski wrote:
> On Thu, 4 Sep 2025 19:15:57 +0530 ALOK TIWARI wrote:
>> since WARN() triggers backtrace and dumps the file name
>> it is not require here. The failure in udp_tunnel_nic_register()
>> should just be treated as an expected operation failure, not as a kernel bug
> 
> You keep saying that without really explaining why.
> I can make a guess, but the motivation should really be part of
> the commit msg.


Thanks Jakub.

Thanks for pointing that out.

I was referring to the comment in include/linux/netdevice.h
which notes that netdev_WARN() uses WARN/WARN_ON to print
a backtrace along with file/line information.

In this case, udp_tunnel_nic_register() returning an error is
just a failed operation, not a kernel bug. So a simple warning
message is appropriate, and netdev_warn() should be used
instead of netdev_WARN().
That is my understanding here.

https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/tree/include/linux/netdevice.h#n5525

Thanks,
Alok

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

* Re: [External] : Re: [PATCH net-next] udp_tunnel: Fix typo using netdev_WARN instead of netdev_warn
  2025-09-04 14:41       ` ALOK TIWARI
@ 2025-09-04 15:52         ` Jakub Kicinski
  0 siblings, 0 replies; 7+ messages in thread
From: Jakub Kicinski @ 2025-09-04 15:52 UTC (permalink / raw)
  To: ALOK TIWARI; +Cc: Simon Horman, dsahern, davem, edumazet, pabeni, netdev

On Thu, 4 Sep 2025 20:11:36 +0530 ALOK TIWARI wrote:
> In this case, udp_tunnel_nic_register() returning an error is
> just a failed operation, not a kernel bug. So a simple warning
> message is appropriate, and netdev_warn() should be used
> instead of netdev_WARN().

The distinction should be that WARN is only used in cases which
author of the code expects never to occur.

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

* Re: [External] : Re: [PATCH net-next] udp_tunnel: Fix typo using netdev_WARN instead of netdev_warn
  2025-09-04 13:45   ` [External] : " ALOK TIWARI
  2025-09-04 14:28     ` Jakub Kicinski
@ 2025-09-04 18:48     ` Simon Horman
  1 sibling, 0 replies; 7+ messages in thread
From: Simon Horman @ 2025-09-04 18:48 UTC (permalink / raw)
  To: ALOK TIWARI; +Cc: dsahern, davem, edumazet, kuba, pabeni, netdev

On Thu, Sep 04, 2025 at 07:15:57PM +0530, ALOK TIWARI wrote:
> 
> 
> On 9/4/2025 2:48 PM, Simon Horman wrote:
> > On Wed, Sep 03, 2025 at 12:57:12PM -0700, Alok Tiwari wrote:
> > > There is no condition being tested, so it should be netdev_warn,
> > > not netdev_WARN. Using netdev_WARN here is a typo or misuse.
> > 
> > Hi Alok,
> > 
> > I agree that using netdev_warn() seems more appropriate.
> > 
> > But doesn't the difference between netdev_warn() and netdev_WARN()
> > lie in the output they produce rather than testing of a condition
> > (or not)?
> > 
> > > 
> > > Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
> > 
> > ...
> 
> Thanks Simon, agreed, I understand your point.
> 
> since WARN() triggers backtrace and dumps the file name
> it is not require here. The failure in udp_tunnel_nic_register()
> should just be treated as an expected operation failure, not as a kernel bug
> 
> Should I send a v2 with an updated commit message
> (remove "condition being tested"), or drop these changes?”
> 
> 
> Thanks for your review.

Thanks Alok,

I think the change itself is good.
And I'd resubmit with an updated commit message.

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

end of thread, other threads:[~2025-09-04 18:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-03 19:57 [PATCH net-next] udp_tunnel: Fix typo using netdev_WARN instead of netdev_warn Alok Tiwari
2025-09-04  9:18 ` Simon Horman
2025-09-04 13:45   ` [External] : " ALOK TIWARI
2025-09-04 14:28     ` Jakub Kicinski
2025-09-04 14:41       ` ALOK TIWARI
2025-09-04 15:52         ` Jakub Kicinski
2025-09-04 18:48     ` Simon Horman

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 NNTP newsgroup(s).