From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.10.208.51 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== 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== 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 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) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 887C2606A69F Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=mandelbit.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mandelbit.com 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 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) 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== 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 From: Antonio Quartulli To: Omar Ramadan Cc: Antonio Quartulli , Taehee Yoo , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , 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 , Satish Kharat , Andrew Lunn , Simon Horman , Shuah Khan , Kees Cook , "Gustavo A. R. Silva" , linux-kselftest@vger.kernel.org, linux-hardening@vger.kernel.org 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 Message-ID: <20261201003458.3731956-5-antonio@mandelbit.com> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261107184437.2783174-5-omar@blockcast.net> References: <20261107184437.2783174-1-omar@blockcast.net> <20261107184437.2783174-5-omar@blockcast.net> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4jdhkC1LTKzSy On Sat, Nov 07, 2026 at 06:44:28PM +0000, Omar Ramadan wrote:=0D > + if (b->path =3D=3D AMT_OFFLOAD_PATH_INGRESS) {=0D > + amt_offload_count(amt, AMT_OFFLOAD_CNT_PUNT_DROPPED);=0D > + consume_skb(skb);=0D > + gone =3D true;=0D > + goto out;=0D > + }=0D =0D amt can't tell a punted copy from a packet legitimately routed to the=0D relay. Traffic for the group that never crossed the hardware, from=0D another NIC or a local sender, is dropped here and the only trace is=0D punt_dropped. In addition, on ingress a leave doesn't clear hw_active,=0D so a departed gateway keeps receiving until the recommit.=0D No provider implements this path; so I presume it can be dropped from=0D this series.=0D =0D > + res =3D b->ops->xmit(&b->pub, g->hw, skb, READ_ONCE(g->hw_gen));=0D > + switch (res) {=0D > + case AMT_OFFLOAD_CONSUMED:=0D > + gone =3D true;=0D > + break;=0D =0D With a hardware provider, consumed traffic never shows up in the=0D relay's counters: ip -s link stays flat, and ops->stats is never called.=0D netdevsim hides this because its copies go back through amt_udp_xmit().=0D IFLA_STATS_LINK_OFFLOAD_XSTATS is probably the place for these counters.=0D =0D A leave withdraws the group to software at once, but a join keeps=0D serving the old committed set until the reconciler recommits. A new=0D gateway therefore gets nothing for as long as the reconciler is behind,=0D which is unbounded under a backlog or a reset loop. Software would have=0D served it from the next packet. Withdrawing around every commit (see=0D 1/9) fixes this.=0D =0D > +EXPORT_SYMBOL_GPL(amt_offload_encap_xmit);=0D =0D This is exported only so that netdevsim can reuse amt's own encap. The=0D reference provider therefore runs amt's code, and the "byte-identical to=0D software" check is circular.=0D =0D > + default:=0D > + WARN_ONCE(1, "amt: offload xmit returned %d\n", res);=0D > + break;=0D =0D After an unknown return value the skb's ownership is unknown, yet the=0D code falls back to software and uses it. Treat it as consumed, or make=0D the contract leave no third option. What do you think?=0D =0D Regards,=0D Antonio=0D