From: Sven Eckelmann <sven@narfation.org>
To: sw@simonwunderlich.de, netdev-bot+sashiko@kernel.org
Cc: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com,
kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [PATCH net-next 15/15] batman-adv: tt: drop ADD+DEL events of never announced clients
Date: Tue, 24 Nov 2026 22:02:41 +0100 [thread overview]
Message-ID: <2071514.yKVeVyVuyW@sven-desktop> (raw)
In-Reply-To: <179554084949.3135.16426370585063518179@kernel.org>
[-- Attachment #1: Type: text/plain, Size: 5076 bytes --]
On Tuesday, 24 November 2026 18:20:49 CET netdev-bot+sashiko@kernel.org wrote:
[...]
> > @@ -685,6 +692,9 @@ static bool __batadv_tt_local_event(struct batadv_priv *bat_priv,
> >
> > lockdep_assert_held(&common->flags_lock);
> >
> > + if (cancelled)
> > + *cancelled = false;
> > +
> > tt_change_node = kmem_cache_alloc(batadv_tt_change_cache, GFP_ATOMIC);
> > if (!tt_change_node)
> > return false;
>
> [Severity: Low]
> Can the cancellation be skipped under memory pressure? In
> batadv_tt_local_event(), the new change node is allocated before
> changes_list is searched for a queued initial ADD.
See
https://patchwork.open-mesh.org/project/b.a.t.m.a.n./patch/20261124-event-late-allocation-v1-1-756780b98c10@narfation.org/
[...]
> > @@ -1883,6 +1919,11 @@ static void batadv_tt_local_unhash(struct batadv_priv *bat_priv,
> > * retry it. Such an entry is marked as del_unqueued instead. It stays in the
> > * local table until batadv_tt_local_purge_list() was able to queue its DEL.
> > *
> > + * A client whose initial ADD is still queued was never announced to the other
> > + * nodes. Its DEL cancels the ADD and the entry is removed from the local table
> > + * right away. The caller has to drop the hash reference of the entry after it
> > + * released the flags_lock.
> > + *
>
> [Severity: Low]
> This isn't a bug, but the first paragraph of the
> batadv_tt_local_set_pending() kernel-doc still reads:
>
> * The entry is kept in the local table until the next TTVN increment
> * so that a consistency-check response can still be answered.
>
> That is no longer always true with the new cancel path. Only this later
> paragraph mentions the exception.
>
> The summary line of batadv_tt_local_remove() also still says "logically
> remove an entry from the local table". Through
> batadv_tt_local_remove()->batadv_tt_local_remove_entry()->
> batadv_tt_local_set_pending(), the entry can now be unhashed and freed
> before any TTVN increment.
>
> Could both comments be updated? The callers of batadv_tt_local_remove()
> in mesh-interface.c and multicast.c rely on that description.
Will send a follow up patch:
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 7de69a30dda5de8f3e875acc21e4edfada838c9c..d69e5380f461c73443ddee949a2698ee02b8c0bf 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -1964,8 +1964,9 @@ static void batadv_tt_local_unhash(struct batadv_priv *bat_priv,
* @message: debug message describing the reason for the change
*
* Schedule the TT change announcement and set BATADV_TT_CLIENT_PENDING on the
- * entry. The entry is kept in the local table until the next TTVN increment
- * so that a consistency-check response can still be answered.
+ * entry. An entry which was already announced to the other nodes is kept in
+ * the local table until its DEL is committed with a TTVN increment so that a
+ * consistency-check response can still be answered.
*
* The entry is also marked as BATADV_TT_CLIENT_PENDING when the DEL could not
* be queued. The removal must not be lost because not all callers are able to
@@ -2106,13 +2107,19 @@ batadv_tt_local_remove_entry(struct batadv_priv *bat_priv,
}
/**
- * batadv_tt_local_remove() - logically remove an entry from the local table
+ * batadv_tt_local_remove() - remove an entry from the local table
* @bat_priv: the bat priv with all the mesh interface information
* @addr: the MAC address of the client to remove
* @vid: VLAN identifier
* @message: message to append to the log on deletion
* @roaming: true if the deletion is due to a roaming event
*
+ * An entry which was already announced to the other nodes is only removed
+ * logically. It is marked as BATADV_TT_CLIENT_PENDING and stays in the local
+ * table until its DEL is committed. An entry whose initial ADD is still queued
+ * is removed from the local table immediately. See
+ * batadv_tt_local_remove_entry() for details.
+ *
* Return: the flags assigned to the local entry before being deleted
*/
u16 batadv_tt_local_remove(struct batadv_priv *bat_priv, const u8 *addr,
>
> [ ... ]
>
> > @@ -1907,8 +1952,13 @@ batadv_tt_local_set_pending(struct batadv_priv *bat_priv,
> > lockdep_assert_held(&hash->list_locks[i]);
> > lockdep_assert_held(&common->flags_lock);
> >
> > - queued = __batadv_tt_local_event(bat_priv, common,
> > - common->flags | flags);
> > + queued = batadv_tt_local_event(bat_priv, common, common->flags | flags,
> > + false, &cancelled);
> > + if (cancelled) {
> > + /* the entry was never announced */
> > + batadv_tt_local_unhash(bat_priv, tt_local_entry, message);
> > + return true;
> > + }
>
> [Severity: Low]
> Does this hold when the DEL comes from a roaming event? The commit
> message says:
>
> The other nodes never heard about the client and don't need a DEL
> for it.
[...]
There is too much text for a low severity at this time of day. Just made a
note for later: https://www.open-mesh.org/issues/493
Regards,
Sven
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
prev parent reply other threads:[~2026-11-24 21:03 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 17:18 [PATCH net-next 00/15] pull request for net-next: batman-adv 2026-11-23 Simon Wunderlich
2026-11-23 17:18 ` [PATCH net-next 01/15] batman-adv: document refcount of returned objects Simon Wunderlich
2026-11-23 17:23 ` netdev-bot+sinfo
2026-11-23 18:13 ` Sven Eckelmann
2026-11-24 17:20 ` netdev-bot+sashiko
2026-11-24 21:11 ` Sven Eckelmann
2026-11-23 17:18 ` [PATCH net-next 02/15] batman-adv: mcast: use mla_lock also during mcast_free Simon Wunderlich
2026-11-23 17:18 ` [PATCH net-next 03/15] batman-adv: mark functions inheriting critical sections Simon Wunderlich
2026-11-23 17:18 ` [PATCH net-next 04/15] batman-adv: bla: register own backbone gw when claiming for local node Simon Wunderlich
2026-11-24 17:20 ` netdev-bot+sashiko
2026-11-24 19:19 ` Sven Eckelmann
2026-11-23 17:18 ` [PATCH net-next 05/15] batman-adv: tt: unhash local entries with hlist_del_init_rcu() Simon Wunderlich
2026-11-23 17:18 ` [PATCH net-next 06/15] batman-adv: tt: refresh local entry in single flags_lock section Simon Wunderlich
2026-11-24 17:20 ` netdev-bot+sashiko
2026-11-24 19:22 ` Sven Eckelmann
2026-11-23 17:18 ` [PATCH net-next 07/15] batman-adv: tt: don't remove unhashed local entries Simon Wunderlich
2026-11-24 17:20 ` netdev-bot+sashiko
2026-11-24 19:24 ` Sven Eckelmann
2026-11-23 17:18 ` [PATCH net-next 08/15] batman-adv: tt: don't queue local events for unhashed entries Simon Wunderlich
2026-11-23 17:18 ` [PATCH net-next 09/15] batman-adv: tt: remove unannounced local entries via pending state Simon Wunderlich
2026-11-23 17:18 ` [PATCH net-next 10/15] batman-adv: tt: keep local entry unchanged when ADD can't be queued Simon Wunderlich
2026-11-24 17:20 ` netdev-bot+sashiko
2026-11-24 19:30 ` Sven Eckelmann
2026-11-23 17:18 ` [PATCH net-next 11/15] batman-adv: tt: requeue DEL of pending local entry after failed allocation Simon Wunderlich
2026-11-24 17:20 ` netdev-bot+sashiko
2026-11-24 19:46 ` Sven Eckelmann
2026-11-23 17:18 ` [PATCH net-next 12/15] batman-adv: tt: extract removal of pending local entry Simon Wunderlich
2026-11-24 17:20 ` netdev-bot+sashiko
2026-11-24 20:16 ` Sven Eckelmann
2026-11-23 17:18 ` [PATCH net-next 13/15] batman-adv: tt: commit only the announced local changes Simon Wunderlich
2026-11-24 17:20 ` netdev-bot+sashiko
2026-11-24 20:33 ` Sven Eckelmann
2026-11-23 17:18 ` [PATCH net-next 14/15] batman-adv: tt: avoid list_lock for unchanged local clients Simon Wunderlich
2026-11-23 17:18 ` [PATCH net-next 15/15] batman-adv: tt: drop ADD+DEL events of never announced clients Simon Wunderlich
2026-11-24 17:20 ` netdev-bot+sashiko
2026-11-24 21:02 ` Sven Eckelmann [this message]
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=2071514.yKVeVyVuyW@sven-desktop \
--to=sven@narfation.org \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=netdev-bot+sashiko@kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sw@simonwunderlich.de \
/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 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.