[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20181120.101340.1401026987466664720.davem@davemloft.net>
Date: Tue, 20 Nov 2018 10:13:40 -0800 (PST)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: xiyou.wangcong@...il.com, herbert@...dor.apana.org.au,
netdev@...r.kernel.org, tom@...bertland.com, edumazet@...gle.com,
saeedm@...lanox.com
Subject: Re: [Patch net] net: invert the check of detecting hardware RX
checksum fault
From: Eric Dumazet <eric.dumazet@...il.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@...il.com> wrote:
>>>
>>> On Thu, Nov 15, 2018 at 8:52 PM Eric Dumazet <eric.dumazet@...il.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();
}
}
Powered by blists - more mailing lists