]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
octeontx2-pf: Add error log forcn10k_map_unmap_rq_policer()
authorWentao Liang <vulab@iscas.ac.cn>
Tue, 8 Apr 2025 03:26:02 +0000 (11:26 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:05:33 +0000 (11:05 +0100)
[ Upstream commit 9c056ec6dd1654b1420dafbbe2a69718850e6ff2 ]

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 <vulab@iscas.ac.cn>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250408032602.2909-1-vulab@iscas.ac.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c

index 942ec8f39455987f469336c0e4059d6224624a53..59fef7b50ebb69dc1dca7e4ee0bec41042f2b267 100644 (file)
@@ -351,9 +351,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);