summaryrefslogtreecommitdiff
path: root/net/ethtool/privflags.c
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2023-04-21 02:33:02 +0300
committerJakub Kicinski <kuba@kernel.org>2023-04-25 04:09:49 +0300
commit00d0f31a1ec8eb3e4d692bdf2455daf0fb865bb3 (patch)
treec84b007b7541fee91aa42b66b6beb51fbf1e6804 /net/ethtool/privflags.c
parent086c161678b8cc291aa21ff8ef2b53df83ee44aa (diff)
downloadlinux-00d0f31a1ec8eb3e4d692bdf2455daf0fb865bb3.tar.xz
net: ethtool: coalesce: try to make user settings stick twice
SET_COALESCE may change operation mode and parameters in one call. Changing operation mode may cause the driver to reset the parameter values to what is a reasonable default for new operation mode. Since driver does not know which parameters come from user and which are echoed back from ->get, driver may ignore the parameters when switching operation modes. This used to be inevitable for ioctl() but in netlink we know which parameters are actually specified by the user. We could inform which parameters were set by the user but this would lead to a lot of code duplication in the drivers. Instead try to call the drivers twice if both mode and params are changed. The set method already checks if any params need updating so in case the driver did the right thing the first time around - there will be no second call to it's ->set method (only an extra call to ->get()). For mlx5 for example before this patch we'd see: # ethtool -C eth0 adaptive-rx on adaptive-tx on # ethtool -C eth0 adaptive-rx off adaptive-tx off \ tx-usecs 123 rx-usecs 123 Adaptive RX: off TX: off rx-usecs: 3 rx-frames: 32 tx-usecs: 16 tx-frames: 32 [...] After the change: # ethtool -C eth0 adaptive-rx on adaptive-tx on # ethtool -C eth0 adaptive-rx off adaptive-tx off \ tx-usecs 123 rx-usecs 123 Adaptive RX: off TX: off rx-usecs: 123 rx-frames: 32 tx-usecs: 123 tx-frames: 32 [...] This only works for netlink, so it's a small discrepancy between netlink and ioctl(). Since we anticipate most users to move to netlink I believe it's worth making their lives easier. Link: https://lore.kernel.org/r/20230420233302.944382-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ethtool/privflags.c')
0 files changed, 0 insertions, 0 deletions