๐Ÿš€ go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by netdev-bot+sashiko Sat, 28 Nov 2026 23:57
Re: [PATCH net-next v3 08/12] selftests: drv-net: psp: test socket-less associations and the tc psp action
#24000
Author: netdev-bot+sashiko
Date: Sat, 28 Nov 2026 23:57
80 lines
11581 bytes
Thank you for your contribution! Sashiko AI review found more severe
issue(s) in other patches of this series. This mail is only an FYI, in case
you want to address the nit picks below when you respin.

Low priority / nit picks for your consideration:

- [Low] In tools/testing/selftests/drivers/net/psp.py, the docstring of
  assoc_sockless_rotations() says it checks that socket-less Txโ€ฆ

--

selftests: drv-net: psp: test socket-less associations and the tc psp action

This adds selftests for the socket-less PSP netlink commands
(rx-spi-alloc, assoc-add/get/dump/del) and for the tc psp action and the
flower psp matches. The data path tests connect a plain TCP socket to a
PSP socket of the responder and use tc for encap and decap. The config
also gains DUMMY, NET_ACT_MIRRED and NET_ACT_PSP.

> diff --git a/tools/testing/selftests/drivers/net/psp.py b/tools/testing/selftests/drivers/net/psp.py
> index 67577f722b3b8..936ac37dd9133 100755
> --- a/tools/testing/selftests/drivers/net/psp.py
> +++ b/tools/testing/selftests/drivers/net/psp.py

[ ... ]

> @@ -938,6 +940,504 @@ def data_mss_adjust(cfg, ipver):

[ ... ]

> +def assoc_sockless_rotations(cfg):
> +    """ Test rx-spi-alloc reports the key rotations, Tx assocs survive them """
> +    _init_psp_dev(cfg)
> +
> +    rx, tx = _sockless_assocs(cfg)
> +    rotations = _get_stat(cfg, 'key-rotations')
> +    ksft_eq(rx['key-rotations'], rotations)
> +    for i in range(2):
> +        cfg.pspnl.key_rotate({"id": cfg.psp_dev_id})
> +        new = cfg.pspnl.rx_spi_alloc({"dev-id": cfg.psp_dev_id,
> +                                      "version": 0})
> +        ksft_eq(new['key-rotations'], rotations + i + 1)
> +    # A Tx assoc holds the peer's key, which the device key rotation
> +    # doesn't affect
> +    assoc = cfg.pspnl.assoc_get({"id": tx['id']})
> +    ksft_eq(assoc['tx-key'], {'spi': rx['rx-key']['spi']})

[Severity: Low]
The docstring says the test checks that Tx assocs survive the rotations.
Is this final check strong enough to catch a regression there?

assoc_get() finds the association by id in the psp_assocs xarray and
reports pas->tx.spi. psp_assocs_key_rotated() changes neither of these.

Suppose psp_nl_assoc_add_doit() stopped doing this:

	list_move_tail(&pas->assocs_list, &psd->sockless_assocs);

Then the socket-less association would stay on psd->active_assocs. The
first rotation would splice it to prev_assocs, and the second would run
this in psp_assocs_key_rotated():

	list_for_each_entry_safe(pas, next, &psd->prev_assocs, assocs_list) {
		pas->generation |= ~PSP_GEN_VALID_MASK;
		pas->prev_generation |= ~PSP_GEN_VALID_MASK;
		psd->stats.stales++;
	}

That would move the association to stale_assocs. stale-events would then
count the socket-less Tx association, but this test would still pass.

Could the test also compare stale-events before and after the rotations?
Another option is to send data through a tc encap rule that uses the Tx
association after the rotations.

[ ... ]

-- 
Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261124221758.3230929-1-toddfreed%40meta.com
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads