mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net v3 0/1] brief description about the patch and its
@ 2026-10-04 13:39 taozj888
  2026-10-04 13:39 ` [PATCH net v3 1/1] net: macb: rate limit netdev error info print in the data path taozj888
  2026-10-06 21:23 ` [PATCH net v3 0/1] brief description about the patch and its Jacob Keller
  0 siblings, 2 replies; 5+ messages in thread
From: taozj888 @ 2026-10-04 13:39 UTC (permalink / raw)
  To: theo.lebrun
  Cc: taozijin, Conor Dooley, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Haavard Skinnemoen,
	Jeff Garzik, open list:NETWORKING DRIVERS, open list

From: taozijin <taozj888@163.com>


This patch is titled as:
  net: macb: rate limit netdev error info print in the data path

Changes since v1:

v3: 
- add this change log since v2 missing it
- drop the blank line between the assignment sentence and the commit
  info

v2:

- update the commit message with the reason why the unlimit prints would
  bother/delay booting process
- update the commit message with the Fix commit id provided which is
  suggested by Théo Lebrun<theo.lebrun@bootlin.com>
- update the commit message with what packet type would trigger the
  error printings more easily.

v1:

- initial commit


Best Regards,

Zijin Tao
 drivers/net/ethernet/cadence/macb_main.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

-- 
2.34.1


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

* [PATCH net v3 1/1] net: macb: rate limit netdev error info print in the data path
  2026-10-04 13:39 [PATCH net v3 0/1] brief description about the patch and its taozj888
@ 2026-10-04 13:39 ` taozj888
  2026-10-06 21:25   ` Jacob Keller
  2026-10-06 21:23 ` [PATCH net v3 0/1] brief description about the patch and its Jacob Keller
  1 sibling, 1 reply; 5+ messages in thread
From: taozj888 @ 2026-10-04 13:39 UTC (permalink / raw)
  To: theo.lebrun
  Cc: taozijin, stable, Conor Dooley, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Haavard Skinnemoen,
	Jeff Garzik, open list:NETWORKING DRIVERS, open list

From: taozijin <taozj888@163.com>

Now the MACB ethernet driver print the netdev error information
directly by netdev_err(), which would lead to a large number of
error information print if there was a significant number of
error or just jumbo packets exceeding the MTU received when booting.
For example, it would print a large number of:

macb PHYT0036:00 eth0: not whole frame pointed by descriptor
macb PHYT0036:00 eth0: not whole frame pointed by descriptor
...

in gem_rx() by having received a large number of packets without
RX_EOF flag set, especially with unknown packet
type that would penetrate the hardware offload for the IP packets.

The unlimited prints here would greatly bother and delay
the system booting process unless the source stop sending
packets since they occupy the console output bandwidth and
other processes have to wait for the completion of printing those
messages.

So rate limit the netdev error information print in the receive
and transmit data path.

Fixes: 89e5785fc8a6 ("[PATCH] Atmel MACB ethernet driver")
Cc: stable@vger.kernel.org
Signed-off-by: Zijin Tao <taozj888@163.com>
---
 drivers/net/ethernet/cadence/macb_main.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
index 8e5c034dc3a4..ca60960bec36 100644
--- a/drivers/net/ethernet/cadence/macb_main.c
+++ b/drivers/net/ethernet/cadence/macb_main.c
@@ -1617,16 +1617,16 @@ static int gem_rx(struct macb_queue *queue, struct napi_struct *napi,
 		count++;
 
 		if (!(ctrl & MACB_BIT(RX_SOF) && ctrl & MACB_BIT(RX_EOF))) {
-			netdev_err(bp->netdev,
-				   "not whole frame pointed by descriptor\n");
+			if (net_ratelimit())
+				netdev_err(bp->netdev, "not whole frame pointed by descriptor\n");
 			bp->netdev->stats.rx_dropped++;
 			queue->stats.rx_dropped++;
 			break;
 		}
 		skb = queue->rx_skbuff[entry];
 		if (unlikely(!skb)) {
-			netdev_err(bp->netdev,
-				   "inconsistent Rx descriptor chain\n");
+			if (net_ratelimit())
+				netdev_err(bp->netdev, "inconsistent Rx descriptor chain\n");
 			bp->netdev->stats.rx_dropped++;
 			queue->stats.rx_dropped++;
 			break;
@@ -1829,7 +1829,8 @@ static int macb_rx(struct macb_queue *queue, struct napi_struct *napi,
 		unsigned long flags;
 		u32 ctrl;
 
-		netdev_err(bp->netdev, "RX queue corruption: reset it\n");
+		if (net_ratelimit())
+			netdev_err(bp->netdev, "RX queue corruption: reset it\n");
 
 		spin_lock_irqsave(&bp->lock, flags);
 
@@ -2102,7 +2103,8 @@ static int macb_interrupt_misc(struct macb_queue *queue, u32 status)
 
 	if (status & MACB_BIT(HRESP)) {
 		queue_work(system_bh_wq, &bp->hresp_err_bh_work);
-		netdev_err(netdev, "DMA bus error: HRESP not OK\n");
+		if (net_ratelimit())
+			netdev_err(netdev, "DMA bus error: HRESP not OK\n");
 		macb_queue_isr_clear(bp, queue, MACB_BIT(HRESP));
 	}
 
-- 
2.34.1


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

* Re: [PATCH net v3 0/1] brief description about the patch and its
  2026-10-04 13:39 [PATCH net v3 0/1] brief description about the patch and its taozj888
  2026-10-04 13:39 ` [PATCH net v3 1/1] net: macb: rate limit netdev error info print in the data path taozj888
@ 2026-10-06 21:23 ` Jacob Keller
  2026-10-07  5:55   ` taozj888
  1 sibling, 1 reply; 5+ messages in thread
From: Jacob Keller @ 2026-10-06 21:23 UTC (permalink / raw)
  To: taozj888, theo.lebrun
  Cc: Conor Dooley, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Haavard Skinnemoen, Jeff Garzik,
	open list:NETWORKING DRIVERS, open list

On 10/4/2026 6:39 AM, taozj888@163.com wrote:
> From: taozijin <taozj888@163.com>
> 
> 
> This patch is titled as:
>   net: macb: rate limit netdev error info print in the data path
> 
> Changes since v1:
> 
> v3: 
> - add this change log since v2 missing it
> - drop the blank line between the assignment sentence and the commit
>   info
> 
> v2:
> 
> - update the commit message with the reason why the unlimit prints would
>   bother/delay booting process
> - update the commit message with the Fix commit id provided which is
>   suggested by Théo Lebrun<theo.lebrun@bootlin.com>
> - update the commit message with what packet type would trigger the
>   error printings more easily.
> 
> v1:
> 
> - initial commit
> 

For single patches, it is typical to send this as part of the same
message below your commit message with '---'.

To make that easier to handle, if you use git format-patch and git
send-email you can use --annotate with git send-email to insert the
contents before sending the email. If you use b4, it will automatically
generate the correct format from its cover letter and the individual patch.

If you do send a standalone cover letter, the subject would be better as
just repeating the subject for the individual patch.

I don't recall if netdev has any enforced or encoded policy here, so
this is just a comment to hopefully help ease future contributions.

Thanks,
Jake

> Best Regards,
> 
> Zijin Tao
>  drivers/net/ethernet/cadence/macb_main.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 


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

* Re: [PATCH net v3 1/1] net: macb: rate limit netdev error info print in the data path
  2026-10-04 13:39 ` [PATCH net v3 1/1] net: macb: rate limit netdev error info print in the data path taozj888
@ 2026-10-06 21:25   ` Jacob Keller
  0 siblings, 0 replies; 5+ messages in thread
From: Jacob Keller @ 2026-10-06 21:25 UTC (permalink / raw)
  To: taozj888, theo.lebrun
  Cc: stable, Conor Dooley, Andrew Lunn, David S. Miller, Eric Dumazet,
	Jakub Kicinski, Paolo Abeni, Haavard Skinnemoen, Jeff Garzik,
	open list:NETWORKING DRIVERS, open list

On 10/4/2026 6:39 AM, taozj888@163.com wrote:
> From: taozijin <taozj888@163.com>
> 
> Now the MACB ethernet driver print the netdev error information
> directly by netdev_err(), which would lead to a large number of
> error information print if there was a significant number of
> error or just jumbo packets exceeding the MTU received when booting.
> For example, it would print a large number of:
> 
> macb PHYT0036:00 eth0: not whole frame pointed by descriptor
> macb PHYT0036:00 eth0: not whole frame pointed by descriptor
> ...
> 
> in gem_rx() by having received a large number of packets without
> RX_EOF flag set, especially with unknown packet
> type that would penetrate the hardware offload for the IP packets.
> 
> The unlimited prints here would greatly bother and delay
> the system booting process unless the source stop sending
> packets since they occupy the console output bandwidth and
> other processes have to wait for the completion of printing those
> messages.
> 
> So rate limit the netdev error information print in the receive
> and transmit data path.
> 
> Fixes: 89e5785fc8a6 ("[PATCH] Atmel MACB ethernet driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Zijin Tao <taozj888@163.com>
> ---
>  drivers/net/ethernet/cadence/macb_main.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c
> index 8e5c034dc3a4..ca60960bec36 100644
> --- a/drivers/net/ethernet/cadence/macb_main.c
> +++ b/drivers/net/ethernet/cadence/macb_main.c
> @@ -1617,16 +1617,16 @@ static int gem_rx(struct macb_queue *queue, struct napi_struct *napi,
>  		count++;
>  
>  		if (!(ctrl & MACB_BIT(RX_SOF) && ctrl & MACB_BIT(RX_EOF))) {
> -			netdev_err(bp->netdev,
> -				   "not whole frame pointed by descriptor\n");
> +			if (net_ratelimit())
> +				netdev_err(bp->netdev, "not whole frame pointed by descriptor\n");

I am surprised that there is no equivalent of netdev_err_ratelimited
like there is for dev_err_ratelimited.

Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>

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

* Re:Re: [PATCH net v3 0/1] brief description about the patch and its
  2026-10-06 21:23 ` [PATCH net v3 0/1] brief description about the patch and its Jacob Keller
@ 2026-10-07  5:55   ` taozj888
  0 siblings, 0 replies; 5+ messages in thread
From: taozj888 @ 2026-10-07  5:55 UTC (permalink / raw)
  To: Jacob Keller
  Cc: theo.lebrun, Conor Dooley, Andrew Lunn, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Haavard Skinnemoen,
	Jeff Garzik, open list:NETWORKING DRIVERS, open list















Hi Jacob:

Thanks.
Zijin Tao

At 2026-10-07 05:23:33, "Jacob Keller" <jacob.e.keller@intel.com> wrote:
>On 10/4/2026 6:39 AM, taozj888@163.com wrote:
>> From: taozijin <taozj888@163.com>
>> 
>> 
>> This patch is titled as:
>>   net: macb: rate limit netdev error info print in the data path
>> 
>> Changes since v1:
>> 
>> v3: 
>> - add this change log since v2 missing it
>> - drop the blank line between the assignment sentence and the commit
>>   info
>> 
>> v2:
>> 
>> - update the commit message with the reason why the unlimit prints would
>>   bother/delay booting process
>> - update the commit message with the Fix commit id provided which is
>>   suggested by Théo Lebrun<theo.lebrun@bootlin.com>
>> - update the commit message with what packet type would trigger the
>>   error printings more easily.
>> 
>> v1:
>> 
>> - initial commit
>> 
>
>For single patches, it is typical to send this as part of the same

>message below your commit message with '---'.


OK, I will add the changelog in the commit message below '---' in the next patch.>
>To make that easier to handle, if you use git format-patch and git
>send-email you can use --annotate with git send-email to insert the
>contents before sending the email. If you use b4, it will automatically
>generate the correct format from its cover letter and the individual patch.
>
>If you do send a standalone cover letter, the subject would be better as
>just repeating the subject for the individual patch.
>
>I don't recall if netdev has any enforced or encoded policy here, so
>this is just a comment to hopefully help ease future contributions.
>
>Thanks,
>Jake
>
>> Best Regards,
>> 
>> Zijin Tao
>>  drivers/net/ethernet/cadence/macb_main.c | 14 ++++++++------
>>  1 file changed, 8 insertions(+), 6 deletions(-)
>> 

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

end of thread, other threads:[~2026-10-07  5:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-04 13:39 [PATCH net v3 0/1] brief description about the patch and its taozj888
2026-10-04 13:39 ` [PATCH net v3 1/1] net: macb: rate limit netdev error info print in the data path taozj888
2026-10-06 21:25   ` Jacob Keller
2026-10-06 21:23 ` [PATCH net v3 0/1] brief description about the patch and its Jacob Keller
2026-10-07  5:55   ` taozj888

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®