Re: [PATCH net-next v3 06/12] net/sched: add act_psp for psp transport mode

From: Todd Bert Freed

Date: Fri Dec 04 2026 - 18:46:05 EST


> > + if (unlikely(skb_is_decrypted(skb) || tcf_psp_sk_offload(skb)))
> > + return tcf_psp_drop(p, skb, SKB_DROP_REASON_PSP_OUTPUT);
> > + if (unlikely(!tcf_psp_set_transport_header(skb)))
> > + return tcf_psp_drop(p, skb, SKB_DROP_REASON_PSP_OUTPUT);
> > + skb_dst_drop(skb);
> > + skb_dst_set(skb, dst_clone(&params->md->dst));
>
> I'll continue my perf questions! dst_clone() -- potential contention
> point/cacheline ping-pong for multiple cores sharing the assoc?

Yeah, definitely.

I implemented a percpu METADATA_PSP dst, and it shows a substantial perf boost.
Measured this on x86_64 with CX7, with 32 threads sending 64 byte UDP, each
thread matched by its own flower filter:

v3 (shared dst) percpu dst
all filters use one encap action 10.6 Mpps 14.0 Mpps
each filter has its own encap action 14.0 Mpps

perf shows the time in the dst refcount: dst_release() at Tx completion,
and around the action call in tcf_classify().

In v4 I'll have the action keep one METADATA_PSP dst per possible CPU.

Each dst is 256 bytes, and with a lot of cores and a lot of rules, that
can eat up quite a bit of memory.

I'll note that, as is noted in the docs, PSP is primarily intended for
use with hardware offload. With hardware offload (coming in the next
series), and skip_sw, these dsts won't be allocated at all.

But for the sw use case the percpu dst's are the right trade-off.

-Todd