netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] octeontx2-pf: handle otx2_mbox_get_rsp errors
@ 2025-04-12 18:33 Chenyuan Yang
  2025-04-14 11:04 ` Michal Swiatkowski
  2025-04-16  0:20 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 4+ messages in thread
From: Chenyuan Yang @ 2025-04-12 18:33 UTC (permalink / raw)
  To: sgoutham, gakula, sbhatta, hkelam, bbhushan2, andrew+netdev,
	davem, edumazet, kuba, pabeni
  Cc: netdev, linux-kernel, Chenyuan Yang

Adding error pointer check after calling otx2_mbox_get_rsp().

This is similar to the commit bd3110bc102a
("octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_flows.c").

Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com>
Fixes: 6c40ca957fe5 ("octeontx2-pf: Adds TC offload support")
---
 drivers/net/ethernet/marvell/octeontx2/nic/rep.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
index 04e08e06f30f..7153a71dfc86 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
@@ -67,6 +67,8 @@ static int rvu_rep_mcam_flow_init(struct rep_dev *rep)
 
 		rsp = (struct npc_mcam_alloc_entry_rsp *)otx2_mbox_get_rsp
 			(&priv->mbox.mbox, 0, &req->hdr);
+		if (IS_ERR(rsp))
+			goto exit;
 
 		for (ent = 0; ent < rsp->count; ent++)
 			rep->flow_cfg->flow_ent[ent + allocated] = rsp->entry_list[ent];
-- 
2.34.1


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

* Re: [PATCH] octeontx2-pf: handle otx2_mbox_get_rsp errors
  2025-04-12 18:33 [PATCH] octeontx2-pf: handle otx2_mbox_get_rsp errors Chenyuan Yang
@ 2025-04-14 11:04 ` Michal Swiatkowski
  2025-04-15 18:51   ` Simon Horman
  2025-04-16  0:20 ` patchwork-bot+netdevbpf
  1 sibling, 1 reply; 4+ messages in thread
From: Michal Swiatkowski @ 2025-04-14 11:04 UTC (permalink / raw)
  To: Chenyuan Yang
  Cc: sgoutham, gakula, sbhatta, hkelam, bbhushan2, andrew+netdev,
	davem, edumazet, kuba, pabeni, netdev, linux-kernel

On Sat, Apr 12, 2025 at 01:33:27PM -0500, Chenyuan Yang wrote:
> Adding error pointer check after calling otx2_mbox_get_rsp().
> 
> This is similar to the commit bd3110bc102a
> ("octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_flows.c").
> 
> Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com>
> Fixes: 6c40ca957fe5 ("octeontx2-pf: Adds TC offload support")
> ---
>  drivers/net/ethernet/marvell/octeontx2/nic/rep.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
> index 04e08e06f30f..7153a71dfc86 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
> @@ -67,6 +67,8 @@ static int rvu_rep_mcam_flow_init(struct rep_dev *rep)
>  
>  		rsp = (struct npc_mcam_alloc_entry_rsp *)otx2_mbox_get_rsp
>  			(&priv->mbox.mbox, 0, &req->hdr);
> +		if (IS_ERR(rsp))
> +			goto exit;

Changes looks fine:
Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>

BTW, looks like now you can use break instead of goto exit, as exit
label is just after the while loop.

>  
>  		for (ent = 0; ent < rsp->count; ent++)
>  			rep->flow_cfg->flow_ent[ent + allocated] = rsp->entry_list[ent];
> -- 
> 2.34.1

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

* Re: [PATCH] octeontx2-pf: handle otx2_mbox_get_rsp errors
  2025-04-14 11:04 ` Michal Swiatkowski
@ 2025-04-15 18:51   ` Simon Horman
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2025-04-15 18:51 UTC (permalink / raw)
  To: Michal Swiatkowski
  Cc: Chenyuan Yang, sgoutham, gakula, sbhatta, hkelam, bbhushan2,
	andrew+netdev, davem, edumazet, kuba, pabeni, netdev,
	linux-kernel

On Mon, Apr 14, 2025 at 01:04:32PM +0200, Michal Swiatkowski wrote:
> On Sat, Apr 12, 2025 at 01:33:27PM -0500, Chenyuan Yang wrote:
> > Adding error pointer check after calling otx2_mbox_get_rsp().
> > 
> > This is similar to the commit bd3110bc102a
> > ("octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_flows.c").
> > 
> > Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com>
> > Fixes: 6c40ca957fe5 ("octeontx2-pf: Adds TC offload support")
> > ---
> >  drivers/net/ethernet/marvell/octeontx2/nic/rep.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
> > index 04e08e06f30f..7153a71dfc86 100644
> > --- a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
> > +++ b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
> > @@ -67,6 +67,8 @@ static int rvu_rep_mcam_flow_init(struct rep_dev *rep)
> >  
> >  		rsp = (struct npc_mcam_alloc_entry_rsp *)otx2_mbox_get_rsp
> >  			(&priv->mbox.mbox, 0, &req->hdr);
> > +		if (IS_ERR(rsp))
> > +			goto exit;
> 
> Changes looks fine:
> Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
> 
> BTW, looks like now you can use break instead of goto exit, as exit
> label is just after the while loop.

True. My suggestion would be to keep this patch as-is. And, once it has
hit net-next, send a follow-up to remove the exit label.

> 
> >  
> >  		for (ent = 0; ent < rsp->count; ent++)
> >  			rep->flow_cfg->flow_ent[ent + allocated] = rsp->entry_list[ent];
> > -- 
> > 2.34.1
> 

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

* Re: [PATCH] octeontx2-pf: handle otx2_mbox_get_rsp errors
  2025-04-12 18:33 [PATCH] octeontx2-pf: handle otx2_mbox_get_rsp errors Chenyuan Yang
  2025-04-14 11:04 ` Michal Swiatkowski
@ 2025-04-16  0:20 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-04-16  0:20 UTC (permalink / raw)
  To: Chenyuan Yang
  Cc: sgoutham, gakula, sbhatta, hkelam, bbhushan2, andrew+netdev,
	davem, edumazet, kuba, pabeni, netdev, linux-kernel

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Sat, 12 Apr 2025 13:33:27 -0500 you wrote:
> Adding error pointer check after calling otx2_mbox_get_rsp().
> 
> This is similar to the commit bd3110bc102a
> ("octeontx2-pf: handle otx2_mbox_get_rsp errors in otx2_flows.c").
> 
> Signed-off-by: Chenyuan Yang <chenyuan0y@gmail.com>
> Fixes: 6c40ca957fe5 ("octeontx2-pf: Adds TC offload support")
> 
> [...]

Here is the summary with links:
  - octeontx2-pf: handle otx2_mbox_get_rsp errors
    https://git.kernel.org/netdev/net/c/688abe1027d0

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] 4+ messages in thread

end of thread, other threads:[~2025-04-16  0:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-12 18:33 [PATCH] octeontx2-pf: handle otx2_mbox_get_rsp errors Chenyuan Yang
2025-04-14 11:04 ` Michal Swiatkowski
2025-04-15 18:51   ` Simon Horman
2025-04-16  0:20 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).