summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/drivers/net/lib/py/env.py
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2025-02-26 19:51:43 -0800
committerJakub Kicinski <kuba@kernel.org>2025-02-26 19:51:43 -0800
commit0493f7a54e5bcf490f943f7b25ec6e1051832f98 (patch)
tree8891f6113e03f007c711cddc12fe5662c920c8fc /tools/testing/selftests/drivers/net/lib/py/env.py
parent28d68d396a1cd21591e8c6d74afbde33a7ea107e (diff)
parent185646a8a0a88c9016a782f9b98eea0eb6078512 (diff)
Merge branch 'net-napi-add-cpu-affinity-to-napi-config'
Ahmed Zaki says: ==================== net: napi: add CPU affinity to napi->config Drivers usually need to re-apply the user-set IRQ affinity to their IRQs after reset. However, since there can be only one IRQ affinity notifier for each IRQ, registering IRQ notifiers conflicts with the ARFS rmap management in the core (which also registers separate IRQ affinity notifiers). Move the IRQ affinity management to the napi struct. This way we can have a unified IRQ notifier to re-apply the user-set affinity and also manage the ARFS rmaps. The first patch moves the aRFS rmap management to core. It also adds the IRQ affinity mask to napi_config and re-applies the mask after reset. Patches 2, 4 and 5 use the new API for ena, ice and idpf drivers. ICE does not always delete the NAPIs before releasing the IRQs. The third patch makes sure the driver removes the IRQ number along with the queue when the NAPIs are disabled. Without this, the next patches in this series would free the IRQ before releasing the IRQ notifier (which generates warnings). Tested on ice and idpf. v8: https://lore.kernel.org/20250211210657.428439-1-ahmed.zaki@intel.com v7: https://lore.kernel.org/20250204220622.156061-1-ahmed.zaki@intel.com v6: https://lore.kernel.org/20250118003335.155379-1-ahmed.zaki@intel.com v5: https://lore.kernel.org/20250113171042.158123-1-ahmed.zaki@intel.com v4: https://lore.kernel.org/20250109233107.17519-1-ahmed.zaki@intel.com v3: https://lore.kernel.org/20250104004314.208259-1-ahmed.zaki@intel.com v2: https://lore.kernel.org/202412190454.nwvp3hU2-lkp@intel.com v1: https://lore.kernel.org/20241210002626.366878-1-ahmed.zaki@intel.com ==================== Link: https://patch.msgid.link/20250224232228.990783-1-ahmed.zaki@intel.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/testing/selftests/drivers/net/lib/py/env.py')
-rw-r--r--tools/testing/selftests/drivers/net/lib/py/env.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/testing/selftests/drivers/net/lib/py/env.py b/tools/testing/selftests/drivers/net/lib/py/env.py
index 96b33b5ef9dd4..fd4d674e6c72e 100644
--- a/tools/testing/selftests/drivers/net/lib/py/env.py
+++ b/tools/testing/selftests/drivers/net/lib/py/env.py
@@ -58,14 +58,20 @@ class NetDrvEnv(NetDrvEnvBase):
"""
Class for a single NIC / host env, with no remote end
"""
- def __init__(self, src_path, **kwargs):
+ def __init__(self, src_path, nsim_test=None, **kwargs):
super().__init__(src_path)
self._ns = None
if 'NETIF' in self.env:
+ if nsim_test is True:
+ raise KsftXfailEx("Test only works on netdevsim")
+
self.dev = ip("-d link show dev " + self.env['NETIF'], json=True)[0]
else:
+ if nsim_test is False:
+ raise KsftXfailEx("Test does not work on netdevsim")
+
self._ns = NetdevSimDev(**kwargs)
self.dev = self._ns.nsims[0].dev
self.ifname = self.dev['ifname']