Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: tanhuazhong <tanhuazhong@huawei.com>
To: Willem de Bruijn <willemdebruijn.kernel@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>
Cc: David Miller <davem@davemloft.net>,
	Network Development <netdev@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	<salil.mehta@huawei.com>, <yisen.zhuang@huawei.com>,
	<linuxarm@huawei.com>
Subject: Re: [PATCH net-next 0/2] net: two updates related to UDP GSO
Date: Mon, 7 Sep 2020 21:32:22 +0800	[thread overview]
Message-ID: <126e5424-2453-eef4-d5b6-adeaedbb6eca@huawei.com> (raw)
In-Reply-To: <CA+FuTSfeEuTLAGJZkzoMUvx+0j3dY265i8okPLyDO6S-8KHdbQ@mail.gmail.com>



On 2020/9/7 17:22, Willem de Bruijn wrote:
> On Sun, Sep 6, 2020 at 8:42 PM Jakub Kicinski <kuba@kernel.org> wrote:
>>
>> On Sat, 5 Sep 2020 14:11:11 +0800 Huazhong Tan wrote:
>>> There are two updates relates to UDP GSO.
>>> #1 adds a new GSO type for UDPv6
>>> #2 adds check for UDP GSO when csum is disable in netdev_fix_features().
>>>
>>> Changes since RFC V2:
>>> - modifies the timing of setting UDP GSO type when doing UDP GRO in #1.
>>>
>>> Changes since RFC V1:
>>> - updates NETIF_F_GSO_LAST suggested by Willem de Bruijn.
>>>    and add NETIF_F_GSO_UDPV6_L4 feature for each driver who support UDP GSO in #1.
>>>    - add #2 who needs #1.
>>
>> Please CC people who gave you feedback (Willem).
>>
>> I don't feel good about this series. IPv6 is not optional any more.
>> AFAIU you have some issues with csum support in your device? Can you
>> use .ndo_features_check() to handle this?
>>
>> The change in semantics of NETIF_F_GSO_UDP_L4 from "v4 and v6" to
>> "just v4" can trip people over; this is not a new feature people
>> may be depending on the current semantics.
>>
>> Willem, what are your thoughts on this?
> 
> If that is the only reason, +1 on fixing it up in the driver's
> ndo_features_check.
> 

Hi, Willem & Jakub.

This series mainly fixes the feature dependency between hardware 
checksum and UDP GSO.
When turn off hardware checksum offload, run 'ethtool -k [devname]'
we can see TSO is off as well, but udp gso still is on.

[root@localhost ~]# ethtool -K eth0 tx off
Actual changes:
tx-checksumming: off
	tx-checksum-ipv4: off
	tx-checksum-ipv6: off
	tx-checksum-sctp: off
tcp-segmentation-offload: off
	tx-tcp-segmentation: off [requested on]
	tx-tcp-ecn-segmentation: off [requested on]
	tx-tcp6-segmentation: off [requested on]
[root@localhost ~]# ethtool -k eth0
Features for eth0:
rx-checksumming: on
tx-checksumming: off
	tx-checksum-ipv4: off
	tx-checksum-ip-generic: off [fixed]
	tx-checksum-ipv6: off
	tx-checksum-fcoe-crc: off [fixed]
	tx-checksum-sctp: off
...
tcp-segmentation-offload: off
	tx-tcp-segmentation: off [requested on]
	tx-tcp-ecn-segmentation: off [requested on]
	tx-tcp-mangleid-segmentation: off
	tx-tcp6-segmentation: off [requested on]
udp-fragmentation-offload: off
generic-segmentation-offload: on
generic-receive-offload: on
...
tx-udp-segmentation: on
...

.ndo_feature_check seems unnecessary.
Because the stack has already do this check.
in __ip_append_data() below if branch will not run if hardware checksum 
offload is off.
         if (transhdrlen &&
             length + fragheaderlen <= mtu &&
             rt->dst.dev->features & (NETIF_F_HW_CSUM | NETIF_F_IP_CSUM) &&
             (!(flags & MSG_MORE) || cork->gso_size) &&
             (!exthdrlen || (rt->dst.dev->features & 
NETIF_F_HW_ESP_TX_CSUM)))
                 csummode = CHECKSUM_PARTIAL;
...
so skb->ip_summed set as CHECKSUM_NONE,
then in udp_send_skb()
         if (cork->gso_size) {
		...
                 if (skb->ip_summed != CHECKSUM_PARTIAL || is_udplite ||
                     dst_xfrm(skb_dst(skb))) {
                         kfree_skb(skb); 
 

                         return -EIO;
                 }
the packet who needs udp gso will return ERROR.

For this kind of problem how could we fix it?

Thanks.
Huazhong.

> .
> 


  reply	other threads:[~2020-09-07 13:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-05  6:11 Huazhong Tan
2020-09-05  6:11 ` [PATCH net-next 1/2] udp: add a GSO type for UDPv6 Huazhong Tan
2020-09-05  6:11 ` [PATCH net-next 2/2] net: disable UDP GSO features when CSUM is disable Huazhong Tan
2020-09-06 18:41 ` [PATCH net-next 0/2] net: two updates related to UDP GSO Jakub Kicinski
2020-09-07  9:22   ` Willem de Bruijn
2020-09-07 13:32     ` tanhuazhong [this message]
2020-09-07 15:35       ` Willem de Bruijn
2020-09-08  2:32         ` tanhuazhong
2020-09-08  7:24           ` Willem de Bruijn

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=126e5424-2453-eef4-d5b6-adeaedbb6eca@huawei.com \
    --to=tanhuazhong@huawei.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=salil.mehta@huawei.com \
    --cc=willemdebruijn.kernel@gmail.com \
    --cc=yisen.zhuang@huawei.com \
    --subject='Re: [PATCH net-next 0/2] net: two updates related to UDP GSO' \
    /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

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).