All of lore.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH net v2 1/1] ice: do not abort devlink info if board identifier can't be found
  2021-08-19 22:34 [PATCH net v2 1/1] ice: do not abort devlink info if board identifier can't be found Tony Nguyen
@ 2021-08-19 22:32 ` Keller, Jacob E
  2021-08-20 12:52 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Keller, Jacob E @ 2021-08-19 22:32 UTC (permalink / raw)
  To: Nguyen, Anthony L, davem, kuba; +Cc: netdev, Brelinski, TonyX



> -----Original Message-----
> From: Nguyen, Anthony L <anthony.l.nguyen@intel.com>
> Sent: Thursday, August 19, 2021 3:35 PM
> To: davem@davemloft.net; kuba@kernel.org
> Cc: Keller, Jacob E <jacob.e.keller@intel.com>; netdev@vger.kernel.org; Nguyen,
> Anthony L <anthony.l.nguyen@intel.com>; Brelinski, TonyX
> <tonyx.brelinski@intel.com>
> Subject: [PATCH net v2 1/1] ice: do not abort devlink info if board identifier can't
> be found
> 
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> 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.
> 
> Fixes: e961b679fb0b ("ice: add board identifier info to devlink .info_get")
> Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
> Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> ---

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

> 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(-)
> 
> diff --git a/drivers/net/ethernet/intel/ice/ice_devlink.c
> b/drivers/net/ethernet/intel/ice/ice_devlink.c
> index 91b545ab8b8f..7fe6e8ea39f0 100644
> --- a/drivers/net/ethernet/intel/ice/ice_devlink.c
> +++ b/drivers/net/ethernet/intel/ice/ice_devlink.c
> @@ -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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH net v2 1/1] ice: do not abort devlink info if board identifier can't be found
@ 2021-08-19 22:34 Tony Nguyen
  2021-08-19 22:32 ` Keller, Jacob E
  2021-08-20 12:52 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Tony Nguyen @ 2021-08-19 22:34 UTC (permalink / raw)
  To: davem, kuba; +Cc: Jacob Keller, netdev, anthony.l.nguyen, Tony Brelinski

From: Jacob Keller <jacob.e.keller@intel.com>

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.

Fixes: e961b679fb0b ("ice: add board identifier info to devlink .info_get")
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
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(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_devlink.c b/drivers/net/ethernet/intel/ice/ice_devlink.c
index 91b545ab8b8f..7fe6e8ea39f0 100644
--- a/drivers/net/ethernet/intel/ice/ice_devlink.c
+++ b/drivers/net/ethernet/intel/ice/ice_devlink.c
@@ -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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net v2 1/1] ice: do not abort devlink info if board identifier can't be found
  2021-08-19 22:34 [PATCH net v2 1/1] ice: do not abort devlink info if board identifier can't be found Tony Nguyen
  2021-08-19 22:32 ` Keller, Jacob E
@ 2021-08-20 12:52 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2021-08-20 12:52 UTC (permalink / raw)
  To: Tony Nguyen; +Cc: davem, kuba, jacob.e.keller, netdev, tonyx.brelinski

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

On Thu, 19 Aug 2021 15:34:51 -0700 you wrote:
> From: Jacob Keller <jacob.e.keller@intel.com>
> 
> 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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-08-20 12:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-19 22:34 [PATCH net v2 1/1] ice: do not abort devlink info if board identifier can't be found Tony Nguyen
2021-08-19 22:32 ` Keller, Jacob E
2021-08-20 12:52 ` patchwork-bot+netdevbpf

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.