OSDN Git Service

bnxt_en: Pass correct extended TX port statistics size to firmware.
authorMichael Chan <michael.chan@broadcom.com>
Fri, 26 Apr 2019 02:31:53 +0000 (22:31 -0400)
committerDavid S. Miller <davem@davemloft.net>
Sat, 27 Apr 2019 21:00:19 +0000 (17:00 -0400)
commitad361adf0d08f1135f3845c6b3a36be7cc0bfda5
treeef41bd54eb9414a29d2fe81377077aba65b7c8d2
parent1f83391bd6fc48f92f627b0ec0bce686d100c6a5
bnxt_en: Pass correct extended TX port statistics size to firmware.

If driver determines that extended TX port statistics are not supported
or allocation of the data structure fails, make sure to pass 0 TX stats
size to firmware to disable it.  The firmware returned TX stats size should
also be set to 0 for consistency.  This will prevent
bnxt_get_ethtool_stats() from accessing the NULL TX stats pointer in
case there is mismatch between firmware and driver.

Fixes: 36e53349b60b ("bnxt_en: Add additional extended port statistics.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt.c