Skip to content

Commit 9c056ec

Browse files
ISCAS-Vulabkuba-moo
authored andcommitted
octeontx2-pf: Add error log forcn10k_map_unmap_rq_policer()
The cn10k_free_matchall_ipolicer() calls the cn10k_map_unmap_rq_policer() for each queue in a for loop without checking for any errors. Check the return value of the cn10k_map_unmap_rq_policer() function during each loop, and report a warning if the function fails. Signed-off-by: Wentao Liang <[email protected]> Reviewed-by: Simon Horman <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 3119207 commit 9c056ec

File tree

1 file changed

+6
-3
lines changed
  • drivers/net/ethernet/marvell/octeontx2/nic

1 file changed

+6
-3
lines changed

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,9 +357,12 @@ int cn10k_free_matchall_ipolicer(struct otx2_nic *pfvf)
357357
mutex_lock(&pfvf->mbox.lock);
358358

359359
/* Remove RQ's policer mapping */
360-
for (qidx = 0; qidx < hw->rx_queues; qidx++)
361-
cn10k_map_unmap_rq_policer(pfvf, qidx,
362-
hw->matchall_ipolicer, false);
360+
for (qidx = 0; qidx < hw->rx_queues; qidx++) {
361+
rc = cn10k_map_unmap_rq_policer(pfvf, qidx, hw->matchall_ipolicer, false);
362+
if (rc)
363+
dev_warn(pfvf->dev, "Failed to unmap RQ %d's policer (error %d).",
364+
qidx, rc);
365+
}
363366

364367
rc = cn10k_free_leaf_profile(pfvf, hw->matchall_ipolicer);
365368

0 commit comments

Comments
 (0)