]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
selftests: drv-net: ncdevmem: make configure_channels() support combined channels
authorJakub Kicinski <kuba@kernel.org>
Fri, 15 Aug 2025 23:15:13 +0000 (16:15 -0700)
committerJakub Kicinski <kuba@kernel.org>
Wed, 20 Aug 2025 00:49:35 +0000 (17:49 -0700)
commit51992f99f068fba966a680a9ac118b815f2fe08e
treeeb5d65582cd1d3ceaf89d840915a6cc40469f698
parenteddc821f98afaa13ecd09b02b73ac5946387ffcc
selftests: drv-net: ncdevmem: make configure_channels() support combined channels

ncdevmem tests that the kernel correctly rejects attempts
to deactivate queues with MPs bound.

Make the configure_channels() test support combined channels.
Currently it tries to set the queue counts to rx N tx N-1,
which only makes sense for devices which have IRQs per ring
type. Most modern devices used combined IRQs/channels with
both Rx and Tx queues. Since the math is total Rx == combined+Rx
setting Rx when combined is non-zero will be increasing the total
queue count, not decreasing as the test intends.

Note that the test would previously also try to set the Tx
ring count to Rx - 1, for some reason. Which would be 0
if the device has only 2 queues configured.

With this change (device with 2 queues):
  setting channel count rx:1 tx:1
  YNL set channels: Kernel error: 'requested channel counts are too low for existing memory provider setting (2)'

Reviewed-by: Mina Almasry <almasrymina@google.com>
Link: https://patch.msgid.link/20250815231513.381652-1-kuba@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/hw/ncdevmem.c