[PATCH RFC batadv 0/3] batman-adv: tt: use atomic flag modifications

Sven Eckelmann <[email protected]> Sat, 13 Jun 2026 22:56:40 +0200
Newsgroups org.open-mesh.lists.batman
Message-ID <[email protected]>
The flags of translation table entries are modified in various places using
RMW operations like:

* read flags + add flag + store
* read flags + remove flag + store

These were done without making sure that no other context is doing a
similar operation at the same time. If another context does modify the
flags then it could happen that a store of the flag modifications is simply
lost. This problem can usually be fixed at a later point when the flags are
tried to be adjusted again.

To reduce the time the wrong flags are used, it is better to change the u16
flags type to use an atomic_t with its atomic helper to perform these
adjustments.

Signed-off-by: Sven Eckelmann <[email protected]>
---
Sven Eckelmann (3):
      batman-adv: tt: don't merge change entries with different VIDs
      batman-adv: tt: use atomic flag modifications
      batman-adv: tt: simplify NEW flag transition code

 net/batman-adv/translation-table.c | 258 +++++++++++++++++++++++--------------
 net/batman-adv/types.h             |   2 +-
 2 files changed, 165 insertions(+), 95 deletions(-)
---
base-commit: c7518adb8b6ebdc481f6ed1fc42c7f45099806af
change-id: 20260613-tt-atomic-refactor-9c9b23a413f2

Best regards,
--  
Sven Eckelmann <[email protected]>