]> git.baikalelectronics.ru Git - kernel.git/commit
ethtool: Account for hw_features in netlink interface
authorMaxim Mikityanskiy <maximmi@mellanox.com>
Mon, 17 Aug 2020 13:34:06 +0000 (16:34 +0300)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Aug 2020 23:00:24 +0000 (16:00 -0700)
commitd6e584c15fd2e7b36382dd4bcb28cbca6f260e5f
tree1e8a439e207074c349f35d36b53b6c7ebab8f870
parent0368fa5e4f67df164e4c3e05bb96510474183d01
ethtool: Account for hw_features in netlink interface

ethtool-netlink ignores dev->hw_features and may confuse the drivers by
asking them to enable features not in the hw_features bitmask. For
example:

1. ethtool -k eth0
   tls-hw-tx-offload: off [fixed]
2. ethtool -K eth0 tls-hw-tx-offload on
   tls-hw-tx-offload: on
3. ethtool -k eth0
   tls-hw-tx-offload: on [fixed]

Fitler out dev->hw_features from req_wanted to fix it and to resemble
the legacy ethtool behavior.

Fixes: 9357892b26e0 ("ethtool: set netdev features with FEATURES_SET request")
Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
Reviewed-by: Michal Kubecek <mkubecek@suse.cz>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ethtool/features.c