Skip to content

Commit 127d735

Browse files
tannerlovedavem330
authored andcommitted
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: Tanner Love <[email protected]> Acked-by: Eric Dumazet <[email protected]> Acked-by: Mahesh Bandewar <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a358f40 commit 127d735

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

net/core/dev.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@
148148
#include <net/devlink.h>
149149
#include <linux/pm_runtime.h>
150150
#include <linux/prandom.h>
151+
#include <linux/once_lite.h>
151152

152153
#include "net-sysfs.h"
153154

@@ -3487,13 +3488,16 @@ EXPORT_SYMBOL(__skb_gso_segment);
34873488

34883489
/* Take action when hardware reception checksum errors are detected. */
34893490
#ifdef CONFIG_BUG
3491+
static void do_netdev_rx_csum_fault(struct net_device *dev, struct sk_buff *skb)
3492+
{
3493+
pr_err("%s: hw csum failure\n", dev ? dev->name : "<unknown>");
3494+
skb_dump(KERN_ERR, skb, true);
3495+
dump_stack();
3496+
}
3497+
34903498
void netdev_rx_csum_fault(struct net_device *dev, struct sk_buff *skb)
34913499
{
3492-
if (net_ratelimit()) {
3493-
pr_err("%s: hw csum failure\n", dev ? dev->name : "<unknown>");
3494-
skb_dump(KERN_ERR, skb, true);
3495-
dump_stack();
3496-
}
3500+
DO_ONCE_LITE(do_netdev_rx_csum_fault, dev, skb);
34973501
}
34983502
EXPORT_SYMBOL(netdev_rx_csum_fault);
34993503
#endif

0 commit comments

Comments
 (0)