* [PATCH v4] octeontx2-pf: Add error log forcn10k_map_unmap_rq_policer()
@ 2025-04-08 3:26 Wentao Liang
2025-04-09 19:18 ` Simon Horman
2025-04-10 1:50 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Wentao Liang @ 2025-04-08 3:26 UTC (permalink / raw)
To: sgoutham, gakula, sbhatta, hkelam, andrew+netdev, davem, edumazet,
kuba, pabeni
Cc: netdev, linux-kernel, Wentao Liang
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>
---
v4: Add brackets for loop
v3: Add failed queue number and error code to log.
v2: Fix error code
drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c
index a15cc86635d6..ff5bb71d67fd 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/cn10k.c
@@ -352,9 +352,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);
--
2.42.0.windows.2
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH v4] octeontx2-pf: Add error log forcn10k_map_unmap_rq_policer()
2025-04-08 3:26 [PATCH v4] octeontx2-pf: Add error log forcn10k_map_unmap_rq_policer() Wentao Liang
@ 2025-04-09 19:18 ` Simon Horman
2025-04-10 1:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2025-04-09 19:18 UTC (permalink / raw)
To: Wentao Liang
Cc: sgoutham, gakula, sbhatta, hkelam, andrew+netdev, davem, edumazet,
kuba, pabeni, netdev, linux-kernel
On Tue, Apr 08, 2025 at 11:26:02AM +0800, Wentao Liang wrote:
> 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>
> ---
> v4: Add brackets for loop
> v3: Add failed queue number and error code to log.
> v2: Fix error code
Thanks for the updates.
Reviewed-by: Simon Horman <horms@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v4] octeontx2-pf: Add error log forcn10k_map_unmap_rq_policer()
2025-04-08 3:26 [PATCH v4] octeontx2-pf: Add error log forcn10k_map_unmap_rq_policer() Wentao Liang
2025-04-09 19:18 ` Simon Horman
@ 2025-04-10 1:50 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-04-10 1:50 UTC (permalink / raw)
To: Wentao Liang
Cc: sgoutham, gakula, sbhatta, hkelam, andrew+netdev, davem, edumazet,
kuba, pabeni, netdev, linux-kernel
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Tue, 8 Apr 2025 11:26:02 +0800 you wrote:
> 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>
>
> [...]
Here is the summary with links:
- [v4] octeontx2-pf: Add error log forcn10k_map_unmap_rq_policer()
https://git.kernel.org/netdev/net-next/c/9c056ec6dd16
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-04-10 1:49 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-08 3:26 [PATCH v4] octeontx2-pf: Add error log forcn10k_map_unmap_rq_policer() Wentao Liang
2025-04-09 19:18 ` Simon Horman
2025-04-10 1:50 ` patchwork-bot+netdevbpf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).