All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yunsheng Lin <linyunsheng@huawei.com>
To: Tanner Love <tannerlove.kernel@gmail.com>, <netdev@vger.kernel.org>
Cc: <davem@davemloft.net>, Tanner Love <tannerlove@google.com>,
	Eric Dumazet <edumazet@google.com>,
	Mahesh Bandewar <maheshb@google.com>
Subject: Re: [PATCH net-next 3/3] net: update netdev_rx_csum_fault() print dump only once
Date: Fri, 23 Apr 2021 08:42:45 +0800	[thread overview]
Message-ID: <ab70ee56-5188-6bcc-819e-8d022552ed81@huawei.com> (raw)
In-Reply-To: <20210422194738.2175542-4-tannerlove.kernel@gmail.com>

On 2021/4/23 3:47, Tanner Love wrote:
> From: Tanner Love <tannerlove@google.com>
> 
> Printing this stack dump multiple times does not provide additional
> useful information, and consumes time in the data path. Printing once
> is sufficient.
> 
> Signed-off-by: Tanner Love <tannerlove@google.com>
> Acked-by: Eric Dumazet <edumazet@google.com>
> Acked-by: Mahesh Bandewar <maheshb@google.com>
> ---
>  net/core/dev.c | 10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/net/core/dev.c b/net/core/dev.c
> index d9bf63dbe4fd..26b82b5d8563 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -148,6 +148,7 @@
>  #include <net/devlink.h>
>  #include <linux/pm_runtime.h>
>  #include <linux/prandom.h>
> +#include <linux/once.h>
>  
>  #include "net-sysfs.h"
>  
> @@ -3487,13 +3488,16 @@ EXPORT_SYMBOL(__skb_gso_segment);
>  
>  /* Take action when hardware reception checksum errors are detected. */
>  #ifdef CONFIG_BUG
> -void netdev_rx_csum_fault(struct net_device *dev, struct sk_buff *skb)
> +static void do_netdev_rx_csum_fault(struct net_device *dev, struct sk_buff *skb)
>  {
> -	if (net_ratelimit()) {
>  		pr_err("%s: hw csum failure\n", dev ? dev->name : "<unknown>");
>  		skb_dump(KERN_ERR, skb, true);
>  		dump_stack();

Once the "if ()" is removed, one level of indent seems enough?

> -	}
> +}
> +
> +void netdev_rx_csum_fault(struct net_device *dev, struct sk_buff *skb)
> +{
> +	DO_ONCE_LITE(do_netdev_rx_csum_fault, dev, skb);
>  }
>  EXPORT_SYMBOL(netdev_rx_csum_fault);
>  #endif
> 


      reply	other threads:[~2021-04-23  0:42 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-22 19:47 [PATCH net-next 0/3] net: update netdev_rx_csum_fault() print dump only once Tanner Love
2021-04-22 19:47 ` [PATCH net-next 1/3] once: implement DO_ONCE_LITE for non-fast-path "do once" functionality Tanner Love
2021-04-22 19:47 ` [PATCH net-next 2/3] once: replace uses of __section(".data.once") with DO_ONCE_LITE(_IF)? Tanner Love
2021-04-22 21:23   ` kernel test robot
2021-04-22 21:23     ` kernel test robot
2021-04-22 22:28   ` kernel test robot
2021-04-22 22:28     ` kernel test robot
2021-04-22 22:28   ` kernel test robot
2021-04-22 22:28     ` kernel test robot
2021-04-22 19:47 ` [PATCH net-next 3/3] net: update netdev_rx_csum_fault() print dump only once Tanner Love
2021-04-23  0:42   ` Yunsheng Lin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ab70ee56-5188-6bcc-819e-8d022552ed81@huawei.com \
    --to=linyunsheng@huawei.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=maheshb@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=tannerlove.kernel@gmail.com \
    --cc=tannerlove@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.