From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796152244; b=1s34HxQRNguQwzecvxvLr5dfpTWDuh0vlBjJE84/PakQb3sJSo6T7c5HuzwpIodeJ8eI 0Oc+PRF/BY8FslNxTUd49X2dU1OpNlZvNM4bY15hFbrqFJhFtdzscgUTj9AQkb8Oe2/ed gQs8uFWdQIv31B21R1rtayaycb+toaZ3CUY+JlagNyRgWpA+wafheMoDyuh+AgmjfULal 7WaZz/amd2SwWJybCXvGLtx9JyjzHEtkZAxytFJcJ8BDGKnJB7hsrORQ6MYZnFdH6v/52 gO7/uQUxDJWoclmQvqvrJ8g7JmqBb8HjSGowaFsupCG5HEPTBN2v2v56AJpO47me7iA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796152244; h=Received:DKIM-Signature:From:To:Cc:Subject:In-Reply-To:References: Date:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding; bh=C/i7i68MMCsNYsUfifHBGYOHF8vNdiMvjY2DXbIITfI=; b=owZ9g527561tl5adc7u0z2A5Kr6+DJJz4a8K+NopItO7zDF2fbMXS0yRrDbVSr+lUOPH HYvDSVOwjembz4vBDXhOi1dbeuy/puaP+PVBYMBknPoaDyZZP9X8s4ipy2ln2Icn6e39F iVs3gCM46W6fLCKdxOVJgqg2qTzgxasJ+cq3YJGde6swho1JIRrbqQJTuS97VA0vk0N5n CCUv40t796nsbRV/dEYpltMSWv3PL8hHoM7pbjVHf251V6is6qU53oOF710MDLMnFGdKb GzZLcuFJkduRguSWaZr/y/XV3TEyCxnmyq9g+9x0vsIW9umDb0iWsRqd54acJ0oxHRg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=MzC+J75E; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 31E25606A31A; Tue, 1 Dec 2026 19:10:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=MzC+J75E Received: by smtp.kernel.org (Postfix) with ESMTPSA id 52B121F000C1; Tue, 1 Dec 2026 19:10:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796152244; bh=C/i7i68MMCsNYsUfifHBGYOHF8vNdiMvjY2DXbIITfI=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=MzC+J75EtTQWvx+3CGBoQf56MAJ+sGbKmI5mZm3dDco0eFbaaGBT9z2c1HQOSEznG OoyEMF5q7RTIxe/XMqn1n/bRG0DeH6uxjlaAgJQcYr2V4oE8ogA36Nasj3vyK9HEpE zfbiLyg7yB6IoGiQCRR4Gc3/EKn8Lssr4jXadLfUdv6SIKwquhNk9IBSXL96LDOE2b J8ft403PLMNKsAn8iHEB+BYnCWcaF+bTcANm3B3ntFwFkgOwMMFC5/r3P/fG+Gkjfm 51heuH2XoGU2pBR5hdgnj22cNqGe/ONlcaBthwnrIbsVBobhC2fRlBsfvEr44n572O ufiBTMoMlcVeg== From: =?utf-8?B?QmrDtnJuIFTDtnBlbA==?= To: Todd Bert Freed Cc: netdev@vger.kernel.org, "David S. Miller" , Andrew Lunn , Boris Pismenny , Cosmin Ratiu , Daniel Zahka , Donald Hunter , Dragos Tatulea , Eric Dumazet , Jakub Kicinski , Jamal Hadi Salim , Jiri Pirko , Leon Romanovsky , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rdma@vger.kernel.org, Mark Bloch , Paolo Abeni , Pedro Tammela , Saeed Mahameed , Simon Horman , Tariq Toukan , Wei Wang , Willem de Bruijn , Kuniyuki Iwashima , bpf@vger.kernel.org, =?utf-8?Q?Asbj=C3=B8rn?= Sloth =?utf-8?Q?T=C3=B8nnes?= =?utf-8?Q?en?= , Qingfang Deng , Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgense?= =?utf-8?Q?n?= , Shuah Khan , Jonathan Corbet , Shuah Khan , Randy Dunlap , Matthieu Baerts , David Ahern , Jonas =?utf-8?Q?K=C3=B6ppeler?= , Hangbin Liu Subject: Re: [PATCH net-next v3 04/12] psp: add support for socket-less psp associations In-Reply-To: References: <20261124221758.3230929-1-toddfreed@meta.com> <20261124221758.3230929-5-toddfreed@meta.com> <87cxrriqcl.fsf@all.your.base.are.belong.to.us> Date: Tue, 01 Dec 2026 20:10:40 +0100 Message-ID: <87qzg0olzj.fsf@all.your.base.are.belong.to.us> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Todd Bert Freed writes: >> > The kernel doesn't enforce key rotation for socket-less Rx the way it >> > does for socket associations. A tc filter which matches a SPI of one >> > generation will also match that SPI if subsequently re-used in another >> > generation. It is up to userspace to deal with this eventuality by >> > removing such rules in time. Userspace may subscribe to rotation >> > notifications for this purpose. >> >> Could you talk about the rationale here? rx-spi-alloc returns the key >> rotations, why not make the generation part of the flower match? > > Thanks for taking a look. The reason for doing it this way, is to enable > hardware offload. The device can check the psp spi, psp version > (packet fields), and psp device (it won't be seeing the packet otherwise). > > The rotations counter is stored on the psp device object (psd->stats). > The device would not be able to perform a check against that. Thanks, that makes sense... I was thinking of the generation as part of the rule's lifetime. Could flower remember the generation returned by rx-spi-alloc and still program just the SPI match on the PSP device? The rule would stay valid through the first rotation. On the second rotation, could the PSP core and the driver make sure the old rule is inactive in hardware before the device can hand out that SPI again? That would keep the generation check out of the packet path and avoid the window where userspace is reacting to a rotation but the stale rule can already match a new owner's packets. Is there a hardware or ordering constraint that makes that difficult? Bj=C3=B6rn