From: sashiko-bot@kernel.org
To: "Bobby Eshleman" <bobbyeshleman@gmail.com>
Cc: linux-rdma@vger.kernel.org, bpf@vger.kernel.org
Subject: Re: [PATCH net-next v3 8/8] selftests: drv-net: add netkit devmem tests
Date: Fri, 30 Oct 2026 04:53:58 +0000 [thread overview]
Message-ID: <sashiko-outbox-190388@kernel.org> (raw)
In-Reply-To: <20260507-tcp-dm-netkit-v3-8-52821445867c@meta.com>
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
- [High] If configure_nic(cfg) fails halfway, the script exits without executing cleanup_nic(cfg), permanently leaving the physical NIC in a disrupted state.
- [High] The script performs highly disruptive physical NIC configuration changes unconditionally, bypassing the framework's DISRUPTIVE=False skip mechanism.
--
commit 605c5904b1c331eeb3043ea246464b1479d4bb3f
Author: Bobby Eshleman <bobbyeshleman@meta.com>
selftests: drv-net: add netkit devmem tests
This commit adds nk_devmem.py with four tests for TCP devmem through a netkit
device. The script configures the NIC once before running the test cases and
cleans it up in a finally block to avoid toggling settings around every test.
> diff --git a/tools/testing/selftests/drivers/net/hw/nk_devmem.py b/tools/testing/selftests/drivers/net/hw/nk_devmem.py
> new file mode 100755
> index 0000000000000..0e36a0fa96888
> --- /dev/null
> +++ b/tools/testing/selftests/drivers/net/hw/nk_devmem.py
[ ... ]
> +def main() -> None:
> + """Configure the NIC once, then run the netkit devmem test cases."""
> + with NetDrvContEnv(__file__, rxqueues=2, primary_rx_redirect=True) as cfg:
> + setup_test(cfg,
> + os.path.join(os.path.dirname(os.path.abspath(__file__)),
> + "ncdevmem"))
> +
> + require_devmem(cfg)
> + configure_nic(cfg)
Because configure_nic(cfg) is called here in main() outside of ksft_run(),
does this bypass the DISRUPTIVE=False skip mechanism?
Since the test functions themselves are marked with @ksft_disruptive, running
with DISRUPTIVE=False will skip the tests, but it appears the disruptive NIC
configuration will still unconditionally execute.
> + try:
If configure_nic(cfg) fails halfway through, will this permanently leave the
physical NIC in a disrupted state?
If an exception is raised before the try block is entered (for example, if
the driver doesn't support queue leases during configuration),
cleanup_nic(cfg) would be entirely bypassed.
Could configure_nic() be moved inside the try block to ensure cleanup
always runs?
> + ksft_run([check_nk_rx, check_nk_tx, check_nk_tx_chunks,
> + check_nk_rx_hds], args=(cfg,))
> + finally:
> + cleanup_nic(cfg)
> +
> + ksft_exit()
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260507-tcp-dm-netkit-v3-0-52821445867c@meta.com?part=8
next prev parent reply other threads:[~2026-10-30 4:53 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-08 2:27 [PATCH net-next v3 0/8] net: devmem: support devmem with netkit devices Bobby Eshleman
2026-05-08 2:27 ` [PATCH net-next v3 1/8] net: convert netmem_tx flag to enum Bobby Eshleman
2026-05-08 14:56 ` Stanislav Fomichev
2026-05-08 16:11 ` Bobby Eshleman
2026-10-30 4:53 ` sashiko-bot
2026-05-08 2:27 ` [PATCH net-next v3 2/8] net: netkit: declare NETMEM_TX_NO_DMA mode Bobby Eshleman
2026-05-08 14:57 ` Stanislav Fomichev
2026-10-30 4:53 ` sashiko-bot
2026-05-08 2:27 ` [PATCH net-next v3 3/8] net: devmem: support TX over NETMEM_TX_NO_DMA devices Bobby Eshleman
2026-05-08 15:01 ` Stanislav Fomichev
2026-05-08 16:19 ` Bobby Eshleman
2026-05-08 20:44 ` Jakub Kicinski
2026-05-08 20:47 ` Jakub Kicinski
2026-05-08 21:28 ` Bobby Eshleman
2026-05-08 22:27 ` Jakub Kicinski
2026-05-08 23:03 ` Bobby Eshleman
2026-10-30 4:53 ` sashiko-bot
2026-05-08 2:27 ` [PATCH net-next v3 4/8] selftests: drv-net: ncdevmem: add -n flag to skip NIC configuration Bobby Eshleman
2026-05-08 15:01 ` Stanislav Fomichev
2026-10-30 4:53 ` sashiko-bot
2026-05-08 2:27 ` [PATCH net-next v3 5/8] selftests: drv-net: make attr _nk_guest_ifname public Bobby Eshleman
2026-05-08 15:01 ` Stanislav Fomichev
2026-10-30 4:53 ` sashiko-bot
2026-05-08 2:27 ` [PATCH net-next v3 6/8] selftests: drv-net: refactor devmem command builders into lib module Bobby Eshleman
2026-05-08 15:03 ` Stanislav Fomichev
2026-05-08 16:19 ` Bobby Eshleman
2026-05-08 2:27 ` [PATCH net-next v3 7/8] selftests: drv-net: add primary_rx_redirect support to NetDrvContEnv Bobby Eshleman
2026-05-08 15:03 ` Stanislav Fomichev
2026-10-30 4:53 ` sashiko-bot
2026-05-08 2:27 ` [PATCH net-next v3 8/8] selftests: drv-net: add netkit devmem tests Bobby Eshleman
2026-05-08 15:03 ` Stanislav Fomichev
2026-10-30 4:53 ` sashiko-bot [this message]
2026-05-10 20:33 ` [PATCH net-next v3 0/8] net: devmem: support devmem with netkit devices Zhu Yanjun
2026-05-11 17:01 ` Bobby Eshleman
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=sashiko-outbox-190388@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bobbyeshleman@gmail.com \
--cc=bpf@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=sashiko-reviews@lists.linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.