Re: [PATCH net-next v3 04/12] psp: add support for socket-less psp associations

From: Todd Bert Freed

Date: Wed Dec 02 2026 - 14:16:36 EST


> 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?

We had some previous discussion on this topic in v1,

https://lore.kernel.org/netdev/CADh2yMx8MPjcH7Bpj72rNNd_tT=6uSC5Ow9JyGjTMjFgs499Pw@xxxxxxxxxxxxxx

Originally I had rx-spi-alloc allocate an rx assoc object, similar to
tx assoc. In that model, the rx assoc would contain psp spi, version,
device, and generation. A psp decap rule would make reference to
an rx assoc object, from which it would source those fields, instead
of flower matches. And that would allow the kernel to take action
on key rotation events and deactivate or delete rules which had
become stale.

I do think that's doable. Daniel suggested to keep that complexity
out of the kernel and make it the job of userspace to delete rules
before two rotations take place. That has some merit, too. At the
end of the day userspace is controlling the key rotation cadence.

Either approach is going to work for me.

-Todd