mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: linyunsheng@huawei.com
Cc: huangdaode@hisilicon.com, xuwei5@hisilicon.com,
	liguozhu@hisilicon.com, Yisen.Zhuang@huawei.com,
	gabriele.paoloni@huawei.com, john.garry@huawei.com,
	linuxarm@huawei.com, salil.mehta@huawei.com,
	lipeng321@huawei.com, tremyfr@gmail.com, netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net 1/3] net: hns: Add TX CSUM check when fill TX description
Date: Tue, 04 Jul 2017 03:28:33 -0700 (PDT)	[thread overview]
Message-ID: <20170704.032833.2030036660842556798.davem@davemloft.net> (raw)
In-Reply-To: <1499165253-184543-2-git-send-email-linyunsheng@huawei.com>

From: Lin Yun Sheng <linyunsheng@huawei.com>
Date: Tue, 4 Jul 2017 18:47:31 +0800

> From: Yunsheng Lin <linyunsheng@huawei.com>
> 
> If driver support checksum offload, should check netdev feature
> before fill TX description and get CSUM err bit from RX
> description. HNS driver do the check in RX derction but it doesn't
> do the check in TX direction.
> 
> Signed-off-by: lipeng <lipeng321@huawei.com>
> Reviewed-by: Daode Huang <huangdaode@hisilicon.com>
> Reviewed-by: Yunsheng Lin <linyunsheng@huawei.com>

This is not correct.

You should be checking the skb->checksum field to decide if you should
offload the TX checksum of the packet or not.

Correct drivers, as far as I am aware, do not check the feature flags
so I wonder where you got this idea from.  Always use other well
established existing drivers as a model for how to handle things like
this.

And this makes sense.  An SKB can have it's checksumming determination
made first, then the netdev feature change is made afterwards.  For
correctness you still need to TX checksum offload that SKB otherwise
it will be emitted without a correctly computed checksum.

Thank you.

  reply	other threads:[~2017-07-04 10:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-04 10:47 [PATCH net 0/3] Bugfixs for hns ethernet driver Lin Yun Sheng
2017-07-04 10:47 ` [PATCH net 1/3] net: hns: Add TX CSUM check when fill TX description Lin Yun Sheng
2017-07-04 10:28   ` David Miller [this message]
2017-07-05  8:28     ` Yunsheng Lin
2017-07-04 10:47 ` [PATCH net 2/3] net: hns: Fix a wrong op phy C45 code Lin Yun Sheng
2017-07-04 10:47 ` [PATCH net 3/3] net: hns: Fix a skb used after free bug Lin Yun Sheng
2017-07-04 16:56 ` [PATCH net 0/3] Bugfixs for hns ethernet driver Florian Fainelli
2017-07-05  8:30   ` Yunsheng Lin

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=20170704.032833.2030036660842556798.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=Yisen.Zhuang@huawei.com \
    --cc=gabriele.paoloni@huawei.com \
    --cc=huangdaode@hisilicon.com \
    --cc=john.garry@huawei.com \
    --cc=liguozhu@hisilicon.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=linyunsheng@huawei.com \
    --cc=lipeng321@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=tremyfr@gmail.com \
    --cc=xuwei5@hisilicon.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

all inboxes | Powered by JetHome®