Skip to content

Commit

Permalink
net: update netdev_rx_csum_fault() print dump only once
Browse files Browse the repository at this point in the history
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: Tanner Love <[email protected]>
Acked-by: Eric Dumazet <[email protected]>
Acked-by: Mahesh Bandewar <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
tannerlove authored and davem330 committed Jun 28, 2021
1 parent a358f40 commit 127d735
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions net/core/dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -3487,13 +3488,16 @@ EXPORT_SYMBOL(__skb_gso_segment);

/* Take action when hardware reception checksum errors are detected. */
#ifdef CONFIG_BUG
static void do_netdev_rx_csum_fault(struct net_device *dev, struct sk_buff *skb)
{
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)
{
if (net_ratelimit()) {
pr_err("%s: hw csum failure\n", dev ? dev->name : "<unknown>");
skb_dump(KERN_ERR, skb, true);
dump_stack();
}
DO_ONCE_LITE(do_netdev_rx_csum_fault, dev, skb);
}
EXPORT_SYMBOL(netdev_rx_csum_fault);
#endif
Expand Down

0 comments on commit 127d735

Please sign in to comment.