Skip to content

Commit 597d0ec

Browse files
sumang-mrvlkuba-moo
authored andcommitted
cteonxt2-pf: Fix backpressure config for multiple PFC priorities to work simultaneously
MAC (CGX or RPM) asserts backpressure at TL3 or TL2 node of the egress hierarchical scheduler tree depending on link level config done. If there are multiple PFC priorities enabled at a time and for all such flows to backoff, each priority will have to assert backpressure at different TL3/TL2 scheduler nodes and these flows will need to submit egress pkts to these nodes. Current PFC configuration has an issue where in only one backpressure scheduler node is being allocated which is resulting in only one PFC priority to work. This patch fixes this issue. Fixes: 99c969a ("octeontx2-pf: Add egress PFC support") Signed-off-by: Suman Ghosh <sumang@marvell.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://lore.kernel.org/r/20230824081032.436432-4-sumang@marvell.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 47bcc9c commit 597d0ec

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

drivers/net/ethernet/marvell/octeontx2/nic/otx2_dcbnl.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ static int otx2_pfc_txschq_alloc_one(struct otx2_nic *pfvf, u8 prio)
7070
* link config level. These rest of the scheduler can be
7171
* same as hw.txschq_list.
7272
*/
73-
for (lvl = 0; lvl < pfvf->hw.txschq_link_cfg_lvl; lvl++)
73+
for (lvl = 0; lvl <= pfvf->hw.txschq_link_cfg_lvl; lvl++)
7474
req->schq[lvl] = 1;
7575

7676
rc = otx2_sync_mbox_msg(&pfvf->mbox);
@@ -83,7 +83,7 @@ static int otx2_pfc_txschq_alloc_one(struct otx2_nic *pfvf, u8 prio)
8383
return PTR_ERR(rsp);
8484

8585
/* Setup transmit scheduler list */
86-
for (lvl = 0; lvl < pfvf->hw.txschq_link_cfg_lvl; lvl++) {
86+
for (lvl = 0; lvl <= pfvf->hw.txschq_link_cfg_lvl; lvl++) {
8787
if (!rsp->schq[lvl])
8888
return -ENOSPC;
8989

@@ -128,7 +128,7 @@ static int otx2_pfc_txschq_stop_one(struct otx2_nic *pfvf, u8 prio)
128128
int lvl;
129129

130130
/* free PFC TLx nodes */
131-
for (lvl = 0; lvl < pfvf->hw.txschq_link_cfg_lvl; lvl++)
131+
for (lvl = 0; lvl <= pfvf->hw.txschq_link_cfg_lvl; lvl++)
132132
otx2_txschq_free_one(pfvf, lvl,
133133
pfvf->pfc_schq_list[lvl][prio]);
134134

0 commit comments

Comments
 (0)