🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #22084

Re: [PATCH net-next 15/15] batman-adv: tt: drop ADD+DEL events of never announced clients

#22084
From: Sven Eckelmann
Date: Tue, 24 Nov 2026 21:02
147 lines
14135 bytes
--nextPart2249726.OBFZWjSADL
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="utf-8"; protected-headers="v1"
From: Sven Eckelmann <sven@narfation.org>
To: sw@simonwunderlich.de, netdev-bot+sashiko@kernel.org
Date: Tue, 24 Nov 2026 22:02:41 +0100
Message-ID: <2071514.yKVeVyVuyW@sven-desktop>
In-Reply-To: <179554084949.3135.16426370585063518179@kernel.org>
MIME-Version: 1.0

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

--nextPart2249726.OBFZWjSADL
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: This is a digitally signed message part.
Content-Transfer-Encoding: 7Bit

-----BEGIN PGP SIGNATURE-----

iHUEABYKAB0WIQS81G/PswftH/OW8cVND3cr0xT1ywUCawX7cQAKCRBND3cr0xT1
y50yAQDNQi+vtGSntlly8ShE3zzrK3+CZsHKQhJwg55Dds1DTgEA4K3LIwpHjAc+
91zj5Z+iAsW5VREI+Qgz6IsDpH/xzQg=
=MVS0
-----END PGP SIGNATURE-----

--nextPart2249726.OBFZWjSADL--
Technical Details
Message-ID: <2071514.yKVeVyVuyW@sven-desktop>
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370756-linux-kernel-netdev=dewy.ru
References: <20261123171827.3294525-16-sw@simonwunderlich.de> <179554084949.3135.16426370585063518179@kernel.org>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-370756-linux-kernel-netdev=dewy.ru
From: sven@narfation.org (Sven Eckelmann)
Newsgroups: linux.kernel.netdev
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
Organization: Usenet Network
Message-ID: <2071514.yKVeVyVuyW@sven-desktop>
References: <20261123171827.3294525-16-sw@simonwunderlich.de>
 <179554084949.3135.16426370585063518179@kernel.org>
MIME-Version: 1.0
Content-Type: multipart/signed; boundary="nextPart2249726.OBFZWjSADL";
 micalg="pgp-sha512"; protocol="application/pgp-signature"
Injection-Info: usenet.network;
	logging-data="38041"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:V00x8n03QLdkXSWCw1CA3Xy64VA= sha256:7QFrHLc23I6H7lRcGvBcFv/MOJoKRQuFwm/1/ABq1rU=
	sha1:PeWYGvz9BeOFuc49T8640GkLpNo= sha256:+Iv/dWIrIWSMs2IDsTiP0PfO7yMol2z2iY2yFMARINI=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 4456C125E32; Wed, 25 Nov 2026 00:03:01 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.051
X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31
	tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
	DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key)
	header.d=narfation.org
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id AnyiEPS2gRzi;
	Wed, 25 Nov 2026 00:02:57 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-370756-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=narfation.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id C8812125E2E; Wed, 25 Nov 2026 00:02:48 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 5A2843AED6; Tue, 24 Nov 2026 21:02:47 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1795554167;
	b=FuwZavSvZ6D9o4qJZvchFoHxi/ozUUdyzpzpU3wJ9dcdc5VVGQbgaUjvK5qRxgSMnjx4
	 raXYyNCmL+eMDCz2T/TUPcmUX2i2tTbg6FqJQkP3a1ZKueumczZaX/WhDv4kU1lZc8awl
	 mvOh0D/zRxULMwzVSzNcJQ7q+h/XRw4Kt2/cI9yNtxHU+5pGcCGxXeFVnE04vE2Lq1W3U
	 /RKmDFOCh8XJr/KHJU5KmdaKcF6xlSY01cr8FyzcuFAzb6Oy1RpWM+naQ2SLAObeN/EpY
	 LW4/FuwQrnHwHaJlXfkaCbeHR82I2nAW4PvAL8qS/m9YPE0hf39nT0CckyQGk1DToew==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795554167;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:From:To:
	 Cc:Subject:Date:Message-ID:In-Reply-To:References:X-Mailing-List:
	 List-Id:List-Post:List-Help:List-Subscribe:List-Unsubscribe:
	 List-Owner:Precedence:MIME-Version:Content-Type;
	bh=4JGiNssiIcSVO+k5XG7/GTij0g2M1gpRrtZJ04qYbvI=;
	b=BdFVU6myqpOIsfPPTS/7nmcFVbgjTlMCGjHfvB+wBd/TxL6xVSeSJUdUgLgl8d2bV1C6
	 Q0dSi3WIo3KBhZ9RoJckNO0riB9uHVq/o/e4mgsNyQD+zftk17gZJUteNopOqy3RpxcQy
	 EXvSE81hgi0mAcxIYqS2DzQgw716i9URH7pE4Zs7SzRxjWPMEaHBf4WI7+k0y6rGOn7N8
	 G+0YrHmqqA/mG2xKxUI7oDyju511BQ+08Xldl6T+mBcEsDgLE4CGQGMiNPGfnI7qMyY48
	 h9iJOPMcAFinpS2o3EHGeHlrN1gfM+NPIM8pDFzNo1dYJva5JidsqbtWR4s7A+Xl8sw==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=narfation.org header.i=@narfation.org header.a=rsa-sha256 header.s=20121 header.b=VBiFhedo;
	dmarc=pass header.from=narfation.org;
	spf=pass smtp.mailfrom=narfation.org;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 31C97606A32A;
	Tue, 24 Nov 2026 21:02:47 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (1024-bit key) header.d=narfation.org header.i=@narfation.org header.a=rsa-sha256 header.s=20121 header.b=VBiFhedo
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=213.160.73.56
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1795554166;
	b=B5F4Vj+7hLZQ1HrLTK4+EflA4jtTscUiwI9XwcP7Mn1QIIg0R8f+E7UipEMH6cdnpcdd
	 dtwhQAAvRPwLBjC9xMM+aU0Q9uLY6Dk9jNTGfEDtuBjcO0wRwSQWmH/xE5hMfBt1eD9T8
	 DMNRfevdThiAPpAmkLgO/qPN7oYhTXB34np75BblPoD0jQnLSQYeYXUoQwbn5fJH8lU+u
	 0IGTTLSUOpSOW8oOiQMOKa+mOj8yCrZNNR4tv7ZNWkx1+0pB6UW2s5WpoE0gHZRL+YQ8f
	 d4olrmUJNpUamopyFwqlKxHbBED5IHz+dI3jTj6fvOYzx4F+GgXMwLFyg9TkNb02wZA==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1795554166;
	h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date:
	 Message-ID:In-Reply-To:References:MIME-Version:Content-Type;
	bh=4JGiNssiIcSVO+k5XG7/GTij0g2M1gpRrtZJ04qYbvI=;
	b=IJwjw8+SlBdvjzjc7Zw8oZpYeF8jUZL3YPik9aSwBLFyV6dlEDdkCh2/r/GSIxyn1Dvk
	 cMEh5uABHTQ2uikkuoVxOlrEyOrQO1o7don4a5QcNi8lqsBKuf0RJIMeoiDzN00X1U6fx
	 AwmTFJyM5DsNFXcgdnaIsDZgskO+YMze5joeMs/BqCYUTpm/C3pKa2glgZUHJDFMoSZJr
	 dDAohhtQxdAH3KgOBmMZdNig+L3nHT40eC6Ff1Zk4GUvlNFCoEopH5OeFncbFuTFPqG1I
	 Vp24uYYcbwdshxzqSbiPpDERfFlbuM2CSArb4w+6Co8hx47riszt0AjFJGYqHIKmXBQ==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=pass header.from=narfation.org;
	spf=pass smtp.mailfrom=narfation.org;
	dkim=pass header.d=narfation.org header.i=@narfation.org header.a=rsa-sha256 header.s=20121 header.b=VBiFhedo;
	arc=none smtp.remote-ip=213.160.73.56
X-Received: from dvalin.narfation.org (dvalin.narfation.org [213.160.73.56])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4E35606A321
	for <netdev@vger.kernel.org>; Tue, 24 Nov 2026 21:02:45 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D4E35606A321
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=narfation.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=narfation.org
X-Received: by dvalin.narfation.org (Postfix) id 58AA02014F;
	Tue, 24 Nov 2026 21:02:43 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=narfation.org;
	s=20121; t=1795554163;
	h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
	 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
	 in-reply-to:in-reply-to:references:references;
	bh=4JGiNssiIcSVO+k5XG7/GTij0g2M1gpRrtZJ04qYbvI=;
	b=VBiFhedo04EAIz/Qylw9LFm+7RRDT8VKIZchXKdAlsoVp+mSKZna2Uljn6qt1ciaWTMs/y
	xWRJSi6OPtnQcKTu+xqLSZXv4on9mFh78CIgsFkI619LkO4DpFAKpRvCKRU4LGgqAn5dDd
	jiRDNoyXGnkcr10W3+hF+3PsdtjICi8=
X-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
X-In-Reply-To: <179554084949.3135.16426370585063518179@kernel.org>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list