Article View: linux.kernel.netdev
Article #21183[PATCH net-next 09/15] batman-adv: tt: remove unannounced local entries via pending state
From: Simon Wunderlich
Date: Mon, 23 Nov 2026 17:18
Date: Mon, 23 Nov 2026 17:18
94 lines
12754 bytes
12754 bytes
From: Sven Eckelmann <sven@narfation.org>
batadv_tt_local_remove_entry() unhashes an entry which still carries
BATADV_TT_CLIENT_NEW immediately because it was not yet announced to the
other nodes. But the flag is only cleared at the end of the commit. The ADD
of the entry might therefore already have been taken for the next TTVN when
the flag is checked.
Handle such an entry like an already announced one: queue the DEL and mark
the entry as BATADV_TT_CLIENT_PENDING. It is then removed from the local
table when the pending entries are purged by the next commit.
batadv_tt_local_purge_pending_clients() already takes care of not
uncounting an entry which was never counted.
This also leaves the commit as the only place which finishes the removal of
a local entry. A follow-up change relies on this to apply exactly the
announced changes to the local table.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
net/batman-adv/translation-table.c | 35 +++++-------------------------
1 file changed, 5 insertions(+), 30 deletions(-)
diff --git a/net/batman-adv/translation-table.c b/net/batman-adv/translation-table.c
index 2828e362640a..977f62c88da7 100644
--- a/net/batman-adv/translation-table.c
+++ b/net/batman-adv/translation-table.c
@@ -1745,13 +1745,11 @@ batadv_tt_local_set_pending(struct batadv_priv *bat_priv,
* @roaming: true if the deletion is due to a roaming event
* @curr_flags: pointer to store the flags of the entry before it was removed
*
- * For an already announced entry, the (roamed) DEL change is queued and the
- * entry is marked as BATADV_TT_CLIENT_PENDING by batadv_tt_local_set_pending().
- * It stays in the local table until the next ttvn increment.
- *
- * An entry which still carries BATADV_TT_CLIENT_NEW was added right after the
- * last ttvn increment and was not (yet) announced. It is therefore removed
- * from the local table immediately.
+ * The (roamed) DEL change is queued and the entry is marked as
+ * BATADV_TT_CLIENT_PENDING by batadv_tt_local_set_pending(). It stays in the
+ * local table until the DEL is committed with the next ttvn increment. This
+ * also applies to an entry which still carries BATADV_TT_CLIENT_NEW because its
+ * ADD might already have been taken for the next ttvn.
*
* An entry which was already removed from the local table after it was looked
* up is ignored and BATADV_NO_FLAGS is stored in @curr_flags.
@@ -1770,7 +1768,6 @@ batadv_tt_local_remove_entry(struct batadv_priv *bat_priv,
spinlock_t *list_lock; /* protects write access to the hash lists */
struct batadv_tt_common_entry *common = &tt_local_entry->common;
struct batadv_hashtable *hash = bat_priv->tt.local_hash;
- bool unhashed = false;
u16 flags;
u32 i;
@@ -1795,24 +1792,6 @@ batadv_tt_local_remove_entry(struct batadv_priv *bat_priv,
if (roaming)
common->flags |= BATADV_TT_CLIENT_ROAM;
- if (common->flags & BATADV_TT_CLIENT_NEW) {
- batadv_dbg(BATADV_DBG_TT, bat_priv,
- "Deleting local tt entry (%pM, vid: %d): %s\n",
- common->key.addr,
- batadv_print_vid(common->key.vid), message);
-
- hlist_del_init_rcu(&common->hash_entry);
- atomic_inc(&hash->generation);
-
- /* The entry was never announced and was therefore
- * never counted in the local table size.
- */
- __batadv_tt_local_event(bat_priv, common,
- common->flags | BATADV_TT_CLIENT_DEL);
- unhashed = true;
- break;
- }
-
flags = BATADV_TT_CLIENT_DEL;
if (roaming)
flags |= BATADV_TT_CLIENT_ROAM;
@@ -1822,10 +1801,6 @@ batadv_tt_local_remove_entry(struct batadv_priv *bat_priv,
}
spin_unlock_bh(list_lock);
-
- /* drop reference of removed hash entry */
- if (unhashed)
- batadv_tt_local_entry_put(tt_local_entry);
}
/**
--
2.47.3
Technical Details
Message-ID:
<20261123171827.3294525-10-sw@simonwunderlich.de>Path:
mbox-mo1.pugleaf.net!news-can.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-369608-linux-kernel-netdev=dewy.ruReferences:
<20261123171827.3294525-1-sw@simonwunderlich.de>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-can.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-369608-linux-kernel-netdev=dewy.ru From: sw@simonwunderlich.de (Simon Wunderlich) Newsgroups: linux.kernel.netdev Subject: [PATCH net-next 09/15] batman-adv: tt: remove unannounced local entries via pending state Date: Mon, 23 Nov 2026 18:18:21 +0100 Organization: Usenet Network Message-ID: <20261123171827.3294525-10-sw@simonwunderlich.de> References: <20261123171827.3294525-1-sw@simonwunderlich.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Injection-Info: usenet.network; logging-data="3939432"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:kINNrsvId818uo0qNhRiNRRFJF4= sha256:zv+P312KUWz6CtAP7tVsPDoAEL5iW+/sTa9M0aIWJUU= sha1:lKY5HYcJVstKbQqKvYlX1GM8ojI= sha256:YoeG/K6aWJ+QbufTOxAHwrVHZjoeiNeRe/2qvhTL4Y0= 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 0E2AD125DC6; Mon, 23 Nov 2026 20:25:40 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.05 X-Spam-Status: No, score=-3.05 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, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key) header.d=simonwunderlich.de 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 AwSt7eMtuKKi; Mon, 23 Nov 2026 20:25:36 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.105.105.114; helo=tor.lore.kernel.org; envelope-from=netdev+bounces-369608-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=simonwunderlich.de X-Received: from tor.lore.kernel.org (tor.lore.kernel.org [172.105.105.114]) by mail.dewy.ru (Postfix) with ESMTPS id D29DD125DC0; Mon, 23 Nov 2026 20:25:30 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by tor.lore.kernel.org (Postfix) with ESMTP id 9FB1A2EE7D; Mon, 23 Nov 2026 17:18:49 +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=1795454324; b=5Lp06swJPzL3dROVRVUj1drRTDMZETFK58WLI+cK/XlX9+TEyQIiQSNoM/hj8JSp+IdY P3XZCVlyvkehsDuKUyYJrPFsY4Po8a6zCZEINaJK3v813E2cuY/K+xzuigqLjHPUxFftq RXLFSWKxWNag6L+KfUQi0PKwdFu30InvXg06knVjIph+n4dla7/VOvQPpCnB2VJp21Kac E/C1tieUeLDlAUU5BTrqemY0YX3km7phN6Wjp8vGJ/NkiPfk3LQ82WQeTjaSMZ6P8Q/EN JczFHjeFsXJImLzM4G30XqdFNIAq/TuCO38GUtHjgZo6dRXpJuCxK6m5rHnphLTuKBw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795454324; h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:From:To: Cc:Subject:Date:Message-ID:X-Mailer:In-Reply-To:References: X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe: List-Unsubscribe:List-Owner:Precedence:MIME-Version: Content-Transfer-Encoding; bh=oJvHQFMgooA7UahwimsOb3OkFjRJ0W83iVe8uaAwcJo=; b=rSU6S4ytiflk8V4vGYIdmoZ8mios7vIf8bzsxQSn/CdOrMkVDbxE6cCUhRnWiyUrWVXC TdT0u4MqY0VS01EVkXgVMBIBSp1O0Y1dwjracRy58FDPj5dIiuv9eHC73aA6IVndEc09d Qn9wYGJpI00/qg7GiObnaZ16f0neD0Ekog6pNJ94mEJl2TrRlpbsYBZFQTnJ8mwQa0nUt C8VX+YOQEaMT9ROQKDDakoFwv7HTLrb+/TJdGQR7iK70Z5vAQl4Qudu7NLXdbuZM24buL MrHIXxB8TLggpiQdXPmzWTaEucYmTINjrQoVgOyehoGIXEgoP2b9ICQFQERsGdm2kJw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=simonwunderlich.de header.i=@simonwunderlich.de header.a=rsa-sha256 header.s=09092022 header.b=aSXbZnpz; dmarc=pass header.from=simonwunderlich.de; spf=pass smtp.mailfrom=simonwunderlich.de; 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 79657606A333; Mon, 23 Nov 2026 17:18:44 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=simonwunderlich.de header.i=@simonwunderlich.de header.a=rsa-sha256 header.s=09092022 header.b=aSXbZnpz X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=23.88.38.48 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795454323; b=juEuuz4HfzIMXlA1q2BHSTSdElU5w7q6JCLUJTI+F0wncnNR0bUZ2YnZWqIS+HvQBzBE rO0Jzj9UlujeHUq4YlH/pNN5sRcC9mK6tGr22klP2XAtHBJz+zT+sEEGBRMzl043adp8r ZwuYDoROvOIt9zGKSkh5b6dSPqmnomrbxiAWksS3V251SewegZal8mcNxRFX86kVOlXC/ WNgOAdZLp9vIWmi/nDWOJnBiRhLL83YbkjuWkM9sGzPLouCDqEbh1fSy1DN8h4raJfGsn /zaeu2D6biSBw48+zkvM1HVUHybIuIkJ1KV68krJK+Gvdwu1dSq0idoZGYaKWwQe6sg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795454323; h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date: Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=oJvHQFMgooA7UahwimsOb3OkFjRJ0W83iVe8uaAwcJo=; b=kQNbJNejnQzr8AoJhMdRCPi2kDFnh0VPZQIv9FT48lQ4hVd0LG9wAnSM4hCl4airaB4a qTx86uaPgfnnuqESLJU2nA+DH+awGJWu8DrmeYqSw3UA0Iq9jj7HcW5QvtXJ2Cib0YkXV Kjo6KlfZaew0pNHCeR10mGkw5MPuCldFbI4E4V04n2HR+uE3SnKXSQzO6/JepMvryb9qJ nFsbIXRMw6oUcQBZbk5AX3Ek7W+iMdMWVPyVugtMgdcb+Tcsniqz+3crH+Acj98hcZgmV NGsL6Jand/0BrxaiRO/K3itmrNO8cCjVZijHJNdaPNI9bEnDLImUBx3uBfbsHwi8b9w== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=simonwunderlich.de; spf=pass smtp.mailfrom=simonwunderlich.de; dkim=pass header.d=simonwunderlich.de header.i=@simonwunderlich.de header.a=rsa-sha256 header.s=09092022 header.b=aSXbZnpz; arc=none smtp.remote-ip=23.88.38.48 X-Received: from mail.simonwunderlich.de (mail.simonwunderlich.de [23.88.38.48]) (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 UTF8SMTPS id 2CFA4606A33D for <netdev@vger.kernel.org>; Mon, 23 Nov 2026 17:18:43 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2CFA4606A33D X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=simonwunderlich.de X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=simonwunderlich.de X-Received: from kero.packetmixer.de (p200300C59714C2e05a704819B6ba2dB4.dip0.t-ipconnect.de [IPv6:2003:c5:9714:c2e0:5a70:4819:b6ba:2db4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange secp256r1 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.simonwunderlich.de (Postfix) with UTF8SMTPSA id 61A1BFA3E2; Mon, 23 Nov 2026 18:18:41 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=simonwunderlich.de; s=09092022; t=1795454321; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=oJvHQFMgooA7UahwimsOb3OkFjRJ0W83iVe8uaAwcJo=; b=aSXbZnpzBuOvGm4Ekc6962RsfPVSRVOMkKFf24ZO4q1PKDwcYOvS3+01CtwP+Lp8C8UoED ZYfSRXARLYvs3+VlXrGZop48llPG22oU587wNC2iTE8VPJCkCnYacR26ZV0+B+RUvcnydh sjYoI1lGJcevePFeCfPgGvsLXGTMe9qGxY+7mu/FAVNzG8/6+4kJoE/WHcbvlNuBTPyzpu 1DE93c+KzNlmptbMLNjHc6zz/B5qGsRVL9ydCj6RwQRkSedSCrAg6t05Cw/sFBCeRgDnGo 7/gaqJ4/JUshZa8lHCMhzdVJIFccT8r8PmSCjxlu17mIH6UEl/cHrR677xgtRw== X-Cc: "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Simon Horman <horms@kernel.org>, b.a.t.m.a.n@lists.open-mesh.org, Sven Eckelmann <sven@narfation.org>, Simon Wunderlich <sw@simonwunderlich.de> X-Mailer: git-send-email 2.47.3 X-In-Reply-To: <20261123171827.3294525-1-sw@simonwunderlich.de> 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