* [PATCH net] net: octeontx2-af: quiesce devlink health work on teardown
@ 2026-09-28 13:41 Hongyan Xu
2026-09-28 13:46 ` netdev-bot+sinfo
0 siblings, 1 reply; 2+ messages in thread
From: Hongyan Xu @ 2026-09-28 13:41 UTC (permalink / raw)
To: sgoutham, rkannoth
Cc: gakula, sbhatta, andrew+netdev, davem, edumazet, kuba, pabeni,
netdev, linux-kernel, jianhao.xu, Hongyan Xu
NPA and NIX interrupt handlers queue health-reporting work whose
containers are freed by rvu_health_reporters_destroy(). Interrupt
unregistration does not drain queued work. In addition, each reporter
setup creates a workqueue in the same field, leaking the NPA queue and
leaving no teardown handle for work queued on it.
Initialize work before later allocations can fail, share one workqueue,
unregister each set of interrupts, and cancel its work before freeing
the reporters. Destroy the shared workqueue once both reporter sets are
gone.
Fixes: f1168d1e207c ("octeontx2-af: Add devlink health reporters for NPA")
Fixes: 5ed66306eab6 ("octeontx2-af: Add devlink health reporters for NIX")
Signed-off-by: Hongyan Xu <getshell@seu.edu.cn>
---
.../marvell/octeontx2/af/rvu_devlink.c | 46 +++++++++++++------
1 file changed, 32 insertions(+), 14 deletions(-)
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
index d63c3d33775a..c7c7230dc588 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_devlink.c
@@ -505,6 +505,11 @@ static int rvu_nix_register_reporters(struct rvu_devlink *rvu_dl)
return -ENOMEM;
rvu_reporters->nix_event_ctx = nix_event_context;
+ INIT_WORK(&rvu_reporters->intr_work, rvu_nix_intr_work);
+ INIT_WORK(&rvu_reporters->gen_work, rvu_nix_gen_work);
+ INIT_WORK(&rvu_reporters->err_work, rvu_nix_err_work);
+ INIT_WORK(&rvu_reporters->ras_work, rvu_nix_ras_work);
+
rvu_reporters->rvu_hw_nix_intr_reporter =
devlink_health_reporter_create(rvu_dl->dl,
&rvu_hw_nix_intr_reporter_ops,
@@ -545,15 +550,11 @@ static int rvu_nix_register_reporters(struct rvu_devlink *rvu_dl)
return PTR_ERR(rvu_reporters->rvu_hw_nix_ras_reporter);
}
- rvu_dl->devlink_wq = create_workqueue("rvu_devlink_wq");
+ if (!rvu_dl->devlink_wq)
+ rvu_dl->devlink_wq = create_workqueue("rvu_devlink_wq");
if (!rvu_dl->devlink_wq)
return -ENOMEM;
- INIT_WORK(&rvu_reporters->intr_work, rvu_nix_intr_work);
- INIT_WORK(&rvu_reporters->gen_work, rvu_nix_gen_work);
- INIT_WORK(&rvu_reporters->err_work, rvu_nix_err_work);
- INIT_WORK(&rvu_reporters->ras_work, rvu_nix_ras_work);
-
return 0;
}
@@ -582,6 +583,13 @@ static void rvu_nix_health_reporters_destroy(struct rvu_devlink *rvu_dl)
if (!nix_reporters->rvu_hw_nix_ras_reporter)
return;
+
+ rvu_nix_unregister_interrupts(rvu);
+ cancel_work_sync(&nix_reporters->intr_work);
+ cancel_work_sync(&nix_reporters->gen_work);
+ cancel_work_sync(&nix_reporters->err_work);
+ cancel_work_sync(&nix_reporters->ras_work);
+
if (!IS_ERR_OR_NULL(nix_reporters->rvu_hw_nix_intr_reporter))
devlink_health_reporter_destroy(nix_reporters->rvu_hw_nix_intr_reporter);
@@ -594,7 +602,6 @@ static void rvu_nix_health_reporters_destroy(struct rvu_devlink *rvu_dl)
if (!IS_ERR_OR_NULL(nix_reporters->rvu_hw_nix_ras_reporter))
devlink_health_reporter_destroy(nix_reporters->rvu_hw_nix_ras_reporter);
- rvu_nix_unregister_interrupts(rvu);
kfree(rvu_dl->rvu_nix_health_reporter->nix_event_ctx);
kfree(rvu_dl->rvu_nix_health_reporter);
}
@@ -1059,6 +1066,11 @@ static int rvu_npa_register_reporters(struct rvu_devlink *rvu_dl)
return -ENOMEM;
rvu_reporters->npa_event_ctx = npa_event_context;
+ INIT_WORK(&rvu_reporters->intr_work, rvu_npa_intr_work);
+ INIT_WORK(&rvu_reporters->err_work, rvu_npa_err_work);
+ INIT_WORK(&rvu_reporters->gen_work, rvu_npa_gen_work);
+ INIT_WORK(&rvu_reporters->ras_work, rvu_npa_ras_work);
+
rvu_reporters->rvu_hw_npa_intr_reporter =
devlink_health_reporter_create(rvu_dl->dl,
&rvu_hw_npa_intr_reporter_ops,
@@ -1099,15 +1111,11 @@ static int rvu_npa_register_reporters(struct rvu_devlink *rvu_dl)
return PTR_ERR(rvu_reporters->rvu_hw_npa_ras_reporter);
}
- rvu_dl->devlink_wq = create_workqueue("rvu_devlink_wq");
+ if (!rvu_dl->devlink_wq)
+ rvu_dl->devlink_wq = create_workqueue("rvu_devlink_wq");
if (!rvu_dl->devlink_wq)
return -ENOMEM;
- INIT_WORK(&rvu_reporters->intr_work, rvu_npa_intr_work);
- INIT_WORK(&rvu_reporters->err_work, rvu_npa_err_work);
- INIT_WORK(&rvu_reporters->gen_work, rvu_npa_gen_work);
- INIT_WORK(&rvu_reporters->ras_work, rvu_npa_ras_work);
-
return 0;
}
@@ -1136,6 +1144,13 @@ static void rvu_npa_health_reporters_destroy(struct rvu_devlink *rvu_dl)
if (!npa_reporters->rvu_hw_npa_ras_reporter)
return;
+
+ rvu_npa_unregister_interrupts(rvu);
+ cancel_work_sync(&npa_reporters->intr_work);
+ cancel_work_sync(&npa_reporters->gen_work);
+ cancel_work_sync(&npa_reporters->err_work);
+ cancel_work_sync(&npa_reporters->ras_work);
+
if (!IS_ERR_OR_NULL(npa_reporters->rvu_hw_npa_intr_reporter))
devlink_health_reporter_destroy(npa_reporters->rvu_hw_npa_intr_reporter);
@@ -1148,7 +1163,6 @@ static void rvu_npa_health_reporters_destroy(struct rvu_devlink *rvu_dl)
if (!IS_ERR_OR_NULL(npa_reporters->rvu_hw_npa_ras_reporter))
devlink_health_reporter_destroy(npa_reporters->rvu_hw_npa_ras_reporter);
- rvu_npa_unregister_interrupts(rvu);
kfree(rvu_dl->rvu_npa_health_reporter->npa_event_ctx);
kfree(rvu_dl->rvu_npa_health_reporter);
}
@@ -1176,6 +1190,10 @@ static void rvu_health_reporters_destroy(struct rvu *rvu)
rvu_dl = rvu->rvu_dl;
rvu_npa_health_reporters_destroy(rvu_dl);
rvu_nix_health_reporters_destroy(rvu_dl);
+ if (rvu_dl->devlink_wq) {
+ destroy_workqueue(rvu_dl->devlink_wq);
+ rvu_dl->devlink_wq = NULL;
+ }
}
/* Devlink Params APIs */
--
2.50.1.windows.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH net] net: octeontx2-af: quiesce devlink health work on teardown
2026-09-28 13:41 [PATCH net] net: octeontx2-af: quiesce devlink health work on teardown Hongyan Xu
@ 2026-09-28 13:46 ` netdev-bot+sinfo
0 siblings, 0 replies; 2+ messages in thread
From: netdev-bot+sinfo @ 2026-09-28 13:46 UTC (permalink / raw)
To: Hongyan Xu
Cc: sgoutham, rkannoth, gakula, sbhatta, andrew+netdev, davem,
edumazet, kuba, pabeni, netdev, linux-kernel, jianhao.xu
Hi!
This is an automated message. This series looks like a fix, but its
commit messages seem to be missing some information:
- How the issue was discovered, e.g. hit in production, hit during
development, syzbot report, manual code inspection, LLM or static
analysis tool scan.
- Whether the issue was actually triggered, or is only theoretical
(e.g. found by code inspection). If it was triggered please include
the symptoms, like the stack trace or error messages.
- What hardware the change was tested on. For driver fixes please
mention the device (and if relevant firmware version) used for
testing, or say that the change was not tested on real hardware.
Please do not repost the series just to address the above. Instead,
reply to this email with the missing information, so that reviewers
can take it into account. If the series needs another revision for
other reasons, please include the information in the commit messages
then.
The evaluation is done by an LLM so it may be wrong, if you think
that is the case please reply and explain.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-28 13:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-28 13:41 [PATCH net] net: octeontx2-af: quiesce devlink health work on teardown Hongyan Xu
2026-09-28 13:46 ` netdev-bot+sinfo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®