Skip to content

psp: add a kselftest suite and netdevsim implementation

Jakub Kicinski linux-kselftest netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v3 Latest8 patches 7 repliesIn review 7 of 8 applied

Changes in v3 from the cover letter

- fix netdevsim bugs
- rework the skipping
- use errno
- remove duplicated condition
v2: https://lore.kernel.org/[email protected]
- fix pylint warnings
- insert CONFIG_INET_PSP in alphebetical order
- use branch to skip all tests
- fix compilation error when CONFIG_INET_PSP is not set
v1: https://lore.kernel.org/[email protected]

Patches in v3 7 of 8 applied

#Subject and filesSizeRepliesApplied
1/8netdevsim: a basic test PSP implementationdrivers/net/netdevsim/Makefile drivers/net/netdevsim/netdev.c drivers/net/netdevsim/netdevsim.h +2 more+294 -61 replyApplied
2/8selftests: drv-net: base device access API testtools/testing/selftests/drivers/net/Makefile tools/testing/selftests/drivers/net/config tools/testing/selftests/drivers/net/hw/lib/py/__init__.py +4 more+93 -32 repliesApplied
3/8selftests: drv-net: add PSP respondertools/testing/selftests/drivers/net/.gitignore tools/testing/selftests/drivers/net/Makefile tools/testing/selftests/drivers/net/psp_responder.c+493 -01 reply
4/8selftests: drv-net: psp: add basic data transfer and key rotation teststools/testing/selftests/drivers/net/psp.py+191 -30 repliesApplied
5/8selftests: drv-net: psp: add association teststools/testing/selftests/drivers/net/hw/lib/py/__init__.py tools/testing/selftests/drivers/net/lib/py/__init__.py tools/testing/selftests/drivers/net/psp.py +1 more+167 -40 repliesApplied
6/8selftests: drv-net: psp: add connection breaking teststools/testing/selftests/drivers/net/psp.py+91 -10 repliesApplied
7/8selftests: drv-net: psp: add test for auto-adjusting TCP MSStools/testing/selftests/drivers/net/psp.py+52 -00 repliesApplied
8/8selftests: drv-net: psp: add tests for destroying devicestools/testing/selftests/drivers/net/hw/lib/py/__init__.py tools/testing/selftests/drivers/net/lib/py/__init__.py tools/testing/selftests/drivers/net/lib/py/env.py +2 more+68 -30 repliesApplied

Reviews trailers per patch

None of the 8 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchWillem de Bruijn
SeriesR-b
1/8
2/8
3/8
4/8
5/8
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [PATCH net-next v3 0/8] psp: add a kselftest suite and netdevsim implementation

Add a basic test suite for drivers that support PSP. Also, add a PSP implementation in the netdevsim driver.

The netdevsim implementation does encapsulation and decapsulation of PSP packets, but no crypto.

The tests cover the basic usage of the uapi, and demonstrate key exchange and connection setup. The tests and netdevsim support IPv4 and IPv6. Here is an example run on a system with a CX7 NIC.

TAP version 13
1..28
ok 1 psp.data_basic_send_v0_ip4
ok 2 psp.data_basic_send_v0_ip6
ok 3 psp.data_basic_send_v1_ip4
ok 4 psp.data_basic_send_v1_ip6
ok 5 psp.data_basic_send_v2_ip4 # SKIP ('PSP version not supported', 'hdr0-aes-gmac-128') ok 6 psp.data_basic_send_v2_ip6 # SKIP ('PSP version not supported', 'hdr0-aes-gmac-128') ok 7 psp.data_basic_send_v3_ip4 # SKIP ('PSP version not supported', 'hdr0-aes-gmac-256') ok 8 psp.data_basic_send_v3_ip6 # SKIP ('PSP version not supported', 'hdr0-aes-gmac-256') ok 9 psp.data_mss_adjust_ip4
ok 10 psp.data_mss_adjust_ip6
ok 11 psp.dev_list_devices
ok 12 psp.dev_get_device
ok 13 psp.dev_get_device_bad
ok 14 psp.dev_rotate
ok 15 psp.dev_rotate_spi
ok 16 psp.assoc_basic
ok 17 psp.assoc_bad_dev
ok 18 psp.assoc_sk_only_conn
ok 19 psp.assoc_sk_only_mismatch
ok 20 psp.assoc_sk_only_mismatch_tx
ok 21 psp.assoc_sk_only_unconn
ok 22 psp.assoc_version_mismatch
ok 23 psp.assoc_twice
ok 24 psp.data_send_bad_key
ok 25 psp.data_send_disconnect
ok 26 psp.data_stale_key
ok 27 psp.removal_device_rx # XFAIL Test only works on netdevsim
ok 28 psp.removal_device_bi # XFAIL Test only works on netdevsim
# Totals: pass:22 fail:0 xfail:2 xpass:0 skip:4 error:0
#
# Responder logs (0):
# STDERR:
# Set PSP enable on device 1 to 0x3
# Set PSP enable on device 1 to 0x0

v3:
- fix netdevsim bugs
- rework the skipping
- use errno
- remove duplicated condition
v2: https://lore.kernel.org/[email protected]
- fix pylint warnings
- insert CONFIG_INET_PSP in alphebetical order
- use branch to skip all tests
- fix compilation error when CONFIG_INET_PSP is not set
v1: https://lore.kernel.org/[email protected]

Jakub Kicinski (8):
netdevsim: a basic test PSP implementation
selftests: drv-net: base device access API test
selftests: drv-net: add PSP responder
selftests: drv-net: psp: add basic data transfer and key rotation
tests
selftests: drv-net: psp: add association tests
selftests: drv-net: psp: add connection breaking tests
selftests: drv-net: psp: add test for auto-adjusting TCP MSS
selftests: drv-net: psp: add tests for destroying devices

 drivers/net/netdevsim/Makefile                |   4 +
 tools/testing/selftests/drivers/net/Makefile  |  10 +
 drivers/net/netdevsim/netdevsim.h             |  27 +
 drivers/net/netdevsim/netdev.c                |  43 +-
 drivers/net/netdevsim/psp.c                   | 225 +++++++
 net/core/skbuff.c                             |   1 +
 .../selftests/drivers/net/psp_responder.c     | 483 ++++++++++++++
 .../testing/selftests/drivers/net/.gitignore  |   1 +
 tools/testing/selftests/drivers/net/config    |   1 +
 .../drivers/net/hw/lib/py/__init__.py         |   4 +-
 .../selftests/drivers/net/lib/py/__init__.py  |   4 +-
 .../selftests/drivers/net/lib/py/env.py       |   4 +
 tools/testing/selftests/drivers/net/psp.py    | 627 ++++++++++++++++++
 .../testing/selftests/net/lib/py/__init__.py  |   2 +-
 tools/testing/selftests/net/lib/py/ksft.py    |  10 +
 tools/testing/selftests/net/lib/py/ynl.py     |   5 +
 16 files changed, 1440 insertions(+), 11 deletions(-)
 create mode 100644 drivers/net/netdevsim/psp.c
 create mode 100644 tools/testing/selftests/drivers/net/psp_responder.c
 create mode 100755 tools/testing/selftests/drivers/net/psp.py
Signature · 1 line
2.51.0