]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
bnxt_en: Fix ethtool -d byte order for 32-bit values
authorMichael Chan <michael.chan@broadcom.com>
Mon, 28 Apr 2025 22:59:03 +0000 (15:59 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 May 2025 07:44:01 +0000 (09:44 +0200)
commit252a5a67adc7d6763c558d97e21850a33fe44ba1
treea56c3dd3aba565316457265c419e8c70e7f905e1
parent4d69864915a3a052538e4ba76cd6fd77cfc64ebe
bnxt_en: Fix ethtool -d byte order for 32-bit values

[ Upstream commit 02e8be5a032cae0f4ca33c6053c44d83cf4acc93 ]

For version 1 register dump that includes the PCIe stats, the existing
code incorrectly assumes that all PCIe stats are 64-bit values.  Fix it
by using an array containing the starting and ending index of the 32-bit
values.  The loop in bnxt_get_regs() will use the array to do proper
endian swap for the 32-bit values.

Fixes: b5d600b027eb ("bnxt_en: Add support for 'ethtool -d'")
Reviewed-by: Shruti Parab <shruti.parab@broadcom.com>
Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Reviewed-by: Andy Gospodarek <andrew.gospodarek@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c