Skip to content

Commit 32b931c

Browse files
sumang-mrvldavem330
authored andcommitted
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. Fixes: 99c969a ("octeontx2-pf: Add egress PFC support") Signed-off-by: Suman Ghosh <sumang@marvell.com> Reviewed-by: Leon Romanovsky <leonro@nvidia.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent cc3d2b5 commit 32b931c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,7 @@ static inline void otx2_dma_unmap_page(struct otx2_nic *pfvf,
884884
static inline u16 otx2_get_smq_idx(struct otx2_nic *pfvf, u16 qidx)
885885
{
886886
#ifdef CONFIG_DCB
887-
if (pfvf->pfc_alloc_status[qidx])
887+
if (qidx < NIX_PF_PFC_PRIO_MAX && pfvf->pfc_alloc_status[qidx])
888888
return pfvf->pfc_schq_list[NIX_TXSCH_LVL_SMQ][qidx];
889889
#endif
890890

0 commit comments

Comments
 (0)