ice: do not abort devlink info if board identifier can't be found
Subsystems (3)
Tony Nguyen
maintainerPATCH v2 1/1 ice: do not abort devlink info if board identifier can't be found
From: Jacob Keller <[email protected]>
The devlink dev info command reports version information about the device and firmware running on the board. This includes the "board.id" field which is supposed to represent an identifier of the board design. The ice driver uses the Product Board Assembly identifier for this.
In some cases, the PBA is not present in the NVM. If this happens, devlink dev info will fail with an error. Instead, modify the ice_info_pba function to just exit without filling in the context buffer. This will cause the board.id field to be skipped. Log a dev_dbg message in case someone wants to confirm why board.id is not showing up for them.
---
v2:
- Removed refactors - to be submitted later as separate patch through net-next
- Changed 'PBA' to 'board identifier' in title
drivers/net/ethernet/intel/ice/ice_devlink.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/ice/ice_devlink.c +3 -1
@@ -42,7 +42,9 @@ static int ice_info_pba(struct ice_pf *pf, struct ice_info_ctx *ctx) status =ice_read_pba_string (hw, (u8 *)ctx->buf,sizeof (ctx->buf));if (status) -return -EIO ; +/* We failed to locate the PBA, so just skip this entry */ +dev_dbg (ice_pf_to_dev (pf),"Failed to read Product Board Assembly string, status %s\n" , +ice_stat_str (status));return 0 ; }
Signature · 1 line
2.26.2
Quoted 26 lines
-----Original Message-----
From: Nguyen, Anthony L <[email protected]>
Sent: Thursday, August 19, 2021 3:35 PM
To: [email protected]; [email protected]
Cc: Keller, Jacob E <[email protected]>; [email protected]; Nguyen, Anthony L <[email protected]>; Brelinski, TonyX <[email protected]>
Subject: [PATCH net v2 1/1] ice: do not abort devlink info if board identifier can't be foundFrom: Jacob Keller <[email protected]>
The devlink dev info command reports version information about the device and firmware running on the board. This includes the "board.id" field which is supposed to represent an identifier of the board design. The ice driver uses the Product Board Assembly identifier for this.
In some cases, the PBA is not present in the NVM. If this happens, devlink dev info will fail with an error. Instead, modify the
ice_info_pbafunction to just exit without filling in the context buffer. This will cause the board.id field to be skipped. Log adev_dbgmessage in case someone wants to confirm why board.id is not showing up for them.
Quoted 5 lines
Fixes e961b679fb0b ("ice: add board identifier info to devlink .info_get")Signed-off-by Jacob Keller <[email protected]>Tested-by Tony Brelinski <[email protected]>Signed-off-by Tony Nguyen <[email protected]>---
Ack! Thanks for taking up the work to split this, Tony! I really appreciate it.
(Thanks also Kuba for helping make a clean net-fix, this is definitely the better approach!)
Regards,
Jake
Quoted 27 lines
v2:
- Removed refactors - to be submitted later as separate patch through net-next
- Changed 'PBA' to 'board identifier' in titledrivers/net/ethernet/intel/ice/ice_devlink.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/net/ethernet/intel/ice/ice_devlink.c +3
-1@@ -42,7 +42,9 @@ static int ice_info_pba(struct ice_pf *pf, struct ice_info_ctx *ctx) status =ice_read_pba_string (hw, (u8 *)ctx->buf,sizeof (ctx->buf));if (status) -return -EIO ; +/* We failed to locate the PBA, so just skip this entry */ + dev_dbg(ice_pf_to_dev(pf), "Failed to read Product Board Assembly string, status %s\n", + ice_stat_str(status));return 0;
}
--
2.26.2
This patch was applied to netdev/net.git (refs/heads/master):
Hello:
This patch was applied to netdev/net.git (refs/heads/master):
Quoted 8 lines · On Thu, 19 Aug 2021 15:34:51 -0700 you wrote:
From: Jacob Keller <[email protected]>
The devlink dev info command reports version information about the device and firmware running on the board. This includes the "board.id" field which is supposed to represent an identifier of the board design. The ice driver uses the Product Board Assembly identifier for this.
[...]
Here is the summary with links:
- [net,v2,1/1] ice: do not abort devlink info if board identifier can't be found
https://git.kernel.org/netdev/net/c/a8f89fa27773
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html