Re: [PATCH net v2 1/3] macsec: introduce dedicated workqueue for SA crypto cleanup

From: alexjlzheng

Date: Fri May 08 2026 - 22:51:37 EST


From: Jinliang Zheng <alexjlzheng@xxxxxxxxxxx>

On Thu, 8 May 2026 19:19:23 -0700, Jakub Kicinski wrote:
> > Regarding the label name: "wq:" follows the existing naming convention
> > in macsec_init(), where the other error labels are also named after the
> > resource they clean up ("rtnl:", "notifier:") rather than using the
> > "err_xxx:" style.
>
> I can see that, but we have to start somewhere.

Good point, will rename to err_destroy_wq: in v3.

> > Regarding rcu_barrier(): in the error path of macsec_init(), the
> > workqueue has just been created and no MACsec interface has been
> > registered yet. [...]
>
> TBH I didn't check the code, you may be right that until the genl
> family is registered there's no way to an SA to exist (even tho
> macsec devices may have already gotten created).
>
> Either way, I'd just add that barrier. We're basically leaving
> a trap for whoever tries to add another piece of code to this function.
> The error unwind path and the remove path should generally be kept
> the same.

Agreed, that's a good point. Keeping the error unwind consistent with
the remove path avoids subtle future bugs. Will add rcu_barrier() before
destroy_workqueue() in the error path in v3.

Thanks for the review!

Jinliang