Article View: linux.kernel.netdev
Article #24866Re: [RFC PATCH net-next 1/9] amt: add the relay replication offload provider header
From: Antonio Quartulli
Date: Tue, 01 Dec 2026 00:34
Date: Tue, 01 Dec 2026 00:34
91 lines
13616 bytes
13616 bytes
On Sat, Nov 07, 2026 at 06:44:28PM +0000, Omar Ramadan wrote: > +/* > + * Reserved: (S,G)-keyed forwarding. v1 forwards per (family, group) exactly > + * as the software path does, so this bit has NO v1 semantics. A provider > + * must not set it; amt ignores it. > + */ > +#define AMT_OFFLOAD_F_SOURCE_FILTER BIT(0) Please drop everything amt never reads: this bit, caps.features, caps.max_endpoints, caps.max_groups and ops->stats. IMHO it's better to add each one with its first user. > + * @op_timeout_ms: longest a programming op may take before amt treats the > + * provider as wedged, resets it and replays from desired state. The ops are synchronous, so amt can only measure an op after it returns. That gets both cases wrong: - An op that hangs is never caught. It keeps amt's offload mutex, and teardown takes that mutex with RTNL held. - An op that succeeds a little late triggers a full flush and replay. Details are in 3/9. Please drop the field: a provider that can time out its command channel returns -ETIMEDOUT and should report through its own devlink health reporter. > + * @epoch: monotonic per relay device, bumped on every bind, reset and > + * teardown. A completion carrying an older epoch is stale and ignored. No op completes asynchronously and no op takes an epoch, so a provider has nothing to compare it against. I think we can actually get rid of this? > + * key returns the existing handle. 0 means accepted and durable, not yet > + * forwarding. Process context, never under amt's spinlocks. It seems the locking rule that matters is missing: the programming ops run with amt's offload mutex held and without RTNL, while teardown holds RTNL (and, for a netdevsim port, the devlink instance lock) and then takes that mutex. A driver whose command path takes RTNL or the devlink lock deadlocks. The header has to forbid that, or amt has to call the ops under RTNL. > + * the commit until the next one. Until amt publishes @gen, any @xmit for > + * @grp carries an earlier generation this provider committed, and a call > + * already in flight may carry any of those or @gen itself; the provider > + * serves such a generation or declines it. A provider must never emit This forces every provider to keep earlier committed member sets alive for packets in flight. Hardware replicates from its programmed state and has no notion of a per-packet generation. A potentially simpler rule: amt stops handing the group over and waits out in-flight xmit (synchronize_net) before group_commit, and resumes after it returns. The provider then holds one set, and a joining gateway is served by software while the group is reprogrammed instead of getting nothing (see 4/9). > + * @AMT_OFFLOAD_PATH_INGRESS: the provider replicates on ingress and the > + * host only sees punted packets. Semantics only until a real provider > + * exists; no simulated provider implements it. I think the ingress path can be dropped from this series, because nothing implements it? The punt rule added in 4/9 seems to be dropping legitimate traffic. > + * relay on @lower in software. Caller holds RTNL. A no-op if @lower has no > + * provider, which is the case after @lower itself was unregistered. A netns move of @lower also sends NETDEV_UNREGISTER, so amt silently forgets the provider. Every provider must then re-register on NETDEV_REGISTER (netdevsim does), and the contract doesn't say so. An ops pointer in net_device should avoid the problem entirely (see 0/9). Patch 3 rewrites this header (+66/-8) and patch 4 does it again (+35/-3). Please introduce it together with its first user. Regards, Antonio
Technical Details
Message-ID:
<20261201003458.3731956-2-antonio@mandelbit.com>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374557-linux-kernel-netdev=dewy.ruReferences:
<20261107184437.2783174-1-omar@blockcast.net> <20261107184437.2783174-2-omar@blockcast.net>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374557-linux-kernel-netdev=dewy.ru From: antonio@mandelbit.com (Antonio Quartulli) Newsgroups: linux.kernel.netdev Subject: Re: [RFC PATCH net-next 1/9] amt: add the relay replication offload provider header Date: Tue, 1 Dec 2026 01:34:48 +0100 Organization: Usenet Network Message-ID: <20261201003458.3731956-2-antonio@mandelbit.com> References: <20261107184437.2783174-1-omar@blockcast.net> <20261107184437.2783174-2-omar@blockcast.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Injection-Info: usenet.network; logging-data="1576071"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:xKYXs8JbAIS0dts6uwGP4jwvLLE= sha256:1HG9y5BBFRqqOPu6+bGPOrmAx+KuGhMHtHxyvVbJrgg= sha1:VOsdPFEZlwQbH6SQEp4ddn9fp4g= sha256:NoT1FvI/Q74Pr1npslsVknRfuFB+9ORHqNnAVW2letQ= 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 0A086126018; Tue, 1 Dec 2026 03:35:41 +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 IkpBARiGR5jB; Tue, 1 Dec 2026 03:35:38 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374557-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 01EC8126019; Tue, 1 Dec 2026 03:35:29 +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 CC2B72CAAB; Tue, 1 Dec 2026 00:35:19 +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=1796085318; b=Ptp1gdD7Aml/9kK0YqLkYZDH8by224VU+2qyED2o8ZJex8x/r8QwMWfU50xQqiVstTNU udFLOEJyg2wFO3NvGSBH69LtMMX/iUCFlmSURsGN6VX1SRNKS9r50zoopTP7v3PMgtNgx zp0O2TIHaanCo8PikENK8HG0/xLiz36toKHankSTAZxZ8pCxtSk3d3pSXmD35d6y/Ddsq uuYDAxBIc+ptaVEPi9S+S0uYBadCStj6FXfyM8Xn4b+7n9yIxzETCCj0ZNuDBqlXQpAh1 Qneysv/W8hIRHmfhA1wCVp9BrlOvAk/AG8L277R0RPOOIjSZQwzTLebBtvbUs7T0IHw== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796085318; 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=R9T1/dVs/UwxKMrxg24OYGyLCFJcm+BqdBD+fhcV/r4=; b=THAScZqRAAFJjJXqDwAADDrAXyISZnXTCYnK7ePZKMgioUH0NReZgizwxqfDlPZPkD2c 3aWNCiZuHq0CTJOOl1r1S27mcvTOKNMRtPxDp2KqMuYPw9przsPSYIAgNrN2AdnsPMcxo Zdt/ekRot4pbfAOL44rKo37MrLpNpogleChvWb5+ApzHQ5S+qPg7JkxsHdCDEnCKsmZFc zY3aj3PCfW+4yhX7O6NrrSlbe7dPWYOozw/fsPUIxi4tCDJ0Z4sifoPs3e21ePmouBpBD l/i2+ZKLHeHC1UIwCIPf5FhoL7cXocmynJKV3F6h9fRf+v+83dl5lxdjQXYYyLgjM3g== 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=inoBtzuG; 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 186AA606A697; Tue, 1 Dec 2026 00:35:18 +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=inoBtzuG X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=195.10.208.46 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796085317; b=E8H6dKB3Co4xplg+aRa5Ybzf1wLEoj59FPYv0929M600oNNWYuOmBdYjB785uWJCTkzZ DVFf7jtZ09mFQ+fpjGY0eSWx5uonUMMtG8juPqB7zGm+gn5Pigs12V0QXb5HaNRkJuO2/ 4wXzuu24Xi5iUcdgIFxhQcIJeDY+hsZcyhqwdY7QVvG6QsCd5y0gifCOEayNjoCl2kcG5 zhPCzEaiUEg1j8mW+uQNwT2oirJC6r09wawIv3OWDmIYIQ7ecvrWTCPwIyFxC7JOf3xfC aX+KD6ffJfpwsIBKKstCSz8tv+SqCUGA4yq3XA9K/gjlY8pRndovgQrHG4fDjYT3ugg== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796085317; 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=R9T1/dVs/UwxKMrxg24OYGyLCFJcm+BqdBD+fhcV/r4=; b=MDbdLa8oNLWImJm3+OAk3lk13ECvINKSmn1l1DB0N6gcU30+tjF/7mqVNjmOfn/48FZf iHAXdVZomz1n8pWK7KppYJrBQ8HICiNQLWG9AzSPt2sBdqoNgURvmeIpqlmbuMY+4QN1G M3mvWsfyL6C9nTbwoYRcrCkc96nioHLU+9I5lmk9goi9Ka3zGbKN4oWLBmI3DI4TuaiwS +FV291jaYgrUAYHl4p0dmPeac2NoZKhFKAeoZspmvJIs2KeH7vv82+xde6S+pwoAQ10NQ ljPsBZbd1QxXyPLvlZAFPbutpbFF/BAzli9rvYxKcxvZP2dOFCUpbJeBjYPBr8kORAg== 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=inoBtzuG; arc=none smtp.remote-ip=195.10.208.46 X-Received: from mout-b-106.mailbox.org (mout-b-106.mailbox.org [195.10.208.46]) (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 B588E606A33D; Tue, 1 Dec 2026 00:35:16 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B588E606A33D 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-106.mailbox.org (Postfix) with ESMTPS id 4jdhk40NKhzNlSV; Tue, 01 Dec 2026 01:35:08 +0100 (CET) X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mandelbit.com; s=MBO0001; t=1796085308; 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=R9T1/dVs/UwxKMrxg24OYGyLCFJcm+BqdBD+fhcV/r4=; b=inoBtzuGbRvFuAkQn/vuU+31r/jFOTGtHP/4TR/lDThWO1g8jfl+V2vfL1BJgPGfdZ9cTD gGNns333j44qDzaysM3Ad1MnvvgllYBDKZIu8okMLrjuGayWUo8rtMerQ6D4/Dtl/K+49/ 2f58y36SE+AQWy1pc92JqoNnezMrxyVIhLKqMBNCGRCNWYDdvrQhcwYSUdVx2K9ptC76KO rRue6UmFC4tB2YPpX8yrMlcmkDLBHZwrVxMj2T9Re/rCPHI4LW2TBayUcypVB0EG14oJYY 24NEat0bZD0zv4qhDQ6hBY43EvJoycNZnr8ALkuwFwRaGZ4wWL/KeQ/4pc3bww== 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-2-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: 4jdhk40NKhzNlSV