From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw1-f182.google.com (mail-yw1-f182.google.com [209.85.128.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD9BA3264C1 for ; Wed, 26 Aug 2026 04:15:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787717738; cv=none; b=KeF19HzqSYAMzX8PeEf51ThXNyxH3ZeaRXFrlFmGEl+paZR8nHMO83pjE/hI6bj5JD98JGDR1ohqfMIh5uclGpfNcsG94xlkPni61iqvTnU2gWhF4HSmFD+w+IUrhqMjNQ5FSheHw0RY+h0iBbwTtsuKX5W2Jp76NrMEqulZ1/Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787717738; c=relaxed/simple; bh=4ONt0gXh/2uHX6zYjWxw7ziwPFAUYEy4Miwa68YuEo4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kB+mMsNjcBuzVECQO8cnaw039Ba1pTuEAVtKdEVYr1M7z70LqABfit6Y6hBq11IsXKezKEOedyygkhpwjd4JlMgKLKEuzrcpRo2B8h8ZJSVFAtVDUA4xIgrLG4L/nah7T6p5xvZBaQ38TNUNnWxQE7HbJk0d+E4+8CD1FfwaX2A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=qRUvSnWZ; arc=none smtp.client-ip=209.85.128.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qRUvSnWZ" Received: by mail-yw1-f182.google.com with SMTP id 00721157ae682-857d1184d29so2836847b3.2 for ; Tue, 25 Aug 2026 21:15:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787717736; x=1788322536; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=np00EX9dbTGoqYjv7UUjptr42nQcnWt1jorSNIDNa/c=; b=qRUvSnWZCPQIfhyLRibyMFsMqurZjKOJxG51cVW7lOya6H9nexTWD+WKoCdn6nOXIf agu/AVay7YAcztdDrDnBljr7dUhlOt4+ZCdGOBkf4JrWYTnTfRG+6/06WKS0bGlLPvef gvVy/h95yY5FkIQxyuS1+QoTtxFMMwZvl5ZPOErzQwrTCb9gY/OdhIiT+5VEbWv1+0/g iJdNLR3QX1KVWudxOd/Po77esBWrnBH6GGcWuMr5TPeftL+Yq/gcUbWJKT1woIo+XOSw LkfZOBSdWg/O2ii5pFslktF/wAM0zVx+AWgZKSxYOJL5fTfSontaJ/Xi+rd+uPGcJvOx CWdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787717736; x=1788322536; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=np00EX9dbTGoqYjv7UUjptr42nQcnWt1jorSNIDNa/c=; b=XqhDK73xeZ11vt+ouqKpRHAhDCmyXu4eGYIC8RqWk7JXZqVrTm2j5QNMHts0wPTNyV YfKBLeHI/Qhn0mi/tgeomcGnIPiKSWT/edGkTmB7J212E9S8XSPjpTOkXd5v5mjJdy2C qKztm5Iyj+cHMF25c4fHhizlPUdn+hpa2z+UIKbVzite+bmDejCVa+Dg98o6yHCXkidY jfeRlhjQOr5cZWzLlcgHqKIbXsUjIlcPrifFtb2tVIewXHpzm81JkMkempB8UAkJL+3L SFJNmdrWyUU8u9BGf7/1jjwhAfjqbCSMfq19JvtoMUlUsGd8643ReVBvEZjLuSOluRn3 wijQ== X-Forwarded-Encrypted: i=1; AHgh+RqyIrb2NWEp2YeDc1mhoY2j4KpsrJaqG58r1GNc9ztIHgVlVW6ZD4OmAMaWaBaSkJ4V0tRO22baBog4tHc=@vger.kernel.org X-Gm-Message-State: AFuF++m2MzdkiVdc0wW8BpGdX5+x8OjJpGmMDvCb+99jlFXgJEZFcGI7 R+JKxW/ZpuPemlfu1ARvGehGzNqDpoYvb8FEHDwg9oJRBsaxwtAyp1x/dkP+F+Sj X-Gm-Gg: AR+sD12SDGU4Ki4AN33EvBtsKyZUlCRf5PCpCi9mhkmO/BJMDrqrevoPlpj1FnXOxP/ LMMNATkiCdTjdGexjlGk20PNgzsqIHPjCTDU786Kr9jXvGdDwU0o+YCCI1uhH3z/JmEJXnHm59p ylWtWygaXyAtPtnPoW5/EOHkKIwrxMG9T1Y+EPdtzc+yyzzWUZFcS7iahnKmHWHiq0G/Fj1oH2G kjsXtzRow2SnpDBb20IcXGz5nhIrN+u4koBdGpLQWGFdrHJv9UcgdRbwrR+gr6J4+8mwuD3wNLB DYyEaYxbqO7KQ7movKLfVWy2CR4R5Znrl+m09AhP8PYu40KXiLPwoloCTrwDkGcqa4LO4+nL6kQ Sby5OpBsHQHAp7IaSELdm5ZK6sq3Q3WvcydOc7iEaUwutYrs3Y1xhZ/O6RrnpNppTfvxrm741kW 9iClLNsLee2JgwxWAPAaTX7GIWYRoxosFqTyDOoNAlhi2TCCAXWM3uWDgzVvrSxU90pHA= X-Received: by 2002:a05:690c:3747:b0:7db:a109:f12f with SMTP id 00721157ae682-8573be1b0bamr18128917b3.1.1787717735885; Tue, 25 Aug 2026 21:15:35 -0700 (PDT) Received: from mac.lan ([136.55.173.105]) by smtp.gmail.com with ESMTPSA id 00721157ae682-85705380b5esm10344257b3.8.2026.08.25.21.15.35 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Tue, 25 Aug 2026 21:15:35 -0700 (PDT) From: "Cen Zhang (Microsoft)" To: ap420073@gmail.com Cc: AutonomousCodeSecurity@microsoft.com, andrew+netdev@lunn.ch, blbllhy@gmail.com, davem@davemloft.net, edumazet@google.com, horms@kernel.org, kuba@kernel.org, kys@microsoft.com, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, pabeni@redhat.com, tgopinath@linux.microsoft.com, xmei5@asu.edu Subject: Re: [PATCH net] amt: do not store tunnel pointer in skb control block Date: Wed, 26 Aug 2026 00:15:29 -0400 Message-ID: <20260826041529.46139-1-blbllhy@gmail.com> X-Mailer: git-send-email 2.55.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Thanks for the feedback. Just getting back to this thread. On Thu, Aug 20, 2026 at 10:18:43PM +0900, Taehee Yoo wrote: > This looks like it adds a per-packet linear scan over all tunnels, > so I'm concerned about performance when there are many tunnels. > Do you have any idea how to avoid this regression? I see two possible approaches: 1. Keep the v1 implementation. It is the simplest fix, but changes the Query dequeue path from an O(1) pointer access to an O(n) lookup. I am not sure whether that cost is significant in practice for two reasons: this handles IGMP/MLD Query control packets rather than multicast data packets [1], while the hotter multicast data path already walks tunnel_list for each skb [2]; and max_tunnels defaults to 128. However, max_tunnels is configurable, so users can set it much higher. 2. Add a small per-device bucket hash keyed by (ip4, source_port) to [1], while keeping tunnel_list for multicast fan-out in [2]. This avoids a new linear lookup cost, but adds a second index that must be maintained during tunnel creation, expiry, and device teardown. I am not sure whether that is overkill for this fix. I would appreciate your further feedback here and will prepare v2 after settling on the approach. > I think this comment is not necessary. Please remove it. Agreed. I will remove it in v2. [1] https://github.com/torvalds/linux/blob/0f23d56f17fdfc7db69d51f64c8b91bbab947aa9/drivers/net/amt.c#L1261 [2] https://github.com/torvalds/linux/blob/0f23d56f17fdfc7db69d51f64c8b91bbab947aa9/drivers/net/amt.c#L1276