B.A.T.M.A.N Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Eckelmann <sven@narfation.org>
To: b.a.t.m.a.n@lists.open-mesh.org
Cc: Sven Eckelmann <sven@narfation.org>
Subject: [PATCH batadv v5 00/20] batman-adv: tt: atomic sashiko fixes
Date: Sat, 29 Aug 2026 08:18:11 +0200	[thread overview]
Message-ID: <20260829-tt-fixes-v5-0-88fce8fd683d@narfation.org> (raw)

There were a couple of sashiko reports regarding the
batadv-next-pullrequest-20260728 PR. I went through the TT code and tried
to handle them and at the same time already predict what else sashiko might
report as next. I needed to change the batadv_tt_local_remove() hash
interaction as preparation for the related NEW flag (and counter) handling.

And the netdev maintainers rejected this approach (for now). I had to
re-add the atomic_t code parts back in this patchset. But since the netdev
maintainers didn't like the atomic_t implementation, everything was changed
to atomic_t with the help of scoped_guard() or spin_(un)lock_bh (when the
routine used "goto").

This version of the patchset also includes the cleanups and swithches to
scoped_guards (when appropriate). The original cover letter was:

While working on the flag protection changes, it became apparent that the
current code is hard to maintain. Too many gotos with large sections which
are hard to crasp; because it is unclear how these sections are interact.
To simplify everything, sections which are handling a single task are
extracted in separate functions. This makes it cleared what the input and
output of each "section" are.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
Changes in v5:
- keep all batadv_tt_flags_get changes to "batman-adv: tt: use protected flag modifications"
- remove to non-RCU iterator in batadv_tt_local_transition_new() after
  switching to locked iteration
- remove RFC patch prefix
- integrate the cleanup patches which depend on this patchset
- Link to v4: https://patch.msgid.link/20260806-tt-fixes-v4-0-c2fc871fe807@narfation.org

Changes in v4:
- fix setting of BATADV_TT_CLIENT_ROAM batadv_tt_local_add_roam()
- move the roam_at setting in batadv_tt_global_del_roaming() before the
  setting of the flag
- don't unset BATADV_TT_CLIENT_NEW when avoiding the
  batadv_tt_local_size_dec() - it is simply not needed
- new patch: fix lock precondition for batadv_tt_local_size_inc() and
  document it
- clean up mini-helpers to avoid goto. precondition for using scoped_guard
- switch routines with goto's from scoped_guard to spin_(un)lock_bh
- Link to v3: https://patch.msgid.link/20260805-tt-fixes-v3-0-25b00b558470@narfation.org

Changes in v3:
- switched to spinlock_bh due to rejection atomic_t by netdev (and
  potentially easier code)
- switch back to RFC
- Link to v2: https://patch.msgid.link/20260804-tt-fixes-v2-0-487c48fc7fc4@narfation.org

Changes in v2:
- rebase on main
- add "batman-adv: tt: use atomic flag modifications" and "batman-adv: tt:
  simplify NEW flag transition code" because they are reverted on main
- add patch to extract the roam "add" code in a separate function
- make the "simplify NEW flag transition code" patch independent of atomic_t code
- Link to v1: https://patch.msgid.link/20260730-tt-fixes-v1-0-64e9e525d555@narfation.org

To: b.a.t.m.a.n@lists.open-mesh.org

---
Sven Eckelmann (20):
      batman-adv: tt: remove only the entry which was looked up from the hash
      batman-adv: tt: extract code handling a roam on add
      batman-adv: tt: simplify NEW flag transition code
      batman-adv: tt: drop unnecessary cleanup goto in helpers
      batman-adv: tt: use protected flag modifications
      batman-adv: tt: transition NEW local entries only under lock
      batman-adv: tt: don't uncount never committed clients on pending purge
      batman-adv: tt: decrement count for committed client on local_remove
      batman-adv: tt: look up wifi state of incoming interface in helper
      batman-adv: tt: extract allocation of new local entries
      batman-adv: tt: replace forward gotos in batadv_tt_local_add()
      batman-adv: tt: extract refresh of existing local entries
      batman-adv: tt: extract update of dynamic client flags
      batman-adv: tt: extract allocation of new global entries
      batman-adv: tt: extract merging of flags into existing global entries
      batman-adv: tt: replace add_orig_entry goto in batadv_tt_global_add()
      batman-adv: tt: extract removal of the superseded local entry
      batman-adv: tt: extract marking of a removed local entry
      batman-adv: tt: extract immediate purge of a local entry
      batman-adv: tt: drop the cleanup label from batadv_tt_local_remove()

 net/batman-adv/translation-table.c | 1100 ++++++++++++++++++++++++------------
 net/batman-adv/types.h             |    8 +-
 2 files changed, 736 insertions(+), 372 deletions(-)
---
base-commit: f3c33e7fcb7e88cc099b783faf26f0494b774571
change-id: 20260730-tt-fixes-fca2b722ebbd

Best regards,
--  
Sven Eckelmann <sven@narfation.org>


             reply	other threads:[~2026-08-29  6:19 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-29  6:18 Sven Eckelmann [this message]
2026-08-29  6:18 ` [PATCH batadv v5 01/20] batman-adv: tt: remove only the entry which was looked up from the hash Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 02/20] batman-adv: tt: extract code handling a roam on add Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 03/20] batman-adv: tt: simplify NEW flag transition code Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 04/20] batman-adv: tt: drop unnecessary cleanup goto in helpers Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 05/20] batman-adv: tt: use protected flag modifications Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 06/20] batman-adv: tt: transition NEW local entries only under lock Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 07/20] batman-adv: tt: don't uncount never committed clients on pending purge Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 08/20] batman-adv: tt: decrement count for committed client on local_remove Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 09/20] batman-adv: tt: look up wifi state of incoming interface in helper Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 10/20] batman-adv: tt: extract allocation of new local entries Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 11/20] batman-adv: tt: replace forward gotos in batadv_tt_local_add() Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 12/20] batman-adv: tt: extract refresh of existing local entries Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 13/20] batman-adv: tt: extract update of dynamic client flags Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 14/20] batman-adv: tt: extract allocation of new global entries Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 15/20] batman-adv: tt: extract merging of flags into existing " Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 16/20] batman-adv: tt: replace add_orig_entry goto in batadv_tt_global_add() Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 17/20] batman-adv: tt: extract removal of the superseded local entry Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 18/20] batman-adv: tt: extract marking of a removed " Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 19/20] batman-adv: tt: extract immediate purge of a " Sven Eckelmann
2026-08-29  6:18 ` [PATCH batadv v5 20/20] batman-adv: tt: drop the cleanup label from batadv_tt_local_remove() Sven Eckelmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260829-tt-fixes-v5-0-88fce8fd683d@narfation.org \
    --to=sven@narfation.org \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox