From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Akhilesh Samineni <akhilesh.samineni@broadcom.com>,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org,
willemb@google.com, daniel.zahka@gmail.com
Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
jayakrishnan.udayavarma@broadcom.com,
ajit.khaparde@broadcom.com, kiran.kella@broadcom.com,
akhilesh.samineni@broadcom.com, sachin.suman@broadcom.com
Subject: Re: [PATCH net-next 3/3] selftests: net: psp: add crypt-offset and spi-threshold test cases
Date: Tue, 07 Apr 2026 17:52:36 -0400 [thread overview]
Message-ID: <willemdebruijn.kernel.9cf8a81ff43@gmail.com> (raw)
In-Reply-To: <20260406222305.4111170-4-akhilesh.samineni@broadcom.com>
Akhilesh Samineni wrote:
> Add test cases to set and get crypt-offset and spi-threshold attributes,
> verifying both the applied value and the restored prior value.
>
> Signed-off-by: Akhilesh Samineni <akhilesh.samineni@broadcom.com>
> Reviewed-by: Kiran Kella <kiran.kella@broadcom.com>
> Reviewed-by: Ajit Kumar Khaparde <ajit.khaparde@broadcom.com>
> ---
> tools/testing/selftests/drivers/net/psp.py | 32 ++++++++++++++++++++++
> 1 file changed, 32 insertions(+)
>
> diff --git a/tools/testing/selftests/drivers/net/psp.py b/tools/testing/selftests/drivers/net/psp.py
> index 864d9fce1094..9253aab29ded 100755
> --- a/tools/testing/selftests/drivers/net/psp.py
> +++ b/tools/testing/selftests/drivers/net/psp.py
> @@ -171,6 +171,38 @@ def dev_get_device_bad(cfg):
> ksft_true(raised)
>
>
> +def dev_set_crypt_offset(cfg):
> + """ Set and get the crypt-offset """
> + _init_psp_dev(cfg)
> +
> + dev = cfg.pspnl.dev_get({'id': cfg.psp_dev_id})
> + orig = dev['crypt-offset']
> + cfg.pspnl.dev_set({"id": cfg.psp_dev_id,
> + "crypt-offset": 5})
> + dev = cfg.pspnl.dev_get({'id': cfg.psp_dev_id})
> + ksft_eq(dev['crypt-offset'], 5)
> + cfg.pspnl.dev_set({"id": cfg.psp_dev_id,
> + "crypt-offset": orig})
> + dev = cfg.pspnl.dev_get({'id': cfg.psp_dev_id})
> + ksft_eq(dev['crypt-offset'], orig)
> +
> +
> +def dev_set_spi_threshold(cfg):
> + """ Set and get the spi-threshold """
> + _init_psp_dev(cfg)
> +
> + dev = cfg.pspnl.dev_get({'id': cfg.psp_dev_id})
> + orig = dev['spi-threshold']
> + cfg.pspnl.dev_set({"id": cfg.psp_dev_id,
> + "spi-threshold": 10})
> + dev = cfg.pspnl.dev_get({'id': cfg.psp_dev_id})
> + ksft_eq(dev['spi-threshold'], 10)
> + cfg.pspnl.dev_set({"id": cfg.psp_dev_id,
> + "spi-threshold": orig})
> + dev = cfg.pspnl.dev_get({'id': cfg.psp_dev_id})
> + ksft_eq(dev['spi-threshold'], orig)
These tests mainly verify that netlink works as intended. Not sure how
much value that brings.
Once crypt-offset requires bounds checking (say), such control ops
functional tests may become more valuable.
More interesting would be to see the effect on the datapath. E.g.,
a crypt-offset that actually leaves plaintext. Not sure how easy or
hard this is, so don't take this as a requirement. But maybe something
that achievable with PSP packetdrill (eventually)?
next prev parent reply other threads:[~2026-04-07 21:52 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-06 22:23 [PATCH net-next 0/3] psp: add crypt-offset and spi-threshold attributes Akhilesh Samineni
2026-04-06 22:23 ` [PATCH net-next 1/3] psp: add crypt-offset and spi-threshold get/set attributes Akhilesh Samineni
2026-04-07 21:37 ` Willem de Bruijn
2026-04-06 22:23 ` [PATCH net-next 2/3] netdevsim: psp: handle the new crypt-offset and spi-threshold get/set operations Akhilesh Samineni
2026-04-07 21:43 ` Willem de Bruijn
2026-04-07 21:49 ` Willem de Bruijn
2026-04-06 22:23 ` [PATCH net-next 3/3] selftests: net: psp: add crypt-offset and spi-threshold test cases Akhilesh Samineni
2026-04-07 21:52 ` Willem de Bruijn [this message]
2026-04-07 1:14 ` [PATCH net-next 0/3] psp: add crypt-offset and spi-threshold attributes Jakub Kicinski
2026-04-07 15:39 ` Akhilesh Samineni
2026-04-07 18:07 ` Daniel Zahka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=willemdebruijn.kernel.9cf8a81ff43@gmail.com \
--to=willemdebruijn.kernel@gmail.com \
--cc=ajit.khaparde@broadcom.com \
--cc=akhilesh.samineni@broadcom.com \
--cc=andrew+netdev@lunn.ch \
--cc=daniel.zahka@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=jayakrishnan.udayavarma@broadcom.com \
--cc=kiran.kella@broadcom.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sachin.suman@broadcom.com \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox