bnxt_en: parse and report result field when NVRAM package install fails
authorKalesh AP <kalesh-anakkur.purayil@broadcom.com>
Fri, 13 May 2022 02:40:24 +0000 (22:40 -0400)
committerDavid S. Miller <davem@davemloft.net>
Fri, 13 May 2022 11:47:40 +0000 (12:47 +0100)
commitab0bed4bf6fae8a42cf3b08b38e1fffb1a79193a
tree1f635a7932475bbeb9e15086772789c429daea52
parent66ed81dcedc665bf8c7dfc3867d425f50eba219e
bnxt_en: parse and report result field when NVRAM package install fails

Instead of always returning -ENOPKG, decode the firmware error
code further when the HWRM_NVM_INSTALL_UPDATE firmware call fails.
Return a more suitable error code to userspace and log an error
in dmesg.

This is version 2 of the earlier patch that was reverted:

02acd399533e ("bnxt_en: parse result field when NVRAM package install fails")

In this new version, if the call is made through devlink instead of
ethtool, we'll also set the error message in extack.

Link: https://lore.kernel.org/netdev/20220307141358.4d52462e@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com/
Reviewed-by: Somnath Kotur <somnath.kotur@broadcom.com>
Reviewed-by: Pavan Chebbi <pavan.chebbi@broadcom.com>
Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h