Commit 9c056ec6 authored by Wentao Liang's avatar Wentao Liang Committed by Jakub Kicinski
Browse files

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: default avatarWentao Liang <vulab@iscas.ac.cn>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250408032602.2909-1-vulab@iscas.ac.cn


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 31192077
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -357,9 +357,12 @@ int cn10k_free_matchall_ipolicer(struct otx2_nic *pfvf)
	mutex_lock(&pfvf->mbox.lock);

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

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