Re: [PATCH net-next v3 02/12] psp: take the psp nexthdr from the packet on encap
From: Todd Bert Freed
Date: Thu Dec 03 2026 - 12:42:45 EST
> > + if ((skb_is_gso(skb) || skb->ip_summed == CHECKSUM_PARTIAL) &&
> > + mlx5e_psp_is_offload(skb, netdev)) {
> > + if (skb_is_gso(skb) &&
> > + !(skb_shinfo(skb)->gso_type &
> > + (SKB_GSO_TCPV4 | SKB_GSO_TCPV6)))
> > + features &= ~NETIF_F_GSO_MASK;
> > + if (skb->ip_summed == CHECKSUM_PARTIAL &&
> > + !mlx5e_psp_l4_csum_ok(skb))
> > + features &= ~NETIF_F_CSUM_MASK;
> > + }
>
> Hmm, that's a large check in the hotpath -- maybe it's cheap? So the
> cost for small UDP packets with Tx checksumming enabled and no PSP don't
> blow up.
It's cheap. For a packet without PSP, the block reads skb->ip_summed and
skb->decrypted without looking at the dst or the socket. Both are in
the same cacheline as skb->mac_header, and __dev_queue_xmit() calls
skb_reset_mac_header() at its start, which writes mac_header.
skb_is_gso() reads gso_size which was just used in
__netif_skb_features().
I measured this on CX7 with 64-byte UDP with Tx checksumming
(CHECKSUM_PARTIAL) and no PSP, with and without this series. No
measurable difference in PPS.
-Todd