Commit a9ac2e18 authored by Suman Ghosh's avatar Suman Ghosh Committed by Jakub Kicinski

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: 99c969a8 ("octeontx2-pf: Add egress PFC support")
Signed-off-by: default avatarSuman Ghosh <sumang@marvell.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://lore.kernel.org/r/20230824081032.436432-2-sumang@marvell.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 931abcdc
...@@ -804,6 +804,7 @@ void otx2_txschq_free_one(struct otx2_nic *pfvf, u16 lvl, u16 schq) ...@@ -804,6 +804,7 @@ void otx2_txschq_free_one(struct otx2_nic *pfvf, u16 lvl, u16 schq)
mutex_unlock(&pfvf->mbox.lock); mutex_unlock(&pfvf->mbox.lock);
} }
EXPORT_SYMBOL(otx2_txschq_free_one);
void otx2_txschq_stop(struct otx2_nic *pfvf) void otx2_txschq_stop(struct otx2_nic *pfvf)
{ {
......
...@@ -125,19 +125,12 @@ int otx2_pfc_txschq_alloc(struct otx2_nic *pfvf) ...@@ -125,19 +125,12 @@ int otx2_pfc_txschq_alloc(struct otx2_nic *pfvf)
static int otx2_pfc_txschq_stop_one(struct otx2_nic *pfvf, u8 prio) static int otx2_pfc_txschq_stop_one(struct otx2_nic *pfvf, u8 prio)
{ {
struct nix_txsch_free_req *free_req; int lvl;
mutex_lock(&pfvf->mbox.lock);
/* free PFC TLx nodes */ /* free PFC TLx nodes */
free_req = otx2_mbox_alloc_msg_nix_txsch_free(&pfvf->mbox); for (lvl = 0; lvl < pfvf->hw.txschq_link_cfg_lvl; lvl++)
if (!free_req) { otx2_txschq_free_one(pfvf, lvl,
mutex_unlock(&pfvf->mbox.lock); pfvf->pfc_schq_list[lvl][prio]);
return -ENOMEM;
}
free_req->flags = TXSCHQ_FREE_ALL;
otx2_sync_mbox_msg(&pfvf->mbox);
mutex_unlock(&pfvf->mbox.lock);
pfvf->pfc_alloc_status[prio] = false; pfvf->pfc_alloc_status[prio] = false;
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment