diff mbox series

[net] bnxt_en: Make PTP timestamp HWRM more silent

Message ID 20240125134104.2045573-1-leitao@debian.org (mailing list archive)
State Accepted
Commit 281cb9d65a95c00bb844f332cd187491d2d55496
Delegated to: Netdev Maintainers
Headers show
Series [net] bnxt_en: Make PTP timestamp HWRM more silent | expand

Checks

Context Check Description
netdev/series_format success Single patches do not need cover letters
netdev/tree_selection success Clearly marked for net
netdev/ynl success SINGLE THREAD; Generated files up to date; no warnings/errors; no diff in generated;
netdev/fixes_present fail Series targets non-next tree, but doesn't contain any Fixes tags
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 1064 this patch: 1064
netdev/build_tools success No tools touched, skip
netdev/cc_maintainers success CCed 0 of 0 maintainers
netdev/build_clang success Errors and warnings before: 1081 this patch: 1081
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/deprecated_api success None detected
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 1081 this patch: 1081
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_clang_rust success No Rust files in patch. Skipping build
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
netdev/contest success net-next-2024-01-26--21-00 (tests: 610)

Commit Message

Breno Leitao Jan. 25, 2024, 1:41 p.m. UTC
commit 056bce63c469 ("bnxt_en: Make PTP TX timestamp HWRM query silent")
changed a netdev_err() to netdev_WARN_ONCE().

netdev_WARN_ONCE() is it generates a kernel WARNING, which is bad, for
the following reasons:

 * You do not a kernel warning if the firmware queries are late
 * In busy networks, timestamp query failures fairly regularly
 * A WARNING message doesn't bring much value, since the code path
is clear.
(This was discussed in-depth in [1])

Transform the netdev_WARN_ONCE() into a netdev_warn_once(), and print a
more well-behaved message, instead of a full WARN().

	bnxt_en 0000:67:00.0 eth0: TS query for TX timer failed rc = fffffff5

[1] Link: https://lore.kernel.org/all/ZbDj%2FFI4EJezcfd1@gmail.com/
Signed-off-by: Breno Leitao <leitao@debian.org>
---
 drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pavan Chebbi Jan. 25, 2024, 2:33 p.m. UTC | #1
On Thu, Jan 25, 2024 at 7:11 PM Breno Leitao <leitao@debian.org> wrote:
>
> commit 056bce63c469 ("bnxt_en: Make PTP TX timestamp HWRM query silent")
> changed a netdev_err() to netdev_WARN_ONCE().
>
> netdev_WARN_ONCE() is it generates a kernel WARNING, which is bad, for
> the following reasons:
>
>  * You do not a kernel warning if the firmware queries are late
>  * In busy networks, timestamp query failures fairly regularly
>  * A WARNING message doesn't bring much value, since the code path
> is clear.
> (This was discussed in-depth in [1])
>
> Transform the netdev_WARN_ONCE() into a netdev_warn_once(), and print a
> more well-behaved message, instead of a full WARN().
>
>         bnxt_en 0000:67:00.0 eth0: TS query for TX timer failed rc = fffffff5
>
> [1] Link: https://lore.kernel.org/all/ZbDj%2FFI4EJezcfd1@gmail.com/
> Signed-off-by: Breno Leitao <leitao@debian.org>

LGTM, however, you may still need to add a proper fixes tag.
Breno Leitao Jan. 25, 2024, 2:53 p.m. UTC | #2
On Thu, Jan 25, 2024 at 08:03:18PM +0530, Pavan Chebbi wrote:
> On Thu, Jan 25, 2024 at 7:11 PM Breno Leitao <leitao@debian.org> wrote:
> >
> > commit 056bce63c469 ("bnxt_en: Make PTP TX timestamp HWRM query silent")
> > changed a netdev_err() to netdev_WARN_ONCE().
> >
> > netdev_WARN_ONCE() is it generates a kernel WARNING, which is bad, for
> > the following reasons:
> >
> >  * You do not a kernel warning if the firmware queries are late
> >  * In busy networks, timestamp query failures fairly regularly
> >  * A WARNING message doesn't bring much value, since the code path
> > is clear.
> > (This was discussed in-depth in [1])
> >
> > Transform the netdev_WARN_ONCE() into a netdev_warn_once(), and print a
> > more well-behaved message, instead of a full WARN().
> >
> >         bnxt_en 0000:67:00.0 eth0: TS query for TX timer failed rc = fffffff5
> >
> > [1] Link: https://lore.kernel.org/all/ZbDj%2FFI4EJezcfd1@gmail.com/
> > Signed-off-by: Breno Leitao <leitao@debian.org>
> 
> LGTM, however, you may still need to add a proper fixes tag.

Thanks. I didn't include a fix tag because it is not a fix per se, but,
I can easily send a v2 if this is needed.
Pavan Chebbi Jan. 25, 2024, 3:21 p.m. UTC | #3
On Thu, Jan 25, 2024 at 8:23 PM Breno Leitao <leitao@debian.org> wrote:
>
> On Thu, Jan 25, 2024 at 08:03:18PM +0530, Pavan Chebbi wrote:
> > On Thu, Jan 25, 2024 at 7:11 PM Breno Leitao <leitao@debian.org> wrote:
> > >
> > > commit 056bce63c469 ("bnxt_en: Make PTP TX timestamp HWRM query silent")
> > > changed a netdev_err() to netdev_WARN_ONCE().
> > >
> > > netdev_WARN_ONCE() is it generates a kernel WARNING, which is bad, for
> > > the following reasons:
> > >
> > >  * You do not a kernel warning if the firmware queries are late
> > >  * In busy networks, timestamp query failures fairly regularly
> > >  * A WARNING message doesn't bring much value, since the code path
> > > is clear.
> > > (This was discussed in-depth in [1])
> > >
> > > Transform the netdev_WARN_ONCE() into a netdev_warn_once(), and print a
> > > more well-behaved message, instead of a full WARN().
> > >
> > >         bnxt_en 0000:67:00.0 eth0: TS query for TX timer failed rc = fffffff5
> > >
> > > [1] Link: https://lore.kernel.org/all/ZbDj%2FFI4EJezcfd1@gmail.com/
> > > Signed-off-by: Breno Leitao <leitao@debian.org>
> >
> > LGTM, however, you may still need to add a proper fixes tag.
>
> Thanks. I didn't include a fix tag because it is not a fix per se, but,
> I can easily send a v2 if this is needed.

You have a point. But then in that case it should go to net-next, I think.
If you respin or otherwise,
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Jakub Kicinski Jan. 25, 2024, 5:44 p.m. UTC | #4
On Thu, 25 Jan 2024 20:51:25 +0530 Pavan Chebbi wrote:
> > > LGTM, however, you may still need to add a proper fixes tag.  
> >
> > Thanks. I didn't include a fix tag because it is not a fix per se, but,
> > I can easily send a v2 if this is needed.  

We should pick it as a fix. If we put it in net-next and someone
complains cherry-picking it into net would be a PITA. And we shouldn't
spew WARN()s about known-to-be-occurring conditions, GregKH is pretty
clear about that.

If you can post the Fixes tag in a reply our apply scripts should pick
it up automatically. Or at least mine will :)
Michael Chan Jan. 25, 2024, 5:58 p.m. UTC | #5
On Thu, Jan 25, 2024 at 9:44 AM Jakub Kicinski <kuba@kernel.org> wrote:
>
> On Thu, 25 Jan 2024 20:51:25 +0530 Pavan Chebbi wrote:
> > > > LGTM, however, you may still need to add a proper fixes tag.
> > >
> > > Thanks. I didn't include a fix tag because it is not a fix per se, but,
> > > I can easily send a v2 if this is needed.
>
> We should pick it as a fix. If we put it in net-next and someone
> complains cherry-picking it into net would be a PITA. And we shouldn't
> spew WARN()s about known-to-be-occurring conditions, GregKH is pretty
> clear about that.
>
> If you can post the Fixes tag in a reply our apply scripts should pick
> it up automatically. Or at least mine will :)

Fixes: 056bce63c469 ("bnxt_en: Make PTP TX timestamp HWRM query silent")
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
patchwork-bot+netdevbpf@kernel.org Jan. 26, 2024, 10:10 p.m. UTC | #6
Hello:

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

On Thu, 25 Jan 2024 05:41:03 -0800 you wrote:
> commit 056bce63c469 ("bnxt_en: Make PTP TX timestamp HWRM query silent")
> changed a netdev_err() to netdev_WARN_ONCE().
> 
> netdev_WARN_ONCE() is it generates a kernel WARNING, which is bad, for
> the following reasons:
> 
>  * You do not a kernel warning if the firmware queries are late
>  * In busy networks, timestamp query failures fairly regularly
>  * A WARNING message doesn't bring much value, since the code path
> is clear.
> (This was discussed in-depth in [1])
> 
> [...]

Here is the summary with links:
  - [net] bnxt_en: Make PTP timestamp HWRM more silent
    https://git.kernel.org/netdev/net/c/281cb9d65a95

You are awesome, thank you!
diff mbox series

Patch

diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
index adad188e38b8..cc07660330f5 100644
--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
+++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
@@ -684,7 +684,7 @@  static void bnxt_stamp_tx_skb(struct bnxt *bp, struct sk_buff *skb)
 		timestamp.hwtstamp = ns_to_ktime(ns);
 		skb_tstamp_tx(ptp->tx_skb, &timestamp);
 	} else {
-		netdev_WARN_ONCE(bp->dev,
+		netdev_warn_once(bp->dev,
 				 "TS query for TX timer failed rc = %x\n", rc);
 	}