All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tariq Toukan <ttoukan.linux@gmail.com>
To: Eric Dumazet <edumazet@google.com>,
	Herbert Xu <herbert@gondor.apana.org.au>
Cc: Tariq Toukan <tariqt@nvidia.com>,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>,
	Moshe Shemesh <moshe@nvidia.com>,
	Maxim Mikityanskiy <maximmi@nvidia.com>,
	Saeed Mahameed <saeedm@nvidia.com>
Subject: Re: [PATCH net] netdevice.h: Fix unintentional disable of ALL_FOR_ALL features on upper device
Date: Thu, 26 Nov 2020 14:01:07 +0200	[thread overview]
Message-ID: <c96d41dd-3679-c76f-2e3a-cb3fb0cfd6c3@gmail.com> (raw)
In-Reply-To: <CANn89iLTsTgW9UPFn_LNN5Qvs9+0drfcW2cQHtCVYMoboHdv4Q@mail.gmail.com>



On 11/25/2020 11:27 AM, Eric Dumazet wrote:
> On Wed, Nov 25, 2020 at 10:06 AM Tariq Toukan <ttoukan.linux@gmail.com> wrote:
>>
>>
>>
>> On 11/25/2020 5:25 AM, Herbert Xu wrote:
>>> On Tue, Nov 24, 2020 at 11:48:35AM +0100, Eric Dumazet wrote:
>>>>
>>>> Well, the 'increment' part was suggesting the function was adding
>>>> flags, not removing them.
>>>
>>> The idea of the increment part is that we're adding a constituent
>>> device, not that we're adding features.  There have always been
>>> features which were conjunctions, i.e., they must be supported by
>>> all underlying devices for them to be enabled on the virtual device.
>>>
>>> Your use of the increment function is unusual, as you're not adding
>>> features that belong to one underlying device, but rather you're
>>> trying to enable a feature on the virtual device unconditionally.
> 
> This was not the intent.
> 
> We can still disable TSO on the bonding device if desired.
> 
> pk51:~# for i in bond0 eth1 eth2; do ethtool -k $i|grep
> tcp-segmentation-offload; done
> tcp-segmentation-offload: on
> tcp-segmentation-offload: on
> tcp-segmentation-offload: on
> lpk51:~# ethtool -K bond0 tso off
> Actual changes:
> tcp-segmentation-offload: off
> tx-tcp-segmentation: off
> tx-tcp-ecn-segmentation: off
> tx-tcp-mangleid-segmentation: off
> tx-tcp6-segmentation: off
> large-receive-offload: off [requested on]
> lpk51:~# for i in bond0 eth1 eth2; do ethtool -k $i|grep
> tcp-segmentation-offload; done
> tcp-segmentation-offload: off
> tcp-segmentation-offload: on
> tcp-segmentation-offload: on
> 
> The intent was that we could have :
> 
> lpk51:~# ethtool -K bond0 tso on
> Actual changes:
> tcp-segmentation-offload: on
> tx-tcp-segmentation: on
> tx-tcp-ecn-segmentation: on
> tx-tcp-mangleid-segmentation: on
> tx-tcp6-segmentation: on
> lpk51:~# ethtool -K eth1 tso off
> lpk51:~# ethtool -K eth2 tso off
> lpk51:~# for i in bond0 eth1 eth2; do ethtool -k $i|grep
> tcp-segmentation-offload; done
> tcp-segmentation-offload: on
> tcp-segmentation-offload: off
> tcp-segmentation-offload: off
> lpk51:~#
> 
> 

IIUC, we want to let the bond TSO feature bit be totally independent, 
not affected by slaves.
If so, I think that:
First we should take NETIF_F_GSO_SOFTWARE (or just NETIF_F_ALL_TSO) out 
of NETIF_F_ONE_FOR_ALL.
Then, make sure it is set in bond_setup (it is already done, as part of 
BOND_VLAN_FEATURES).

I think this new logic is good for all other upper devices, which will 
be affected by the change in NETIF_F_ONE_FOR_ALL.


>>>
>>>> We might ask Herbert Xu if we :
>>>>
>>>> 1) Need to comment the function, or change its name to be more descriptive.
>>>> 2) Change the behavior (as you suggested)
>>>> 3) Other choice.
>>>
>>> I think Tariq's patch is fine, although a comment should be added
>>> to netdev_add_tso_features as this use of the increment function
>>> is nonstandard.
>>>
>>
>> Thanks Herbert, I'll add a comment and re-spin.
> 
> I think we should remove the use of  netdev_increment_features() and
> replace it with something else,
> because there is too much confusion.
> 

I think it would be best.

I can prepare the patch I described above if you agree with it.

      reply	other threads:[~2020-11-26 12:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-23 14:12 [PATCH net] netdevice.h: Fix unintentional disable of ALL_FOR_ALL features on upper device Tariq Toukan
2020-11-23 14:55 ` Eric Dumazet
2020-11-23 16:15   ` Tariq Toukan
2020-11-24 10:48     ` Eric Dumazet
2020-11-24 14:30       ` Tariq Toukan
2020-11-25  3:25       ` Herbert Xu
2020-11-25  9:06         ` Tariq Toukan
2020-11-25  9:27           ` Eric Dumazet
2020-11-26 12:01             ` Tariq Toukan [this message]

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=c96d41dd-3679-c76f-2e3a-cb3fb0cfd6c3@gmail.com \
    --to=ttoukan.linux@gmail.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kuba@kernel.org \
    --cc=maximmi@nvidia.com \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@nvidia.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.