All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH batadv v5 00/11] batman-adv: tt: shashiko 20260930 follow ups
@ 2026-11-18 11:41 Sven Eckelmann
  2026-11-18 11:41 ` [PATCH batadv v5 01/11] batman-adv: tt: unhash local entries with hlist_del_init_rcu() Sven Eckelmann
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: Sven Eckelmann @ 2026-11-18 11:41 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann, Sashiko

There were various reports in the Sashiko report from

* https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260930094558.3723766-2-sw%2540simonwunderlich.de
* https://sashiko.dev/#/patchset/20260930094558.3723766-1-sw@simonwunderlich.de

Some of them are about the rather bad locking behavior in TT and addressed
here. While looking at this, it was also noticed that the TT event handling
seems to be broken since the introduction of dynamic flag changes.

The source of truth is now the changes list. Only entries inside their are
applied (NEW -> included, PENDING -> deleted) in the local table. This
avoids a desync between the announced TT changes and the submitted local
table. But it also means that an entry which was added and then gets
directly removed cannot be dropped directly from the local table. It can be
that it is in the process of being committed and therefore must be marked
as pending and then be handled in the next commit phase. A situation which
caused problems in the past because TTVN and change list were completely
desynced.

Of course, this also causes headaches when it comes to error handling. When
a delete needs to be queued, and the allocation fails for this change list
entry, we still need to get this somehow in the change list. Otherwise the
entry would stay forever as PENDING in the local table. The entry is
therefore marked as del_unqeued and the next purge run will reattempt the
queuing of the deletion in the change list.

This makes the transitions well defined but looking at the full graph for
too long causes headaches. I will submit these graphs as reply and would
recommend only to look at the "main" (normal cases) and specialized "rare"
graph for the corner cases.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
Changes in v5:
- annotate functions with locking dependencies: batadv_tt_local_event(),
  batadv_tt_local_unhash_pending(), batadv_tt_local_commit_change()
- return false in case of an event allocation error in
  batadv_tt_local_add() to avoid forwarding traffic for this client
  https://sashiko.dev/#/patchset/20261116-tt-avoid-unhashed-event-v4-0-42c6bb518123%40narfation.org?part=6
- a client which was PENDING -> DEL was in changelist and then reappears
  between the changes list splice and the batadv_tt_local_commit_change()
  must be marked again as NEW (in batadv_tt_local_commit_change()) to make
  sure that an ADD is send again BUT it is not yet part of a full table sync
  https://sashiko.dev/#/patchset/20261116-tt-avoid-unhashed-event-v4-0-42c6bb518123%40narfation.org?part=9
- correctly explain the del_unqueue handling during a purge (which keeps
  the entry in the table until the DEL was actually queued)
- extract code to unhash local table entry table size adjustment
- Link to v4: https://patch.msgid.link/20261116-tt-avoid-unhashed-event-v4-0-42c6bb518123@narfation.org

Changes in v4:
- only permanently modify the local TT table based on the "changeset" for
  the TTN
- Link to v3: https://patch.msgid.link/20261102-tt-avoid-unhashed-event-v3-0-f37f59c80b0d@narfation.org

Changes in v3:
- rebase on post-2026.4 patches
- disallow a removal of an ADD from the TT changes whenever this change
  entry was at any point a DEL
- Link to v2: https://patch.msgid.link/20261008-tt-avoid-unhashed-event-v2-0-7c4eed81606d@narfation.org

Changes in v2:
- add patches to handle ROAM flags differently
- Link to v1: https://patch.msgid.link/20261007-tt-avoid-unhashed-event-v1-0-01c763657916@narfation.org

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

---
Sven Eckelmann (11):
      batman-adv: tt: unhash local entries with hlist_del_init_rcu()
      batman-adv: tt: refresh local entry in single flags_lock section
      batman-adv: tt: don't remove unhashed local entries
      batman-adv: tt: don't queue local events for unhashed entries
      batman-adv: tt: remove unannounced local entries via pending state
      batman-adv: tt: keep local entry unchanged when ADD can't be queued
      batman-adv: tt: requeue DEL of pending local entry after failed allocation
      batman-adv: tt: extract removal of pending local entry
      batman-adv: tt: commit only the announced local changes
      batman-adv: tt: avoid list_lock for unchanged local clients
      batman-adv: tt: drop ADD+DEL events of never announced clients

 net/batman-adv/translation-table.c | 910 ++++++++++++++++++++++++++-----------
 net/batman-adv/types.h             |  14 +
 2 files changed, 667 insertions(+), 257 deletions(-)
---
base-commit: a793cf82308e57a0e21c97e889c143cdbba67e5f
change-id: 20261006-tt-avoid-unhashed-event-76bb5f66d115

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


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-11-18 11:48 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-18 11:41 [PATCH batadv v5 00/11] batman-adv: tt: shashiko 20260930 follow ups Sven Eckelmann
2026-11-18 11:41 ` [PATCH batadv v5 01/11] batman-adv: tt: unhash local entries with hlist_del_init_rcu() Sven Eckelmann
2026-11-18 11:41 ` [PATCH batadv v5 02/11] batman-adv: tt: refresh local entry in single flags_lock section Sven Eckelmann
2026-11-18 11:41 ` [PATCH batadv v5 03/11] batman-adv: tt: don't remove unhashed local entries Sven Eckelmann
2026-11-18 11:41 ` [PATCH batadv v5 04/11] batman-adv: tt: don't queue local events for unhashed entries Sven Eckelmann
2026-11-18 11:41 ` [PATCH batadv v5 05/11] batman-adv: tt: remove unannounced local entries via pending state Sven Eckelmann
2026-11-18 11:41 ` [PATCH batadv v5 06/11] batman-adv: tt: keep local entry unchanged when ADD can't be queued Sven Eckelmann
2026-11-18 11:41 ` [PATCH batadv v5 07/11] batman-adv: tt: requeue DEL of pending local entry after failed allocation Sven Eckelmann
2026-11-18 11:41 ` [PATCH batadv v5 08/11] batman-adv: tt: extract removal of pending local entry Sven Eckelmann
2026-11-18 11:41 ` [PATCH batadv v5 09/11] batman-adv: tt: commit only the announced local changes Sven Eckelmann
2026-11-18 11:42 ` [PATCH batadv v5 10/11] batman-adv: tt: avoid list_lock for unchanged local clients Sven Eckelmann
2026-11-18 11:42 ` [PATCH batadv v5 11/11] batman-adv: tt: drop ADD+DEL events of never announced clients Sven Eckelmann
2026-11-18 11:45 ` [PATCH batadv v5 00/11] batman-adv: tt: shashiko 20260930 follow ups Sven Eckelmann

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.