🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.netdev
Article #24871

Re: [RFC PATCH net-next 4/9] amt: offload TX handoff, ingress punt rule and counters

#24871
From: Antonio Quartulli
Date: Tue, 01 Dec 2026 00:34
51 lines
11824 bytes
On Sat, Nov 07, 2026 at 06:44:28PM +0000, Omar Ramadan wrote:
> +	if (b->path == AMT_OFFLOAD_PATH_INGRESS) {
> +		amt_offload_count(amt, AMT_OFFLOAD_CNT_PUNT_DROPPED);
> +		consume_skb(skb);
> +		gone = true;
> +		goto out;
> +	}

amt can't tell a punted copy from a packet legitimately routed to the
relay. Traffic for the group that never crossed the hardware, from
another NIC or a local sender, is dropped here and the only trace is
punt_dropped. In addition, on ingress a leave doesn't clear hw_active,
so a departed gateway keeps receiving until the recommit.
No provider implements this path; so I presume it can be dropped from
this series.

> +	res = b->ops->xmit(&b->pub, g->hw, skb, READ_ONCE(g->hw_gen));
> +	switch (res) {
> +	case AMT_OFFLOAD_CONSUMED:
> +		gone = true;
> +		break;

With a hardware provider, consumed traffic never shows up in the
relay's counters: ip -s link stays flat, and ops->stats is never called.
netdevsim hides this because its copies go back through amt_udp_xmit().
IFLA_STATS_LINK_OFFLOAD_XSTATS is probably the place for these counters.

A leave withdraws the group to software at once, but a join keeps
serving the old committed set until the reconciler recommits. A new
gateway therefore gets nothing for as long as the reconciler is behind,
which is unbounded under a backlog or a reset loop. Software would have
served it from the next packet. Withdrawing around every commit (see
1/9) fixes this.

> +EXPORT_SYMBOL_GPL(amt_offload_encap_xmit);

This is exported only so that netdevsim can reuse amt's own encap. The
reference provider therefore runs amt's code, and the "byte-identical to
software" check is circular.

> +	default:
> +		WARN_ONCE(1, "amt: offload xmit returned %d\n", res);
> +		break;

After an unknown return value the skb's ownership is unknown, yet the
code falls back to software and uses it. Treat it as consumed, or make
the contract leave no third option. What do you think?

Regards,
Antonio
Technical Details
Message-ID: <20261201003458.3731956-5-antonio@mandelbit.com>
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374560-linux-kernel-netdev=dewy.ru
References: <20261107184437.2783174-1-omar@blockcast.net> <20261107184437.2783174-5-omar@blockcast.net>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!srl.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374560-linux-kernel-netdev=dewy.ru
From: antonio@mandelbit.com (Antonio Quartulli)
Newsgroups: linux.kernel.netdev
Subject: Re: [RFC PATCH net-next 4/9] amt: offload TX handoff, ingress punt rule and counters
Date: Tue,  1 Dec 2026 01:34:51 +0100
Organization: Usenet Network
Message-ID: <20261201003458.3731956-5-antonio@mandelbit.com>
References: <20261107184437.2783174-1-omar@blockcast.net> <20261107184437.2783174-5-omar@blockcast.net>
MIME-Version: 1.0
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
	logging-data="1576350"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:t+VC+9QxkPXZbzuMO0mk/7LmigA= sha256:fKnzMijfqC8w0KHc2wYmFUyv9kki/EizJToF6mSlV58=
	sha1:MR0Ov3smbcN78c5G8r2nMV1qY9Q= sha256:D8RE5r11ceI8FI/DCE5dR2We69x6xEZ1ZfrOFUBBqgw=
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 0E458126017; Tue,  1 Dec 2026 03:36:02 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.95
X-Spam-Status: No, score=-1.95 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, 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=mandelbit.com
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 ZVKUCsI6uh7F;
	Tue,  1 Dec 2026 03:35:59 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374560-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=none (p=none dis=none) header.from=mandelbit.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 37E63126018; Tue,  1 Dec 2026 03:35:51 +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 E84532E9BF; Tue,  1 Dec 2026 00:35:30 +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=1796085326;
	b=lN2maQIznShBZEwIPsUZcL0JlHGZ+1m6bnon3DstwCf/C5k7QmzOidejkd7WNoc59dZ9
	 m08/I2G+1VfPoi1O8hhGf7U2P794uToft6CRa4igOQxyTpufSe3+yGkYoTnJFi9TPQJQQ
	 AAOT388DR2gWOSEZ6Xq7i74ao0UpVtAL38DuObzl5cBPXKtpXzUVjjPOJWJNdQQJxp2QA
	 uWbsMYFP1+R9H/+GZqkWVS1sWPj+gpY+I9n6A5y5BixIQzfsQLlN0Qt2Lizjs34trLxGj
	 3AAmGLxchiInv0zI/GGio2aki7NUfOu5OKvKlzaxd6zA+mRoIn6Tobs9WEH3L/DTH7Q==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796085326;
	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:X-Rspamd-Queue-Id;
	bh=b3x8TDvlHRDeTEyuy1sOFP6c9gCHTp5jrP5MFftbhBc=;
	b=4D4BEZGezQp5R/77G07bEmVnRZICpoRdrNyrW+VZ9F0UCDilTqIIJKEtct7q8Dc127k9
	 baa4nVfqk+z3ndenpOjoKZUtYhxJi9nswQEXOpc0QYnZvzFlr8zHxQjft3V9O0hjAPJCs
	 3RohMN8j0HyljMagoiZ71Li+6r9B5MCIXvwgXoKW29qF2YAhaPqaCaj81E8ZQfb4ZJZQu
	 eAOPb0urVo8m7A6mXXDMpKgr0PD0oFVvy66xDtX8kf+gDE7pNrmo4AJfFpf8n0onSj28G
	 izcFemzQskwj4zMNlNCtL5s4TPbxB6WBW6vlkZ2zTqyodVSZLooDajI/Iazyso8IYVA==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dkim=pass header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=T6vvtH1S;
	dmarc=none header.from=mandelbit.com;
	spf=pass smtp.mailfrom=mandelbit.com;
	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 DDE6F606A686;
	Tue,  1 Dec 2026 00:35:25 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=T6vvtH1S
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.10.208.51
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
	t=1796085325;
	b=dybxjCB1Br0fIBMcmh3P5Cd36IrjFCKmYCk7bEC6Uo3agVFK4sa4q29WczQ9U/UOoS0m
	 t4UQEf6eYYHQXoxo3wxeandLSfJwZnlnHInEsNYEBta0CunUDelagqLszI5SJEtI3lSh8
	 2RkXhWKpVzImT0EKS8OXSuDio045jD+FX57DtnKPicGTsavgjmpqJNx9wLV8RNSPUx+Tq
	 PtjLciVwHkHTibU6zghnTBgi8MlsAPxjYAwicGCEbrF7NcQgpoHYYRDGuMovwRj2CiWc0
	 7+bddJ7PwXnT2rllbvh43BF0af84NkQPNcfdnzuJKmgCM/MAlEjTVv2N+8EiMHnQ7lg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1796085325;
	h=DMARC-Filter:Received:DKIM-Signature:From:To:Cc:Subject:Date:
	 Message-ID:X-Mailer:In-Reply-To:References:MIME-Version:
	 Content-Transfer-Encoding:X-Rspamd-Queue-Id;
	bh=b3x8TDvlHRDeTEyuy1sOFP6c9gCHTp5jrP5MFftbhBc=;
	b=SfXw5OgQWGJC3rBlWtYIBt1AGIEcWkHjyVd2ak0W7uBcxEpVf6gqf3OOwBxjUaALqkPA
	 xE3gEPEQILiZRssKEzbjnKeHGsCqfs/smMokIf0meIgTpyz78vR2pW1peVM8i7TDnhrv0
	 BQ0IwPNwaaBNodBDw37cWRgvISK126VUgTu36U2tWWq8WnoeLXvrqEyxsooXJYzq0h3em
	 mbBZjpXnEAm5o8BGGWibz9eB/z87GcNwAVC0FrawbKPlynlDU3RyW7l608rw9yvMzyIir
	 esdikJ/C+ebtiUI0HlZUZPxyaRy1uKVHt7ZPyFBfQ8EiZF7l6AlgZDayGjnlKgrHA5g==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; 
	dmarc=none header.from=mandelbit.com;
	spf=pass smtp.mailfrom=mandelbit.com;
	dkim=pass header.d=mandelbit.com header.i=@mandelbit.com header.a=rsa-sha256 header.s=MBO0001 header.b=T6vvtH1S;
	arc=none smtp.remote-ip=195.10.208.51
X-Received: from mout-b-206.mailbox.org (mout-b-206.mailbox.org [195.10.208.51])
	(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 887C2606A69F;
	Tue,  1 Dec 2026 00:35:24 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 887C2606A69F
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mandelbit.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mandelbit.com
X-Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by mout-b-206.mailbox.org (Postfix) with ESMTPS id 4jdhkC1LTKzSy;
	Tue, 01 Dec 2026 01:35:15 +0100 (CET)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com;
	s=MBO0001; t=1796085315;
	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=b3x8TDvlHRDeTEyuy1sOFP6c9gCHTp5jrP5MFftbhBc=;
	b=T6vvtH1SMoH9VCwUVYX3YqiPu/ll3CnSHr6ifmLRKW4KMOKp5SB1aNV+L0fIJ+AK+De8cP
	gnEdTxhosjI+Gp+XQOLHdNH+O2kMr/qDs6P+JBaIYx5R4YsZxqLsRYs8LGxLtL11vkehWB
	xGL8wsN+OGgz0FW5fkDybnVkpw9QMjh9Ak6Ojf56wZ7xT54fh9Nixq0CM0Eucgf6yf2Gj9
	lks6OskjwniAi58atuBkPzrT/fDh5aPlve5e8I7wfdEt9uOtgcVnio+q+RzyCo3U/cT6Jb
	psfOmVfwpAXeloCjaJkbLAHXFzfPAolLiihUeDNRXFg/26lhjLNVVhPVG7+4SQ==
X-Authentication-Results: outgoing_mbo_mout;
	dkim=none;
	spf=pass (outgoing_mbo_mout: domain of antonio@mandelbit.com designates 2001:67c:2050:b231:465::1 as permitted sender) smtp.mailfrom=antonio@mandelbit.com
X-Cc: Antonio Quartulli <antonio@mandelbit.com>,
	Taehee Yoo <ap420073@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	michael.chan@broadcom.com,
	pavan.chebbi@broadcom.com,
	saeedm@nvidia.com,
	leon@kernel.org,
	tariqt@nvidia.com,
	mbloch@nvidia.com,
	brett.creeley@amd.com,
	sgoutham@marvell.com,
	anthony.l.nguyen@intel.com,
	przemyslaw.kitszel@intel.com,
	intel-wired-lan@lists.osuosl.org,
	Ido Schimmel <idosch@nvidia.com>,
	Satish Kharat <satishkh@cisco.com>,
	Andrew Lunn <andrew+netdev@lunn.ch>,
	Simon Horman <horms@kernel.org>,
	Shuah Khan <shuah@kernel.org>,
	Kees Cook <kees@kernel.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>,
	linux-kselftest@vger.kernel.org,
	linux-hardening@vger.kernel.org
X-Mailer: git-send-email 2.56.1
X-In-Reply-To: <20261107184437.2783174-5-omar@blockcast.net>
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
X-Rspamd-Queue-Id: 4jdhkC1LTKzSy