netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [net PATCH V2] octeontx2-pf: Fix pfc_alloc_status array overflow
@ 2022-11-23 10:59 Suman Ghosh
  2022-11-23 11:08 ` Leon Romanovsky
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Suman Ghosh @ 2022-11-23 10:59 UTC (permalink / raw)
  To: davem, edumazet, kuba, pabeni, sgoutham, sbhatta, jerinj, gakula,
	hkelam, lcherian, netdev, linux-kernel
  Cc: Suman Ghosh

This patch addresses pfc_alloc_status array overflow occurring for
send queue index value greater than PFC priority. Queue index can be
greater than supported PFC priority for multiple scenarios (e.g. QoS,
during non zero SMQ allocation for a PF/VF).
In those scenarios the API should return default tx scheduler '0'.
This is causing mbox errors as otx2_get_smq_idx returing invalid smq value.

Fixes: 99c969a83d82 ("octeontx2-pf: Add egress PFC support")
Signed-off-by: Suman Ghosh <sumang@marvell.com>
---
Changes since v1:
- Updated commit message.

 drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
index 282db6fe3b08..67aa02bb2b85 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
@@ -884,7 +884,7 @@ static inline void otx2_dma_unmap_page(struct otx2_nic *pfvf,
 static inline u16 otx2_get_smq_idx(struct otx2_nic *pfvf, u16 qidx)
 {
 #ifdef CONFIG_DCB
-	if (pfvf->pfc_alloc_status[qidx])
+	if (qidx < NIX_PF_PFC_PRIO_MAX && pfvf->pfc_alloc_status[qidx])
 		return pfvf->pfc_schq_list[NIX_TXSCH_LVL_SMQ][qidx];
 #endif
 
-- 
2.25.1


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

* Re: [net PATCH V2] octeontx2-pf: Fix pfc_alloc_status array overflow
  2022-11-23 10:59 [net PATCH V2] octeontx2-pf: Fix pfc_alloc_status array overflow Suman Ghosh
@ 2022-11-23 11:08 ` Leon Romanovsky
  2022-11-25  9:40 ` patchwork-bot+netdevbpf
  2022-11-25 14:58 ` Maciej Fijalkowski
  2 siblings, 0 replies; 4+ messages in thread
From: Leon Romanovsky @ 2022-11-23 11:08 UTC (permalink / raw)
  To: Suman Ghosh
  Cc: davem, edumazet, kuba, pabeni, sgoutham, sbhatta, jerinj, gakula,
	hkelam, lcherian, netdev, linux-kernel

On Wed, Nov 23, 2022 at 04:29:38PM +0530, Suman Ghosh wrote:
> This patch addresses pfc_alloc_status array overflow occurring for
> send queue index value greater than PFC priority. Queue index can be
> greater than supported PFC priority for multiple scenarios (e.g. QoS,
> during non zero SMQ allocation for a PF/VF).
> In those scenarios the API should return default tx scheduler '0'.
> This is causing mbox errors as otx2_get_smq_idx returing invalid smq value.
> 
> Fixes: 99c969a83d82 ("octeontx2-pf: Add egress PFC support")
> Signed-off-by: Suman Ghosh <sumang@marvell.com>
> ---
> Changes since v1:
> - Updated commit message.
> 
>  drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 

Thanks,
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>

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

* Re: [net PATCH V2] octeontx2-pf: Fix pfc_alloc_status array overflow
  2022-11-23 10:59 [net PATCH V2] octeontx2-pf: Fix pfc_alloc_status array overflow Suman Ghosh
  2022-11-23 11:08 ` Leon Romanovsky
@ 2022-11-25  9:40 ` patchwork-bot+netdevbpf
  2022-11-25 14:58 ` Maciej Fijalkowski
  2 siblings, 0 replies; 4+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-11-25  9:40 UTC (permalink / raw)
  To: Suman Ghosh
  Cc: davem, edumazet, kuba, pabeni, sgoutham, sbhatta, jerinj, gakula,
	hkelam, lcherian, netdev, linux-kernel

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Wed, 23 Nov 2022 16:29:38 +0530 you wrote:
> This patch addresses pfc_alloc_status array overflow occurring for
> send queue index value greater than PFC priority. Queue index can be
> greater than supported PFC priority for multiple scenarios (e.g. QoS,
> during non zero SMQ allocation for a PF/VF).
> In those scenarios the API should return default tx scheduler '0'.
> This is causing mbox errors as otx2_get_smq_idx returing invalid smq value.
> 
> [...]

Here is the summary with links:
  - [net,V2] octeontx2-pf: Fix pfc_alloc_status array overflow
    https://git.kernel.org/netdev/net/c/32b931c86d0a

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

* Re: [net PATCH V2] octeontx2-pf: Fix pfc_alloc_status array overflow
  2022-11-23 10:59 [net PATCH V2] octeontx2-pf: Fix pfc_alloc_status array overflow Suman Ghosh
  2022-11-23 11:08 ` Leon Romanovsky
  2022-11-25  9:40 ` patchwork-bot+netdevbpf
@ 2022-11-25 14:58 ` Maciej Fijalkowski
  2 siblings, 0 replies; 4+ messages in thread
From: Maciej Fijalkowski @ 2022-11-25 14:58 UTC (permalink / raw)
  To: Suman Ghosh
  Cc: davem, edumazet, kuba, pabeni, sgoutham, sbhatta, jerinj, gakula,
	hkelam, lcherian, netdev, linux-kernel

On Wed, Nov 23, 2022 at 04:29:38PM +0530, Suman Ghosh wrote:
> This patch addresses pfc_alloc_status array overflow occurring for

Nit: use imperative mood

> send queue index value greater than PFC priority. Queue index can be
> greater than supported PFC priority for multiple scenarios (e.g. QoS,
> during non zero SMQ allocation for a PF/VF).
> In those scenarios the API should return default tx scheduler '0'.
> This is causing mbox errors as otx2_get_smq_idx returing invalid smq value.
> 
> Fixes: 99c969a83d82 ("octeontx2-pf: Add egress PFC support")
> Signed-off-by: Suman Ghosh <sumang@marvell.com>
> ---
> Changes since v1:
> - Updated commit message.
> 
>  drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>

> 
> diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
> index 282db6fe3b08..67aa02bb2b85 100644
> --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
> +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h
> @@ -884,7 +884,7 @@ static inline void otx2_dma_unmap_page(struct otx2_nic *pfvf,
>  static inline u16 otx2_get_smq_idx(struct otx2_nic *pfvf, u16 qidx)
>  {
>  #ifdef CONFIG_DCB
> -	if (pfvf->pfc_alloc_status[qidx])
> +	if (qidx < NIX_PF_PFC_PRIO_MAX && pfvf->pfc_alloc_status[qidx])
>  		return pfvf->pfc_schq_list[NIX_TXSCH_LVL_SMQ][qidx];
>  #endif
>  
> -- 
> 2.25.1
> 

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

end of thread, other threads:[~2022-11-25 14:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-23 10:59 [net PATCH V2] octeontx2-pf: Fix pfc_alloc_status array overflow Suman Ghosh
2022-11-23 11:08 ` Leon Romanovsky
2022-11-25  9:40 ` patchwork-bot+netdevbpf
2022-11-25 14:58 ` Maciej Fijalkowski

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).