All of lore.kernel.org
 help / color / mirror / Atom feed
From: tanhuazhong <tanhuazhong@huawei.com>
To: Eric Dumazet <eric.dumazet@gmail.com>, <davem@davemloft.net>,
	<willemb@google.com>
Cc: <netdev@vger.kernel.org>, <linuxarm@huawei.com>, <kuba@kernel.org>
Subject: Re: [RFC net-next 2/2] net: disable UDP GSO feature when CSUM is disabled
Date: Thu, 9 Jul 2020 10:30:35 +0800	[thread overview]
Message-ID: <7529a39a-de9a-0ea9-152c-e1fca64be157@huawei.com> (raw)
In-Reply-To: <7d7ed503-3d23-29f6-0fbe-b240064d4eea@gmail.com>



On 2020/7/8 13:36, Eric Dumazet wrote:
> 
> 
> On 7/7/20 8:48 PM, Huazhong Tan wrote:
>> Since UDP GSO feature is depended on checksum offload, so disable
>> UDP GSO feature when CSUM is disabled, then from user-space also
>> can see UDP GSO feature is disabled.
>>
>> Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
>> ---
>>   net/core/dev.c | 6 ++++++
>>   1 file changed, 6 insertions(+)
>>
>> diff --git a/net/core/dev.c b/net/core/dev.c
>> index c02bae9..dcb6b35 100644
>> --- a/net/core/dev.c
>> +++ b/net/core/dev.c
>> @@ -9095,6 +9095,12 @@ static netdev_features_t netdev_fix_features(struct net_device *dev,
>>   		features &= ~NETIF_F_TSO6;
>>   	}
>>   
>> +	if ((features & NETIF_F_GSO_UDP_L4) && !(features & NETIF_F_HW_CSUM) &&
>> +	    (!(features & NETIF_F_IP_CSUM) || !(features & NETIF_F_IPV6_CSUM))) {
> 
> This would prevent a device providing IPv4 checksum only (no IPv6 csum support) from sending IPv4 UDP GSO packets ?
> 

Yes, not like TCP (who uses NETIF_F_TSO for IPv4 and NETIF_F_TSO6 for IPv6),
UDP only has a NETIF_F_GSO_UDP_L4 for both IPv4 and IPv6.
I cannot find a better way to do it with combined IPv4 and IPv6 csum 
together.
For this issue, is there any good idea to fix it?

>> +		netdev_dbg(dev, "Dropping UDP GSO features since no CSUM feature.\n");
>> +		features &= ~NETIF_F_GSO_UDP_L4;
>> +	}
>> +
>>   	/* TSO with IPv4 ID mangling requires IPv4 TSO be enabled */
>>   	if ((features & NETIF_F_TSO_MANGLEID) && !(features & NETIF_F_TSO))
>>   		features &= ~NETIF_F_TSO_MANGLEID;
>>
> 
> 


  reply	other threads:[~2020-07-09  2:30 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-08  3:48 [RFC net-next 0/2] net: two updates related to UDP GSO Huazhong Tan
2020-07-08  3:48 ` [RFC net-next 1/2] udp: add NETIF_F_GSO_UDP_L4 to NETIF_F_SOFTWARE_GSO Huazhong Tan
2020-07-08  5:26   ` Eric Dumazet
2020-07-09  2:16     ` tanhuazhong
2020-07-09  2:28       ` Eric Dumazet
2020-07-08 12:11   ` Willem de Bruijn
2020-07-09  2:49     ` tanhuazhong
2020-07-09 13:34       ` Willem de Bruijn
2020-07-08  3:48 ` [RFC net-next 2/2] net: disable UDP GSO feature when CSUM is disabled Huazhong Tan
2020-07-08  5:36   ` Eric Dumazet
2020-07-09  2:30     ` tanhuazhong [this message]
2020-07-09  2:47       ` Eric Dumazet
2020-07-09  2:55         ` tanhuazhong

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=7529a39a-de9a-0ea9-152c-e1fca64be157@huawei.com \
    --to=tanhuazhong@huawei.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=willemb@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.