On 10/24/25 10:01 AM, Eelco Chaudron wrote: > > > On 17 Oct 2025, at 19:11, Ilya Maximets wrote: > >> Clang 21 now properly implements GUARDED annotations for structure >> fields, and so it complains about those fields being accessed in >> init/create/destroy type of functions that normally do not take any >> locks, as the data is just allocated and not available to other >> threads. Add some locks where it is simple to do, so we don't have >> to turn off the analysis entirely, in other places just turn off the >> analysis. >> >> While at it, adding a couple of missed annotations that clang started >> to complain about due to actual support for the GUARDED annotation on >> structure fields. Added some unused arguments to a couple of functions >> to be able to specify which lock is required. It seemed better than >> turning off the analysis. >> >> Signed-off-by: Ilya Maximets <[email protected]> > > Hi Ilya, thanks for fixing this! > > I was just wondering why sometimes you decided to add > OVS_NO_THREAD_SAFETY_ANALYSIS, > and in other instances, just take the lock/mutex on init functions? Anyway, > both are > fine with me.
Mostly just the amount of clutter the locking brings. For example, dp_netdev_configure_pmd() would need taking of 3 separate locks, so it's easier to just turn off the analysis. Also if adding the lock and unlock doubles the function size and the content is obviously safe, then it's easier to just turn off the analysis. > > Acked-by: Eelco Chaudron [email protected] Thanks! Applied and backported down to 3.3. Best regards, Ilya Maximets. _______________________________________________ dev mailing list [email protected] https://mail.openvswitch.org/mailman/listinfo/ovs-dev
