netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Benc <jbenc@redhat.com>
To: Govindarajulu Varadarajan <_govind@gmx.com>
Cc: Jay Vosburgh <jay.vosburgh@canonical.com>,
	Eric Dumazet <eric.dumazet@gmail.com>,
	davem@davemloft.net, netdev@vger.kernel.org, ssujith@cisco.com,
	benve@cisco.com, Stefan Assmann <sassmann@redhat.com>
Subject: Re: [PATCH net] enic: fix rx skb checksum
Date: Fri, 19 Dec 2014 12:07:57 +0100	[thread overview]
Message-ID: <20141219120757.106c02d4@griffin> (raw)
In-Reply-To: <alpine.LNX.2.03.1412191548001.2860@ws.cisco>

On Fri, 19 Dec 2014 16:22:34 +0530 (IST), Govindarajulu Varadarajan wrote:
> Hardware returns 0xffff for non tcp/udp packets.

That explains that I saw that with ICMP packets.

> For tcp/udp packet it returns
> pseudo checksum. Not the _whole_ pkt checksum.

I see. I didn't get this from your patch, although you wrote it there,
sorry. And I didn't dig that deep while debugging, I was satisfied with
seeing 0xffff for the packets that caused problems :-)

> Dec 18 11:13:18 a163 kernel: enic: saddr=96d8690a, daddr=a3ba6a0a, length=40, proto=6
> Dec 18 11:13:18 a163 kernel: enic: hw_checksum = c457, pseudo_checksum_32=3a930115, pseudo_checksum_fold=c457
> 
> Dec 18 11:13:18 a163 kernel: enic: saddr=a37410a, daddr=a3ba6a0a, length=32, proto=6
> Dec 18 11:13:18 a163 kernel: enic: hw_checksum = 80f9, pseudo_checksum_32=adf1d114, pseudo_checksum_fold=80f9
> 
> Dec 18 11:13:18 a163 kernel: enic: saddr=a37410a, daddr=a3ba6a0a, length=32, proto=6
> Dec 18 11:13:18 a163 kernel: enic: hw_checksum = 80f9, pseudo_checksum_32=adf1d114, pseudo_checksum_fold=80f9
> 
> Clearly hw is returning folded pseudo checksum.

Indeed.

> > I have no idea whether the hardware verified the checksum for the
> > 0xffff case and is just not returning the checksum or whether such
> > packets come completely unverified.
> 
> Yes, hardware verifies the checksum and sets tcp_udp_csum_ok flag to 1.
> If pkt verification fails or pkt is not tcp/udp, tcp_udp_csum_ok is 0. And we
> send the pkt to stack with CHECKSUM_NONE.

Thanks for the confirmation.

> Driver should use CHECKSUM_COMPLETE only if it can produce _whole_ pkt checksum.
> as described in include/linux/skbuff.h:75

Sure. I just misunderstood what the hardware provides.

> I am trying to fix "Do not set CHECKSUM_COMPLETE, when driver does not have
> checksum of whole pkt."
> 
> Is my understanding correct?

With the information you've just written (thanks for your patience),
I think your patch is correct.

Thanks a lot!

 Jiri

-- 
Jiri Benc

  reply	other threads:[~2014-12-19 11:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-12-18 10:28 [PATCH net] enic: fix rx skb checksum Govindarajulu Varadarajan
2014-12-18 13:58 ` Sergei Shtylyov
2014-12-18 16:26 ` Eric Dumazet
2014-12-18 17:39   ` Jay Vosburgh
2014-12-18 17:49     ` David Miller
2014-12-19 10:07     ` Jiri Benc
2014-12-19 10:52       ` Govindarajulu Varadarajan
2014-12-19 11:07         ` Jiri Benc [this message]
2014-12-19 11:11 ` Jiri Benc
2014-12-19 20:45   ` 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=20141219120757.106c02d4@griffin \
    --to=jbenc@redhat.com \
    --cc=_govind@gmx.com \
    --cc=benve@cisco.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jay.vosburgh@canonical.com \
    --cc=netdev@vger.kernel.org \
    --cc=sassmann@redhat.com \
    --cc=ssujith@cisco.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).