Skip to content

batman-adv: tt: use atomic flag modifications

Sven Eckelmann batman 2 versions – New

Get series with b4
b4 am [email protected] change-id 20260613-tt-atomic-refactor-9c9b23a413f2

Versions newest first

  1. v2 Latest2 patches 0 repliesNew
  2. v1 RFC3 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- rebase and drop already merged first fix
- remove RFC prefix
- Link to v1: https://patch.msgid.link/[email protected]

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2batman-adv: tt: use atomic flag modificationsnet/batman-adv/translation-table.c net/batman-adv/types.h+167 -810 replies
2/2batman-adv: tt: simplify NEW flag transition codenet/batman-adv/translation-table.c+9 -280 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH batadv v2 0/2] batman-adv: tt: use atomic flag modifications

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.

---
Changes in v2:
- rebase and drop already merged first fix
- remove RFC prefix
- Link to v1: https://patch.msgid.link/[email protected]

---
Sven Eckelmann (2):
batman-adv: tt: use atomic flag modifications
batman-adv: tt: simplify NEW flag transition code

 net/batman-adv/translation-table.c | 255 +++++++++++++++++++++++--------------
 net/batman-adv/types.h             |   2 +-
 2 files changed, 162 insertions(+), 95 deletions(-)

---
base-commit: 6f34546691685542e30c7f7a3a5612821e917560
change-id: 20260613-tt-atomic-refactor-9c9b23a413f2

Best regards,

Signature · 1 line
Sven Eckelmann <[email protected]>