octeontx2-pf: Fix pfc_alloc_status array overflow
PATCH v2 1/1 octeontx2-pf: Fix pfc_alloc_status array overflow
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.
---
Changes since v1:
- Updated commit message.
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +1 -1
@@ -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
Signature · 1 line
2.25.1
Quoted 7 lines · Suman Ghosh
This patch addresses
pfc_alloc_statusarray 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 asotx2_get_smq_idxreturing invalid smq value.
Quoted 9 lines
Fixes 99c969a83d82 ("octeontx2-pf: Add egress PFC support")Signed-off-by Suman Ghosh <[email protected]>---
Changes since v1:
- Updated commit message.drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks,
This patch was applied to netdev/net.git (master) by David S. Miller <[email protected]>:
Hello:
This patch was applied to netdev/net.git (master)
by David S. Miller <[email protected]>:
Quoted 8 lines · On Wed, 23 Nov 2022 16:29:38 +0530 you wrote:
This patch addresses
pfc_alloc_statusarray 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 asotx2_get_smq_idxreturing 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!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
Quoted 1 line · Suman Ghosh
This patch addresses
pfc_alloc_statusarray overflow occurring for
Nit: use imperative mood
Quoted 6 lines
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 asotx2_get_smq_idxreturing invalid smq value.
Quoted 8 lines
Fixes 99c969a83d82 ("octeontx2-pf: Add egress PFC support")Signed-off-by Suman Ghosh <[email protected]>---
Changes since v1:
- Updated commit message.drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 17 lines
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +1
-1@@ -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 Signature · 1 line
2.25.1