RE: [PATCH net-next V3 14/15] selftests: net: gro: Add PSP encapsulation and encryption

From: Loktionov, Aleksandr

Date: Thu Sep 03 2026 - 06:34:40 EST




> -----Original Message-----
> From: Tariq Toukan <tariqt@xxxxxxxxxx>
> Sent: Thursday, September 3, 2026 10:52 AM
> To: Andrew Lunn <andrew+netdev@xxxxxxx>; David S. Miller
> <davem@xxxxxxxxxxxxx>; Eric Dumazet <edumazet@xxxxxxxxxx>; Jakub
> Kicinski <kuba@xxxxxxxxxx>; netdev@xxxxxxxxxxxxxxx; Paolo Abeni
> <pabeni@xxxxxxxxxx>; Sabrina Dubroca <sd@xxxxxxxxxxxxxxx>
> Cc: Loktionov, Aleksandr <aleksandr.loktionov@xxxxxxxxx>; Alexei Lazar
> <alazar@xxxxxxxxxx>; Alexei Starovoitov <ast@xxxxxxxxxx>; Allison
> Henderson <allison.henderson@xxxxxxxxxx>; Antonio Quartulli
> <antonio@xxxxxxxxxxx>; Anubhav Singh <anubhavsinggh@xxxxxxxxxx>; Bobby
> Eshleman <bobbyeshleman@xxxxxxxx>; Boris Pismenny <borisp@xxxxxxxxxx>;
> bpf@xxxxxxxxxxxxxxx; Carolina Jubran <cjubran@xxxxxxxxxx>; Chris Mi
> <cmi@xxxxxxxxxx>; Cosmin Ratiu <cratiu@xxxxxxxxxx>; Daniel Borkmann
> <daniel@xxxxxxxxxxxxx>; Daniel Zahka <daniel.zahka@xxxxxxxxx>; David
> Wei <dw@xxxxxxxxxxx>; Doruk Tan Ozturk <doruk@xxxxxxx>; Dragos Tatulea
> <dtatulea@xxxxxxxxxx>; Gal Pressman <gal@xxxxxxxxxx>; Keller, Jacob E
> <jacob.e.keller@xxxxxxxxx>; Jesper Dangaard Brouer <hawk@xxxxxxxxxx>;
> Jianbo Liu <jianbol@xxxxxxxxxx>; John Fastabend
> <john.fastabend@xxxxxxxxx>; Kees Cook <kees@xxxxxxxxxx>; Lama Kayal
> <lkayal@xxxxxxxxxx>; Leon Romanovsky <leon@xxxxxxxxxx>; open list
> <linux-kernel@xxxxxxxxxxxxxxx>; linux-kselftest@xxxxxxxxxxxxxxx;
> linux-rdma@xxxxxxxxxxxxxxx; Mark Bloch <mbloch@xxxxxxxxxx>; Matthieu
> Baerts (NGI0) <matttbe@xxxxxxxxxx>; Patrisious Haddad
> <phaddad@xxxxxxxxxx>; Petr Machata <petrm@xxxxxxxxxx>; Raed Salem
> <raeds@xxxxxxxxxx>; Rahul Rameshbabu <rrameshbabu@xxxxxxxxxx>; Richard
> Gobert <richardbgobert@xxxxxxxxx>; Saeed Mahameed <saeedm@xxxxxxxxxx>;
> Shuah Khan <shuah@xxxxxxxxxx>; Shuah Khan <skhan@xxxxxxxxxxxxxxxxxxx>;
> Simon Horman <horms@xxxxxxxxxx>; Stanislav Fomichev <sdf@xxxxxxxxxxx>;
> Stanislav Fomichev <sdf.kernel@xxxxxxxxx>; Tariq Toukan
> <tariqt@xxxxxxxxxx>; Willem de Bruijn <willemb@xxxxxxxxxx>; Willem de
> Bruijn <willemdebruijn.kernel@xxxxxxxxx>
> Subject: [PATCH net-next V3 14/15] selftests: net: gro: Add PSP
> encapsulation and encryption
>
> From: Cosmin Ratiu <cratiu@xxxxxxxxxx>
>
> Add a PSP mode which wraps every transmitted frame in PSP transport
> mode and encrypts them in SW with the help of OpenSSL.
> The receiving NIC decrypts and decapsulates, so the frame the receiver
> sees on its AF_PACKET socket is identical to the non-PSP one and every
> geometry assertion in this file applies unchanged.
>
> Sender packet construction is unchange, PSP uses a different buffer to
Probably 'is unchange,' -> 'is unchanged,' ?

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@xxxxxxxxx>

> avoid double encryption.
>
> A few PSP-only cases are added: psp_spi_diff, psp_ver_diff, psp_mixed,
> to cover coalescing scenarios which only exist for PSP.
>
> OpenSSL is optional and scoped to this binary: gro is deployed by
> several suites, so a missing libcrypto costs only the PSP mode.
>
> Signed-off-by: Cosmin Ratiu <cratiu@xxxxxxxxxx>
> Reviewed-by: Dragos Tatulea <dtatulea@xxxxxxxxxx>
> Signed-off-by: Tariq Toukan <tariqt@xxxxxxxxxx>
> ---
> tools/testing/selftests/net/lib/Makefile | 16 ++
> tools/testing/selftests/net/lib/gro.c | 337
> ++++++++++++++++++++++-
> 2 files changed, 351 insertions(+), 2 deletions(-)
>
> diff --git a/tools/testing/selftests/net/lib/Makefile
> b/tools/testing/selftests/net/lib/Makefile
> index ff83603397d0..ce67e8d3e4f6 100644
> --- a/tools/testing/selftests/net/lib/Makefile
> +++ b/tools/testing/selftests/net/lib/Makefile
> @@ -22,4 +22,20 @@ TEST_INCLUDES := $(wildcard py/*.py sh/*.sh)
>
> include ../../lib.mk
>

...

> read_MAC(src_mac, smac);
> read_MAC(dst_mac, dmac);
>
> --
> 2.44.0