Skip to content

Commit a9ac2e1

Browse files
sumang-mrvlkuba-moo
authored andcommitted
octeontx2-pf: Fix PFC TX scheduler free
During PFC TX schedulers free, flag TXSCHQ_FREE_ALL was being set which caused free up all schedulers other than the PFC schedulers. This patch fixes that to free only the PFC Tx schedulers. 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-2-sumang@marvell.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 931abcd commit a9ac2e1

2 files changed

Lines changed: 5 additions & 11 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,7 @@ void otx2_txschq_free_one(struct otx2_nic *pfvf, u16 lvl, u16 schq)
804804

805805
mutex_unlock(&pfvf->mbox.lock);
806806
}
807+
EXPORT_SYMBOL(otx2_txschq_free_one);
807808

808809
void otx2_txschq_stop(struct otx2_nic *pfvf)
809810
{

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

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,12 @@ int otx2_pfc_txschq_alloc(struct otx2_nic *pfvf)
125125

126126
static int otx2_pfc_txschq_stop_one(struct otx2_nic *pfvf, u8 prio)
127127
{
128-
struct nix_txsch_free_req *free_req;
128+
int lvl;
129129

130-
mutex_lock(&pfvf->mbox.lock);
131130
/* free PFC TLx nodes */
132-
free_req = otx2_mbox_alloc_msg_nix_txsch_free(&pfvf->mbox);
133-
if (!free_req) {
134-
mutex_unlock(&pfvf->mbox.lock);
135-
return -ENOMEM;
136-
}
137-
138-
free_req->flags = TXSCHQ_FREE_ALL;
139-
otx2_sync_mbox_msg(&pfvf->mbox);
140-
mutex_unlock(&pfvf->mbox.lock);
131+
for (lvl = 0; lvl < pfvf->hw.txschq_link_cfg_lvl; lvl++)
132+
otx2_txschq_free_one(pfvf, lvl,
133+
pfvf->pfc_schq_list[lvl][prio]);
141134

142135
pfvf->pfc_alloc_status[prio] = false;
143136
return 0;

0 commit comments

Comments
 (0)