ethtool: pause: make sure we init driver stats
authorJakub Kicinski <kuba@kernel.org>
Wed, 14 Apr 2021 03:46:14 +0000 (20:46 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 21 Apr 2021 11:00:57 +0000 (13:00 +0200)
commit1aec111c944fc0d29ba48385d56d229f4f8bac90
tree110142d4480d00368533c66aa9cda05877856cb4
parent44ef38c0a2b37975e7677ad7f23271a006564908
ethtool: pause: make sure we init driver stats

commit 16756d3e77ad58cd07e36cbed724aa13ae5a0278 upstream.

The intention was for pause statistics to not be reported
when driver does not have the relevant callback (only
report an empty netlink nest). What happens currently
we report all 0s instead. Make sure statistics are
initialized to "not set" (which is -1) so the dumping
code skips them.

Fixes: 9a27a33027f2 ("ethtool: add standard pause stats")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ethtool/pause.c