Commit 127d7355 authored by Tanner Love's avatar Tanner Love Committed by David S. Miller
Browse files

net: update netdev_rx_csum_fault() print dump only once



Printing this stack dump multiple times does not provide additional
useful information, and consumes time in the data path. Printing once
is sufficient.

Changes
  v2: Format indentation properly

Signed-off-by: default avatarTanner Love <tannerlove@google.com>
Acked-by: default avatarEric Dumazet <edumazet@google.com>
Acked-by: default avatarMahesh Bandewar <maheshb@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a358f406
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -148,6 +148,7 @@
#include <net/devlink.h>
#include <linux/pm_runtime.h>
#include <linux/prandom.h>
#include <linux/once_lite.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();
}

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