]> www.infradead.org Git - users/hch/misc.git/commit
net: ethtool: add hds_config member in ethtool_netdev_state
authorTaehee Yoo <ap420073@gmail.com>
Tue, 14 Jan 2025 14:28:43 +0000 (14:28 +0000)
committerJakub Kicinski <kuba@kernel.org>
Wed, 15 Jan 2025 22:42:11 +0000 (14:42 -0800)
commit197258f0ef685ddbd534254dc79f49faa47dc93d
tree799d20cb2d1cf8c9bfb0f4341b0ff4502f9f7267
parent2248c05340a6aa449efa4b12fca7ce490f32bda9
net: ethtool: add hds_config member in ethtool_netdev_state

When tcp-data-split is UNKNOWN mode, drivers arbitrarily handle it.
For example, bnxt_en driver automatically enables if at least one of
LRO/GRO/JUMBO is enabled.
If tcp-data-split is UNKNOWN and LRO is enabled, a driver returns
ENABLES of tcp-data-split, not UNKNOWN.
So, `ethtool -g eth0` shows tcp-data-split is enabled.

The problem is in the setting situation.
In the ethnl_set_rings(), it first calls get_ringparam() to get the
current driver's config.
At that moment, if driver's tcp-data-split config is UNKNOWN, it returns
ENABLE if LRO/GRO/JUMBO is enabled.
Then, it sets values from the user and driver's current config to
kernel_ethtool_ringparam.
Last it calls .set_ringparam().
The driver, especially bnxt_en driver receives
ETHTOOL_TCP_DATA_SPLIT_ENABLED.
But it can't distinguish whether it is set by the user or just the
current config.

When user updates ring parameter, the new hds_config value is updated
and current hds_config value is stored to old_hdsconfig.
Driver's .set_ringparam() callback can distinguish a passed
tcp-data-split value is came from user explicitly.
If .set_ringparam() is failed, hds_config is rollbacked immediately.

Suggested-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Taehee Yoo <ap420073@gmail.com>
Link: https://patch.msgid.link/20250114142852.3364986-2-ap420073@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/ethtool.h
include/linux/netdevice.h
net/core/dev.c
net/ethtool/rings.c