🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
2 messages
2 total messages Started by Björn Töpel Thu, 26 Nov 2026 15:07
Re: [PATCH net-next v3 04/12] psp: add support for socket-less psp associations
#23142
Author: Björn Töpel
Date: Thu, 26 Nov 2026 15:07
46 lines
11024 bytes
Todd Freed <toddfreed@meta.com> writes:

> Currently, a PSP association is bound to a TCP socket when it is
> created, and can hold both an Rx and a Tx key.
>
> Add Tx associations which are not bound to a socket, and are referenced
> by an ID, so that other parts of the stack can attach them to packets.
> See the subsequent patches, where the tc psp action does just this.
>
> Socket-less Rx does not need an association, and the kernel does not
> keep anything for this case. For Rx, userspace calls the rx-spi-alloc
> operation, and then uses tc filters that match the corresponding SPI,
> version, and PSP device. The flower matches for these fields are added
> in a subsequent patch.
>
> Add the following new netlink commands. They are admin-only, and
> restricted to the netns of the PSP device.
>
>   rx-spi-alloc  allocate an Rx SPI and derived key, without a socket.
>                 The key is delivered to the peer out of band. Also
>                 returns the number of key rotations of the PSP device
>                 so far (key-rotations)
>   assoc-add     create a Tx association and install the peer's key,
>                 returns its ID
>   assoc-del     delete a Tx association
>   assoc-get     get / dump Tx associations; only the SPI is reported
>
> Socket associations are not addressed by these commands, so for example
> assoc-get does not list them.
>
> 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?

Probably missing something, but seems like natural for the kernel to
ensure that stale rules wont match reused SPIs?


Björn
Re: [PATCH net-next v3 04/12] psp: add support for socket-less psp associations
#25433
Author: Björn Töpel
Date: Tue, 01 Dec 2026 19:10
36 lines
10738 bytes
Todd Bert Freed <toddfreed@meta.com> 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örn
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads