Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1680848

Re: [PATCH net 1/3] net: hns: Add TX CSUM check when fill TX description

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: [PATCH net 1/3] net: hns: Add TX CSUM check when fill TX description
Date 2017-07-04 12:30 +0200
Message-ID <tZtfJ-6Ye-21@gated-at.bofh.it> (permalink)
References <tZt61-6UJ-7@gated-at.bofh.it> <tZt61-6UJ-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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.

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH net 1/3] net: hns: Add TX CSUM check when fill TX description Lin Yun Sheng <linyunsheng@huawei.com> - 2017-07-04 12:20 +0200
  Re: [PATCH net 1/3] net: hns: Add TX CSUM check when fill TX  description David Miller <davem@davemloft.net> - 2017-07-04 12:30 +0200
    Re: [PATCH net 1/3] net: hns: Add TX CSUM check when fill TX  description Yunsheng Lin <linyunsheng@huawei.com> - 2017-07-05 10:30 +0200

csiph-web