]> git.baikalelectronics.ru Git - kernel.git/commit
ethtool: fix ethtool msg len calculation for pause stats
authorJakub Kicinski <kuba@kernel.org>
Tue, 2 Nov 2021 22:02:36 +0000 (15:02 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 3 Nov 2021 11:20:45 +0000 (11:20 +0000)
commitb360ff2c7574b041c3c5e83f677ffb718c4509ea
tree4429f5c426d59b7935ace911ca4e77eb32a133a8
parent29593930a2b9fcefc50be8c84dd8c9cb5703fba5
ethtool: fix ethtool msg len calculation for pause stats

ETHTOOL_A_PAUSE_STAT_MAX is the MAX attribute id,
so we need to subtract non-stats and add one to
get a count (IOW -2+1 == -1).

Otherwise we'll see:

  ethnl cmd 21: calculated reply length 40, but consumed 52

Fixes: 72da277b46bd ("ethtool: add standard pause stats")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Reviewed-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/linux/ethtool_netlink.h
include/uapi/linux/ethtool_netlink.h
net/ethtool/pause.c