From mboxrd@z Thu Jan 1 00:00:00 1970 From: Cong Wang Subject: Re: [Patch net-next 2/2] net: dump whole skb data in netdev_rx_csum_fault() Date: Thu, 22 Nov 2018 17:43:36 -0800 Message-ID: References: <20181121021309.6595-1-xiyou.wangcong@gmail.com> <20181121021309.6595-2-xiyou.wangcong@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Cc: Eric Dumazet , Linux Kernel Network Developers , Herbert Xu , David Miller To: Eric Dumazet Return-path: Received: from mail-pl1-f193.google.com ([209.85.214.193]:40408 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733028AbeKWMZ4 (ORCPT ); Fri, 23 Nov 2018 07:25:56 -0500 Received: by mail-pl1-f193.google.com with SMTP id b22-v6so9902646pls.7 for ; Thu, 22 Nov 2018 17:43:49 -0800 (PST) In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On Wed, Nov 21, 2018 at 10:26 AM Eric Dumazet wrote: > > On Wed, Nov 21, 2018 at 10:17 AM Cong Wang wrote: > > > > On Wed, Nov 21, 2018 at 5:05 AM Eric Dumazet wrote: > > > > > > > > > > > > On 11/20/2018 06:13 PM, Cong Wang wrote: > > > > Currently, we only dump a few selected skb fields in > > > > netdev_rx_csum_fault(). It is not suffient for debugging checksum > > > > fault. This patch introduces skb_dump() which dumps skb mac header, > > > > network header and its whole skb->data too. > > > > > > > > Cc: Herbert Xu > > > > Cc: Eric Dumazet > > > > Cc: David Miller > > > > Signed-off-by: Cong Wang > > > > --- > > > > > > > > > > + print_hex_dump(level, "skb data: ", DUMP_PREFIX_OFFSET, 16, 1, > > > > + skb->data, skb->len, false); > > > > > > As I mentioned to David, we want all the bytes that were maybe already pulled > > > > > > (skb->head starting point, not skb->data) > > > > Hmm, with mac header and network header, it is effectively from skb->head, no? > > Is there anything between skb->head and mac header? > > Oh, I guess we wanted a single hex dump, or we need some user program > to be able to > rebuild from different memory zones the original CHECKSUM_COMPLETE value. Yeah, I can remove the prefix and dump the complete packet as one single block. This means I also need to check where skb->data points to. > > > > > > > > > Also we will miss the trimmed bytes if there were padding data. > > > And it seems the various bugs we have are all tied to the pulled or trimmed bytes. > > > > > > > Unless I miss something, the tailing padding data should be in range > > [iphdr->tot_len, skb->len]. No? > > > Not after we did the pskb_trim_rcsum() call, since it has effectively > reduced skb->len by the number of padding bytes. Sure, this patch can't change where netdev_rx_csum_fault() gets called. We either need to move the checksum validation earlier, or move the trimming later, none of them belongs to this patch. Thanks.