All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: xiyou.wangcong@gmail.com, herbert@gondor.apana.org.au,
	netdev@vger.kernel.org, tom@herbertland.com, edumazet@google.com,
	saeedm@mellanox.com
Subject: Re: [Patch net] net: invert the check of detecting hardware RX checksum fault
Date: Tue, 20 Nov 2018 10:13:40 -0800 (PST)	[thread overview]
Message-ID: <20181120.101340.1401026987466664720.davem@davemloft.net> (raw)
In-Reply-To: <ea0aec4d-9051-cd04-4524-bcd747312216@gmail.com>

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 19 Nov 2018 17:47:33 -0800

> 
> 
> On 11/19/2018 05:42 PM, Cong Wang wrote:
>> On Fri, Nov 16, 2018 at 12:15 PM Cong Wang <xiyou.wangcong@gmail.com> wrote:
>>>
>>> On Thu, Nov 15, 2018 at 8:52 PM Eric Dumazet <eric.dumazet@gmail.com> wrote:
>>>>
>>>> You could use trafgen to cook such a frame and confirm the theory.
>>>>
>>>> Something like :
>>>
>>> I will try it.
>> 
>> I just tried it, it doesn't make much difference, the warning only
>> shows up once after I ran the trafgen script for many times,
>> it could be triggered by other daemons running on the host too.
> 
> 
> I guess we will need to dump the whole packet for debugging,
> as suggest by Herbert :/

Something like this?  Is it safe to linearize here?

diff --git a/net/core/dev.c b/net/core/dev.c
index f2bfd2eda7b2..3955939cc0cf 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -3094,6 +3094,8 @@ EXPORT_SYMBOL(__skb_gso_segment);
 void netdev_rx_csum_fault(struct net_device *dev, struct sk_buff *skb)
 {
 	if (net_ratelimit()) {
+		static unsigned long last_full_pkt_dump = ~0UL;
+
 		pr_err("%s: hw csum failure\n", dev ? dev->name : "<unknown>");
 		if (dev)
 			pr_err("dev features: %pNF\n", &dev->features);
@@ -3102,6 +3104,13 @@ void netdev_rx_csum_fault(struct net_device *dev, struct sk_buff *skb)
 		       skb_shinfo(skb)->gso_size, skb_shinfo(skb)->gso_type,
 		       skb_shinfo(skb)->nr_frags, skb->ip_summed, skb->csum,
 		       skb->csum_complete_sw, skb->csum_valid, skb->csum_level);
+		if (jiffies - last_full_pkt_dump >= (HZ * 60 * 5) &&
+		    !skb_linearize(skb)) {
+			last_full_pkt_dump = jiffies;
+			print_hex_dump(KERN_ERR, "skb data: ",
+				       DUMP_PREFIX_OFFSET, 32, 1,
+				       skb->data, skb->len, false);
+		}
 		dump_stack();
 	}
 }

  reply	other threads:[~2018-11-21  4:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-15 23:16 [Patch net] net: invert the check of detecting hardware RX checksum fault Cong Wang
2018-11-16  1:52 ` Herbert Xu
2018-11-16  2:23   ` Cong Wang
2018-11-16  4:50     ` Herbert Xu
2018-11-16 20:06       ` Cong Wang
2018-11-16 21:32         ` Cong Wang
2018-11-19  4:01           ` Herbert Xu
2018-11-19 19:25             ` Cong Wang
2018-11-20  3:09               ` Herbert Xu
2018-11-22  1:25         ` Paweł Staszewski
2018-11-16  4:52     ` Eric Dumazet
2018-11-16  4:59       ` Herbert Xu
2018-11-16 20:10         ` Cong Wang
2018-11-16 20:15       ` Cong Wang
2018-11-16 21:33         ` Eric Dumazet
2018-11-20  1:42         ` Cong Wang
2018-11-20  1:47           ` Eric Dumazet
2018-11-20 18:13             ` David Miller [this message]
2018-11-20 18:18               ` Eric Dumazet
2018-11-21  3:35                 ` Herbert Xu
2018-11-18  0:40   ` David Miller

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=20181120.101340.1401026987466664720.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@mellanox.com \
    --cc=tom@herbertland.com \
    --cc=xiyou.wangcong@gmail.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.