selftests: drv-net: tso: enable test cases based on hw_features
authorDaniel Zahka <daniel.zahka@gmail.com>
Wed, 23 Jul 2025 18:47:36 +0000 (11:47 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 25 Jul 2025 01:55:08 +0000 (18:55 -0700)
commit266b835e5e84a0f8fec7fd988ee81925890e8d89
treeed2571d91acf3e3b88750eb330e5239b9ddf7a8e
parent407c114c983f6eb87161853f0fdbe4a08e394b92
selftests: drv-net: tso: enable test cases based on hw_features

tso.py uses the active features at the time of test execution
as the set of available gso features to test. This means if a gso
feature is supported but toggled off at test start, the test will be
skipped with a "Device does not support {feature}" message.

Instead, we can enumerate the set of toggleable features by capturing
the driver's hw_features bitmap. To avoid configuration side-effects
from running the test, we also snapshot the wanted_features flag set
before making any feature changes, and then attempt to restore the
same set of wanted_features before test exit.

Fixes: 0d0f4174f6c8 ("selftests: drv-net: add a simple TSO test")
Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
Link: https://patch.msgid.link/20250723184740.4075410-2-daniel.zahka@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
tools/testing/selftests/drivers/net/hw/tso.py