| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/13 15:06 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The patch exclusively modifies user-space test scripts and configuration files under tools/testing/selftests/drivers/net/, which does not affect the compiled kernel image or kernel modules.",
"WorthFuzzing": false
} |
| 1/1 | 2026/09/13 15:06 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit dda4c542c33b82bafef3ad7cec842d8feff50b25\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Sun Sep 13 15:06:06 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/tools/testing/selftests/drivers/net/gro_lib.py b/tools/testing/selftests/drivers/net/gro_lib.py\nindex b7ac0660adc01..e9d373cf3483c 100644\n--- a/tools/testing/selftests/drivers/net/gro_lib.py\n+++ b/tools/testing/selftests/drivers/net/gro_lib.py\n@@ -48,7 +48,7 @@ import re\n from lib.py import ksft_run, ksft_exit, ksft_pr\n from lib.py import NetDrvEpEnv, KsftFailEx, KsftXfailEx\n from lib.py import NetdevFamily, EthtoolFamily\n-from lib.py import bkg, cmd, ctl_file_write, defer, ethtool, ip\n+from lib.py import bkg, cmd, ctl_file_write, defer, ethtool, ip, set_ethtool_feat\n from lib.py import ksft_variants, KsftNamedVariant\n \n \n@@ -91,31 +91,6 @@ def _set_mtu_restore(dev, mtu, host):\n defer(ip, f\"link set dev {dev['ifname']} mtu {dev['mtu']}\", host=host)\n \n \n-def _set_ethtool_feat(dev, current, feats, host=None):\n- s2n = {True: \"on\", False: \"off\"}\n-\n- new = [\"-K\", dev]\n- old = [\"-K\", dev]\n- no_change = True\n- for name, state in feats.items():\n- new += [name, s2n[state]]\n- old += [name, s2n[current[name][\"active\"]]]\n-\n- if current[name][\"active\"] != state:\n- no_change = False\n- if current[name][\"fixed\"]:\n- raise KsftXfailEx(f\"Device does not support {name}\")\n- if no_change:\n- return\n-\n- eth_cmd = ethtool(\" \".join(new), host=host)\n- defer(ethtool, \" \".join(old), host=host)\n-\n- # If ethtool printed something kernel must have modified some features\n- if eth_cmd.stdout:\n- ksft_pr(eth_cmd)\n-\n-\n def _get_queue_stats(cfg, queue_id):\n \"\"\"Get stats for a specific Rx queue.\"\"\"\n cfg.wait_hw_stats_settle()\n@@ -242,15 +217,15 @@ def _setup(cfg, mode, test_name):\n ctl_file_write(flush_path, \"200000\")\n ctl_file_write(irq_path, \"10\")\n \n- _set_ethtool_feat(cfg.ifname, cfg.feat,\n- {\"generic-receive-offload\": True,\n- \"rx-gro-hw\": False,\n- \"large-receive-offload\": False})\n+ set_ethtool_feat(cfg.ifname, cfg.feat,\n+ {\"generic-receive-offload\": True,\n+ \"rx-gro-hw\": False,\n+ \"large-receive-offload\": False})\n elif mode == \"hw\":\n- _set_ethtool_feat(cfg.ifname, cfg.feat,\n- {\"generic-receive-offload\": False,\n- \"rx-gro-hw\": True,\n- \"large-receive-offload\": False})\n+ set_ethtool_feat(cfg.ifname, cfg.feat,\n+ {\"generic-receive-offload\": False,\n+ \"rx-gro-hw\": True,\n+ \"large-receive-offload\": False})\n \n # Some NICs treat HW GRO as a GRO sub-feature so disabling GRO\n # will also clear HW GRO. Use a hack of installing XDP generic\n@@ -265,27 +240,27 @@ def _setup(cfg, mode, test_name):\n # Attaching XDP may change features, fetch the latest state\n feat = ethtool(f\"-k {cfg.ifname}\", json=True)[0]\n \n- _set_ethtool_feat(cfg.ifname, feat,\n- {\"generic-receive-offload\": True,\n- \"rx-gro-hw\": True,\n- \"large-receive-offload\": False})\n+ set_ethtool_feat(cfg.ifname, feat,\n+ {\"generic-receive-offload\": True,\n+ \"rx-gro-hw\": True,\n+ \"large-receive-offload\": False})\n elif mode == \"lro\":\n # netdevsim advertises LRO for feature inheritance testing with\n # bonding/team tests but it doesn't actually perform the offload\n cfg.require_nsim(nsim_test=False)\n \n- _set_ethtool_feat(cfg.ifname, cfg.feat,\n- {\"generic-receive-offload\": False,\n- \"rx-gro-hw\": False,\n- \"large-receive-offload\": True})\n+ set_ethtool_feat(cfg.ifname, cfg.feat,\n+ {\"generic-receive-offload\": False,\n+ \"rx-gro-hw\": False,\n+ \"large-receive-offload\": True})\n \n try:\n # Disable TSO for local tests\n cfg.require_nsim() # will raise KsftXfailEx if not running on nsim\n \n- _set_ethtool_feat(cfg.remote_ifname, cfg.remote_feat,\n- {\"tcp-segmentation-offload\": False},\n- host=cfg.remote)\n+ set_ethtool_feat(cfg.remote_ifname, cfg.remote_feat,\n+ {\"tcp-segmentation-offload\": False},\n+ host=cfg.remote)\n except KsftXfailEx:\n pass\n \ndiff --git a/tools/testing/selftests/drivers/net/hw/Makefile b/tools/testing/selftests/drivers/net/hw/Makefile\nindex bd3b8d2fa47e0..5582b644078ed 100644\n--- a/tools/testing/selftests/drivers/net/hw/Makefile\n+++ b/tools/testing/selftests/drivers/net/hw/Makefile\n@@ -54,6 +54,7 @@ TEST_PROGS = \\\n \ttso.py \\\n \tuserns_devmem.py \\\n \tuso.py \\\n+\tvlan.py \\\n \txdp_metadata.py \\\n \txsk_reconfig.py \\\n \t#\ndiff --git a/tools/testing/selftests/drivers/net/hw/config b/tools/testing/selftests/drivers/net/hw/config\nindex d89a9ba176558..c6c2b64bb7124 100644\n--- a/tools/testing/selftests/drivers/net/hw/config\n+++ b/tools/testing/selftests/drivers/net/hw/config\n@@ -24,5 +24,6 @@ CONFIG_NET_SCH_INGRESS=y\n CONFIG_SYNC_FILE=y\n CONFIG_UDMABUF=y\n CONFIG_USER_NS=y\n+CONFIG_VLAN_8021Q=m\n CONFIG_VXLAN=y\n CONFIG_XFRM_USER=y\ndiff --git a/tools/testing/selftests/drivers/net/hw/lib/py/__init__.py b/tools/testing/selftests/drivers/net/hw/lib/py/__init__.py\nindex 81e1d1865cd50..4077f5f1a1be3 100644\n--- a/tools/testing/selftests/drivers/net/hw/lib/py/__init__.py\n+++ b/tools/testing/selftests/drivers/net/hw/lib/py/__init__.py\n@@ -31,6 +31,7 @@ try:\n ksft_setup, ksft_variants, KsftNamedVariant\n from net.lib.py import ksft_eq, ksft_ge, ksft_in, ksft_is, ksft_lt, \\\n ksft_ne, ksft_not_in, ksft_raises, ksft_true, ksft_gt, ksft_not_none\n+ from drivers.net.lib.py import set_ethtool_feat\n from drivers.net.lib.py import GenerateTraffic, Remote, Iperf3Runner\n from drivers.net.lib.py import NetDrvEnv, NetDrvEpEnv, NetDrvContEnv\n \n@@ -49,7 +50,7 @@ try:\n \"ksft_ne\", \"ksft_not_in\", \"ksft_raises\", \"ksft_true\", \"ksft_gt\",\n \"ksft_not_none\", \"ksft_not_none\",\n \"NetDrvEnv\", \"NetDrvEpEnv\", \"NetDrvContEnv\", \"GenerateTraffic\",\n- \"Remote\", \"Iperf3Runner\"]\n+ \"Remote\", \"Iperf3Runner\", \"set_ethtool_feat\"]\n except ModuleNotFoundError as e:\n print(\"Failed importing `net` library from kernel sources\")\n print(str(e))\ndiff --git a/tools/testing/selftests/drivers/net/hw/vlan.py b/tools/testing/selftests/drivers/net/hw/vlan.py\nnew file mode 100755\nindex 0000000000000..f514ad3e5dfd8\n--- /dev/null\n+++ b/tools/testing/selftests/drivers/net/hw/vlan.py\n@@ -0,0 +1,127 @@\n+#!/usr/bin/env python3\n+# SPDX-License-Identifier: GPL-2.0\n+\n+\"\"\"\n+VLAN tests.\n+\n+Validates that ping traffic is sent and received correctly over 802.1q\n+and 802.1ad VLAN interfaces, with hardware RX VLAN stripping enabled and\n+disabled on the local interface.\n+\n+The \"hw\" test variants enable the RX VLAN stripping features supported by\n+the device, the \"sw\" test variants disable all of them. A test is xfailed\n+if the requested configuration is not possible.\n+\n+Test cases:\n+ - 8021q_hw: Traffic over a single 802.1q VLAN, HW stripping on\n+ - 8021q_sw: Traffic over a single 802.1q VLAN, HW stripping off\n+ - 8021ad_hw: Traffic over a single 802.1ad VLAN, HW stripping on\n+ - 8021ad_sw: Traffic over a single 802.1ad VLAN, HW stripping off\n+ - qinq_hw: Traffic over an 802.1q VLAN stacked on an 802.1ad VLAN,\n+ HW stripping on\n+ - qinq_sw: Traffic over an 802.1q VLAN stacked on an 802.1ad VLAN,\n+ HW stripping off\n+\"\"\"\n+\n+import os\n+\n+from lib.py import (\n+ KsftNamedVariant,\n+ KsftXfailEx,\n+ NetDrvEpEnv,\n+ cmd,\n+ defer,\n+ ethtool,\n+ ip,\n+ ksft_exit,\n+ ksft_run,\n+ ksft_variants,\n+ set_ethtool_feat,\n+)\n+\n+OUTER_DEV = f\"vlout{os.getpid()}\"\n+INNER_DEV = f\"vlin{os.getpid()}\"\n+\n+OUTER_VID = 100\n+INNER_VID = 200\n+\n+LOCAL_IP = \"198.51.100.1\"\n+REMOTE_IP = \"198.51.100.2\"\n+\n+\n+def _vlan_add(base, name, proto, vid, host=None):\n+ \"\"\"Create a VLAN device on top of base and bring it up.\"\"\"\n+\n+ ip(f\"link add link {base} name {name} type vlan proto {proto} id {vid}\",\n+ host=host)\n+ defer(ip, f\"link del {name}\", host=host)\n+ ip(f\"link set {name} up\", host=host)\n+\n+\n+def _vlan_setup(base, addr, outer_proto, inner_proto, host=None):\n+ \"\"\"Create VLAN interfaces on base and set an IP on the innermost one.\"\"\"\n+\n+ _vlan_add(base, OUTER_DEV, outer_proto, OUTER_VID, host=host)\n+ if inner_proto:\n+ _vlan_add(OUTER_DEV, INNER_DEV, inner_proto, INNER_VID, host=host)\n+\n+ dev = INNER_DEV if inner_proto else OUTER_DEV\n+ ip(f\"addr add {addr}/24 dev {dev}\", host=host)\n+\n+\n+def _setup(cfg, outer_proto, inner_proto, hw_strip):\n+ \"\"\"Configure VLAN stripping and create the VLAN interfaces.\"\"\"\n+\n+ names = [\"rx-vlan-offload\"]\n+ if outer_proto == \"802.1ad\":\n+ names.append(\"rx-vlan-stag-hw-parse\")\n+\n+ feat = ethtool(f\"-k {cfg.ifname}\", json=True)[0]\n+ feats = {}\n+ for name in names:\n+ # hw: skip the features the device does not support\n+ # sw: request all of them off\n+ if hw_strip and feat[name][\"fixed\"] and not feat[name][\"active\"]:\n+ continue\n+ feats[name] = hw_strip\n+\n+ if hw_strip and not feats:\n+ raise KsftXfailEx(\"Device does not support RX VLAN stripping\")\n+\n+ set_ethtool_feat(cfg.ifname, feat, feats)\n+\n+ _vlan_setup(cfg.ifname, LOCAL_IP, outer_proto, inner_proto)\n+ _vlan_setup(cfg.remote_ifname, REMOTE_IP, outer_proto, inner_proto,\n+ host=cfg.remote)\n+\n+\n+def _vlan_variants():\n+ \"\"\"Generator that yields the VLAN protocols and the stripping mode.\"\"\"\n+\n+ yield KsftNamedVariant(\"8021q_hw\", \"802.1q\", None, True)\n+ yield KsftNamedVariant(\"8021q_sw\", \"802.1q\", None, False)\n+ yield KsftNamedVariant(\"8021ad_hw\", \"802.1ad\", None, True)\n+ yield KsftNamedVariant(\"8021ad_sw\", \"802.1ad\", None, False)\n+ yield KsftNamedVariant(\"qinq_hw\", \"802.1ad\", \"802.1q\", True)\n+ yield KsftNamedVariant(\"qinq_sw\", \"802.1ad\", \"802.1q\", False)\n+\n+\n+@ksft_variants(_vlan_variants())\n+def test(cfg, outer_proto, inner_proto, hw_strip):\n+ \"\"\"Run a single VLAN test\"\"\"\n+\n+ _setup(cfg, outer_proto, inner_proto, hw_strip)\n+\n+ cmd(f\"ping -c 1 -W 5 {REMOTE_IP}\")\n+\n+\n+def main() -\u003e None:\n+ \"\"\" Ksft boiler plate main \"\"\"\n+\n+ with NetDrvEpEnv(__file__) as cfg:\n+ ksft_run(cases=[test], args=(cfg, ))\n+ ksft_exit()\n+\n+\n+if __name__ == \"__main__\":\n+ main()\ndiff --git a/tools/testing/selftests/drivers/net/lib/py/__init__.py b/tools/testing/selftests/drivers/net/lib/py/__init__.py\nindex 591b1e6c7eeaa..40ccdcf0c3786 100644\n--- a/tools/testing/selftests/drivers/net/lib/py/__init__.py\n+++ b/tools/testing/selftests/drivers/net/lib/py/__init__.py\n@@ -48,11 +48,12 @@ try:\n \"ksft_not_none\", \"ksft_not_none\"]\n \n from .env import NetDrvEnv, NetDrvEpEnv, NetDrvContEnv\n+ from .feat import set_ethtool_feat\n from .load import GenerateTraffic, Iperf3Runner\n from .remote import Remote\n \n __all__ += [\"NetDrvEnv\", \"NetDrvEpEnv\", \"NetDrvContEnv\", \"GenerateTraffic\",\n- \"Remote\", \"Iperf3Runner\"]\n+ \"Remote\", \"Iperf3Runner\", \"set_ethtool_feat\"]\n except ModuleNotFoundError as e:\n print(\"Failed importing `net` library from kernel sources\")\n print(str(e))\ndiff --git a/tools/testing/selftests/drivers/net/lib/py/feat.py b/tools/testing/selftests/drivers/net/lib/py/feat.py\nnew file mode 100644\nindex 0000000000000..b94a24214e597\n--- /dev/null\n+++ b/tools/testing/selftests/drivers/net/lib/py/feat.py\n@@ -0,0 +1,35 @@\n+# SPDX-License-Identifier: GPL-2.0\n+\n+\"\"\"\n+Netdev feature helper utilities for kernel selftests.\n+\n+Provides common operations for changing device features via ethtool.\n+\"\"\"\n+\n+from . import KsftXfailEx, defer, ethtool, ksft_pr\n+\n+\n+def set_ethtool_feat(dev, current, feats, host=None):\n+ \"\"\"Set ethtool features with defer to restore original state.\"\"\"\n+ s2n = {True: \"on\", False: \"off\"}\n+\n+ new = [\"-K\", dev]\n+ old = [\"-K\", dev]\n+ no_change = True\n+ for name, state in feats.items():\n+ new += [name, s2n[state]]\n+ old += [name, s2n[current[name][\"active\"]]]\n+\n+ if current[name][\"active\"] != state:\n+ no_change = False\n+ if current[name][\"fixed\"]:\n+ raise KsftXfailEx(f\"Device does not support {name}\")\n+ if no_change:\n+ return\n+\n+ eth_cmd = ethtool(\" \".join(new), host=host)\n+ defer(ethtool, \" \".join(old), host=host)\n+\n+ # If ethtool printed something kernel must have modified some features\n+ if eth_cmd.stdout:\n+ ksft_pr(eth_cmd)\n"
} |
| 2/1 | 2026/09/13 15:06 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch exclusively modifies user-space test scripts and configuration files under tools/testing/selftests/drivers/net/, which does not affect the compiled kernel image or kernel modules.",
"WorthFuzzing": false
}Instruction: You are an expert Linux kernel maintainer and security engineer.
Your job is to review a provided patch series and evaluate whether it warrants fuzzing with syzkaller.
IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on internal assumptions. You must actively use your code access
tools to inspect the actual source code, callers, and surrounding context.
================================================================================
1. CORE TRIAGE PHILOSOPHY
================================================================================
The goal of patch fuzzing is to discover crashes, regressions, exposed latent bugs,
and newly triggered assertions introduced by the patch series.
- REACHABILITY IS THE PRIMARY GATE:
Fuzzing can only discover bugs in code that can actually execute in standard virtualized
environments (GCE or QEMU, utilizing software-emulated devices like USB gadgets, netdev, tun/tap).
If the modified code is structurally unreachable (see Section 2), it MUST NOT be fuzzed,
regardless of whether it adds assertions or complex logic.
- DO NOT BLINDLY TRUST "NO FUNCTIONAL CHANGE" (NFCI) OR "REFACTORING" CLAIMS:
Patch authors routinely label changes as "cleanups", "refactorings", or state
"No functional change intended". Do NOT take these claims at face value.
Code refactorings that rearrange logic, introduce helper functions, or alter state management
in core subsystems frequently introduce subtle semantic shifts or uncover latent kernel bugs.
If reachable executable code is modified or refactored, it MUST be fuzzed.
- NEW OR MODIFIED ASSERTIONS IN REACHABLE CODE MUST BE FUZZED:
When a patch introduces or modifies runtime checks or assertions (e.g., WARN_ON*, VM_WARN_ON*,
BUG_ON*, lockdep_assert*) in reachable code paths, it enforces new or stricter invariants.
Even if the author believes the invariant always holds, fuzzing is essential to verify whether
an unusual sequence of operations can violate it.
================================================================================
2. WHEN TO RETURN WorthFuzzing=false (NEGATIVE CRITERIA)
================================================================================
Return WorthFuzzing=false ONLY IF all modified code falls strictly into one or more of these categories:
- Non-kernel and non-executable changes:
* Modifications to Documentation/, comments, or spelling fixes.
* User-space directories, self-tests, samples, or scripts (e.g., tools/, samples/, scripts/, usr/)
that do not affect the compiled kernel image (vmlinux) or kernel modules.
* Purely decorative logging (e.g., message strings in pr_err, printk, dev_info) or tracepoints
that do not alter control flow or data structures.
* Build system or Kconfig changes that do not alter compiled C logic.
- Structurally unreachable hardware:
* Vendor-specific PCIe switches, SmartNICs, or GPU drivers (e.g., mlxsw, pds_core, qed,
ionic, amdgpu) requiring physical ASIC/PCIe cards not emulated in standard QEMU.
- Unreachable execution paths:
* Driver teardown callbacks (.remove, .shutdown, pci_unregister_driver) executed only during
physical PCI hot-unplug or manual sysfs driver unbinding.
* Code paths exclusive to architectures other than the target architecture.
================================================================================
3. WHEN TO RETURN WorthFuzzing=true (POSITIVE CRITERIA)
================================================================================
Return WorthFuzzing=true whenever the patch touches reachable executable code, including:
- Core Subsystems:
* Any logic modifications in memory management (mm/), synchronization/locking (kernel/locking/),
BPF, scheduler, core networking, VFS, or syscall handling.
- Refactorings and Code Cleanups:
* Any restructuring of reachable data structures, helper abstractions, or algorithm flows.
- Runtime Assertions and Defensive Checks:
* Any introduction or alteration of assertions (WARN_ON*, VM_WARN_ON*, BUG_ON*, etc.) in reachable paths.
- Reachable Drivers and Protocols:
* Drivers accessible via virtual buses (virtio, USB gadget, loopback, netlink, binder, sockets, etc.).
================================================================================
4. EXTRACTING FocusSymbols (PREVENTING DILUTION)
================================================================================
When WorthFuzzing=true, you must extract specific kernel functions into FocusSymbols to guide the fuzzer:
- AVOID UBIQUITOUS LIFECYCLE HOT-PATHS:
Do NOT list generic, ubiquitous functions called by almost every program in the corpus
(including, but not limited to: general memory allocators and deallocators, page fault
and trap handlers, or core synchronization primitives; this is not an exhaustive list).
Listing ubiquitous functions causes the fuzzer to classify thousands of unrelated tests as "focused",
which severely dilutes fuzzing effort away from the actual changes.
- TARGET SPECIFIC FEATURE LOGIC AND ENTRYPOINTS:
List functions that specifically implement the logic being added or altered, or direct API entrypoints
for the subsystem feature under review.
- HANDLING STATIC INLINE FUNCTIONS IN HEADERS (.h):
Compiler-inlined static functions (such as static inlines in mm/*.h or include/linux/*.h) lack
distinct symbol addresses in vmlinux and cannot be targeted directly by symbol coverage filters.
If the changes are primarily in static inline helpers, identify non-static, feature-specific caller
functions in .c files that exercise them (avoiding ubiquitous lifecycle wrappers).
================================================================================
5. IDENTIFYING EnableConfigs
================================================================================
Identify any specific CONFIG_ options required to properly compile and reach the modified code:
- Inspect Kconfig files and #ifdef guards; do not make assumptions.
- Check "depends on" lines in Kconfig to include any non-standard parent subsystem configs needed.
- Strip any 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.
Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.
Prompt: Target architecture: amd64
For your convenience, here is the diff of the changes:
commit dda4c542c33b82bafef3ad7cec842d8feff50b25
Author: syz-cluster <triage@syzkaller.com>
Date: Sun Sep 13 15:06:06 2026 +0000
syz-cluster: applied patch under review
diff --git a/tools/testing/selftests/drivers/net/gro_lib.py b/tools/testing/selftests/drivers/net/gro_lib.py
index b7ac0660adc01..e9d373cf3483c 100644
--- a/tools/testing/selftests/drivers/net/gro_lib.py
+++ b/tools/testing/selftests/drivers/net/gro_lib.py
@@ -48,7 +48,7 @@ import re
from lib.py import ksft_run, ksft_exit, ksft_pr
from lib.py import NetDrvEpEnv, KsftFailEx, KsftXfailEx
from lib.py import NetdevFamily, EthtoolFamily
-from lib.py import bkg, cmd, ctl_file_write, defer, ethtool, ip
+from lib.py import bkg, cmd, ctl_file_write, defer, ethtool, ip, set_ethtool_feat
from lib.py import ksft_variants, KsftNamedVariant
@@ -91,31 +91,6 @@ def _set_mtu_restore(dev, mtu, host):
defer(ip, f"link set dev {dev['ifname']} mtu {dev['mtu']}", host=host)
-def _set_ethtool_feat(dev, current, feats, host=None):
- s2n = {True: "on", False: "off"}
-
- new = ["-K", dev]
- old = ["-K", dev]
- no_change = True
- for name, state in feats.items():
- new += [name, s2n[state]]
- old += [name, s2n[current[name]["active"]]]
-
- if current[name]["active"] != state:
- no_change = False
- if current[name]["fixed"]:
- raise KsftXfailEx(f"Device does not support {name}")
- if no_change:
- return
-
- eth_cmd = ethtool(" ".join(new), host=host)
- defer(ethtool, " ".join(old), host=host)
-
- # If ethtool printed something kernel must have modified some features
- if eth_cmd.stdout:
- ksft_pr(eth_cmd)
-
-
def _get_queue_stats(cfg, queue_id):
"""Get stats for a specific Rx queue."""
cfg.wait_hw_stats_settle()
@@ -242,15 +217,15 @@ def _setup(cfg, mode, test_name):
ctl_file_write(flush_path, "200000")
ctl_file_write(irq_path, "10")
- _set_ethtool_feat(cfg.ifname, cfg.feat,
- {"generic-receive-offload": True,
- "rx-gro-hw": False,
- "large-receive-offload": False})
+ set_ethtool_feat(cfg.ifname, cfg.feat,
+ {"generic-receive-offload": True,
+ "rx-gro-hw": False,
+ "large-receive-offload": False})
elif mode == "hw":
- _set_ethtool_feat(cfg.ifname, cfg.feat,
- {"generic-receive-offload": False,
- "rx-gro-hw": True,
- "large-receive-offload": False})
+ set_ethtool_feat(cfg.ifname, cfg.feat,
+ {"generic-receive-offload": False,
+ "rx-gro-hw": True,
+ "large-receive-offload": False})
# Some NICs treat HW GRO as a GRO sub-feature so disabling GRO
# will also clear HW GRO. Use a hack of installing XDP generic
@@ -265,27 +240,27 @@ def _setup(cfg, mode, test_name):
# Attaching XDP may change features, fetch the latest state
feat = ethtool(f"-k {cfg.ifname}", json=True)[0]
- _set_ethtool_feat(cfg.ifname, feat,
- {"generic-receive-offload": True,
- "rx-gro-hw": True,
- "large-receive-offload": False})
+ set_ethtool_feat(cfg.ifname, feat,
+ {"generic-receive-offload": True,
+ "rx-gro-hw": True,
+ "large-receive-offload": False})
elif mode == "lro":
# netdevsim advertises LRO for feature inheritance testing with
# bonding/team tests but it doesn't actually perform the offload
cfg.require_nsim(nsim_test=False)
- _set_ethtool_feat(cfg.ifname, cfg.feat,
- {"generic-receive-offload": False,
- "rx-gro-hw": False,
- "large-receive-offload": True})
+ set_ethtool_feat(cfg.ifname, cfg.feat,
+ {"generic-receive-offload": False,
+ "rx-gro-hw": False,
+ "large-receive-offload": True})
try:
# Disable TSO for local tests
cfg.require_nsim() # will raise KsftXfailEx if not running on nsim
- _set_ethtool_feat(cfg.remote_ifname, cfg.remote_feat,
- {"tcp-segmentation-offload": False},
- host=cfg.remote)
+ set_ethtool_feat(cfg.remote_ifname, cfg.remote_feat,
+ {"tcp-segmentation-offload": False},
+ host=cfg.remote)
except KsftXfailEx:
pass
diff --git a/tools/testing/selftests/drivers/net/hw/Makefile b/tools/testing/selftests/drivers/net/hw/Makefile
index bd3b8d2fa47e0..5582b644078ed 100644
--- a/tools/testing/selftests/drivers/net/hw/Makefile
+++ b/tools/testing/selftests/drivers/net/hw/Makefile
@@ -54,6 +54,7 @@ TEST_PROGS = \
tso.py \
userns_devmem.py \
uso.py \
+ vlan.py \
xdp_metadata.py \
xsk_reconfig.py \
#
diff --git a/tools/testing/selftests/drivers/net/hw/config b/tools/testing/selftests/drivers/net/hw/config
index d89a9ba176558..c6c2b64bb7124 100644
--- a/tools/testing/selftests/drivers/net/hw/config
+++ b/tools/testing/selftests/drivers/net/hw/config
@@ -24,5 +24,6 @@ CONFIG_NET_SCH_INGRESS=y
CONFIG_SYNC_FILE=y
CONFIG_UDMABUF=y
CONFIG_USER_NS=y
+CONFIG_VLAN_8021Q=m
CONFIG_VXLAN=y
CONFIG_XFRM_USER=y
diff --git a/tools/testing/selftests/drivers/net/hw/lib/py/__init__.py b/tools/testing/selftests/drivers/net/hw/lib/py/__init__.py
index 81e1d1865cd50..4077f5f1a1be3 100644
--- a/tools/testing/selftests/drivers/net/hw/lib/py/__init__.py
+++ b/tools/testing/selftests/drivers/net/hw/lib/py/__init__.py
@@ -31,6 +31,7 @@ try:
ksft_setup, ksft_variants, KsftNamedVariant
from net.lib.py import ksft_eq, ksft_ge, ksft_in, ksft_is, ksft_lt, \
ksft_ne, ksft_not_in, ksft_raises, ksft_true, ksft_gt, ksft_not_none
+ from drivers.net.lib.py import set_ethtool_feat
from drivers.net.lib.py import GenerateTraffic, Remote, Iperf3Runner
from drivers.net.lib.py import NetDrvEnv, NetDrvEpEnv, NetDrvContEnv
@@ -49,7 +50,7 @@ try:
"ksft_ne", "ksft_not_in", "ksft_raises", "ksft_true", "ksft_gt",
"ksft_not_none", "ksft_not_none",
"NetDrvEnv", "NetDrvEpEnv", "NetDrvContEnv", "GenerateTraffic",
- "Remote", "Iperf3Runner"]
+ "Remote", "Iperf3Runner", "set_ethtool_feat"]
except ModuleNotFoundError as e:
print("Failed importing `net` library from kernel sources")
print(str(e))
diff --git a/tools/testing/selftests/drivers/net/hw/vlan.py b/tools/testing/selftests/drivers/net/hw/vlan.py
new file mode 100755
index 0000000000000..f514ad3e5dfd8
--- /dev/null
+++ b/tools/testing/selftests/drivers/net/hw/vlan.py
@@ -0,0 +1,127 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0
+
+"""
+VLAN tests.
+
+Validates that ping traffic is sent and received correctly over 802.1q
+and 802.1ad VLAN interfaces, with hardware RX VLAN stripping enabled and
+disabled on the local interface.
+
+The "hw" test variants enable the RX VLAN stripping features supported by
+the device, the "sw" test variants disable all of them. A test is xfailed
+if the requested configuration is not possible.
+
+Test cases:
+ - 8021q_hw: Traffic over a single 802.1q VLAN, HW stripping on
+ - 8021q_sw: Traffic over a single 802.1q VLAN, HW stripping off
+ - 8021ad_hw: Traffic over a single 802.1ad VLAN, HW stripping on
+ - 8021ad_sw: Traffic over a single 802.1ad VLAN, HW stripping off
+ - qinq_hw: Traffic over an 802.1q VLAN stacked on an 802.1ad VLAN,
+ HW stripping on
+ - qinq_sw: Traffic over an 802.1q VLAN stacked on an 802.1ad VLAN,
+ HW stripping off
+"""
+
+import os
+
+from lib.py import (
+ KsftNamedVariant,
+ KsftXfailEx,
+ NetDrvEpEnv,
+ cmd,
+ defer,
+ ethtool,
+ ip,
+ ksft_exit,
+ ksft_run,
+ ksft_variants,
+ set_ethtool_feat,
+)
+
+OUTER_DEV = f"vlout{os.getpid()}"
+INNER_DEV = f"vlin{os.getpid()}"
+
+OUTER_VID = 100
+INNER_VID = 200
+
+LOCAL_IP = "198.51.100.1"
+REMOTE_IP = "198.51.100.2"
+
+
+def _vlan_add(base, name, proto, vid, host=None):
+ """Create a VLAN device on top of base and bring it up."""
+
+ ip(f"link add link {base} name {name} type vlan proto {proto} id {vid}",
+ host=host)
+ defer(ip, f"link del {name}", host=host)
+ ip(f"link set {name} up", host=host)
+
+
+def _vlan_setup(base, addr, outer_proto, inner_proto, host=None):
+ """Create VLAN interfaces on base and set an IP on the innermost one."""
+
+ _vlan_add(base, OUTER_DEV, outer_proto, OUTER_VID, host=host)
+ if inner_proto:
+ _vlan_add(OUTER_DEV, INNER_DEV, inner_proto, INNER_VID, host=host)
+
+ dev = INNER_DEV if inner_proto else OUTER_DEV
+ ip(f"addr add {addr}/24 dev {dev}", host=host)
+
+
+def _setup(cfg, outer_proto, inner_proto, hw_strip):
+ """Configure VLAN stripping and create the VLAN interfaces."""
+
+ names = ["rx-vlan-offload"]
+ if outer_proto == "802.1ad":
+ names.append("rx-vlan-stag-hw-parse")
+
+ feat = ethtool(f"-k {cfg.ifname}", json=True)[0]
+ feats = {}
+ for name in names:
+ # hw: skip the features the device does not support
+ # sw: request all of them off
+ if hw_strip and feat[name]["fixed"] and not feat[name]["active"]:
+ continue
+ feats[name] = hw_strip
+
+ if hw_strip and not feats:
+ raise KsftXfailEx("Device does not support RX VLAN stripping")
+
+ set_ethtool_feat(cfg.ifname, feat, feats)
+
+ _vlan_setup(cfg.ifname, LOCAL_IP, outer_proto, inner_proto)
+ _vlan_setup(cfg.remote_ifname, REMOTE_IP, outer_proto, inner_proto,
+ host=cfg.remote)
+
+
+def _vlan_variants():
+ """Generator that yields the VLAN protocols and the stripping mode."""
+
+ yield KsftNamedVariant("8021q_hw", "802.1q", None, True)
+ yield KsftNamedVariant("8021q_sw", "802.1q", None, False)
+ yield KsftNamedVariant("8021ad_hw", "802.1ad", None, True)
+ yield KsftNamedVariant("8021ad_sw", "802.1ad", None, False)
+ yield KsftNamedVariant("qinq_hw", "802.1ad", "802.1q", True)
+ yield KsftNamedVariant("qinq_sw", "802.1ad", "802.1q", False)
+
+
+@ksft_variants(_vlan_variants())
+def test(cfg, outer_proto, inner_proto, hw_strip):
+ """Run a single VLAN test"""
+
+ _setup(cfg, outer_proto, inner_proto, hw_strip)
+
+ cmd(f"ping -c 1 -W 5 {REMOTE_IP}")
+
+
+def main() -> None:
+ """ Ksft boiler plate main """
+
+ with NetDrvEpEnv(__file__) as cfg:
+ ksft_run(cases=[test], args=(cfg, ))
+ ksft_exit()
+
+
+if __name__ == "__main__":
+ main()
diff --git a/tools/testing/selftests/drivers/net/lib/py/__init__.py b/tools/testing/selftests/drivers/net/lib/py/__init__.py
index 591b1e6c7eeaa..40ccdcf0c3786 100644
--- a/tools/testing/selftests/drivers/net/lib/py/__init__.py
+++ b/tools/testing/selftests/drivers/net/lib/py/__init__.py
@@ -48,11 +48,12 @@ try:
"ksft_not_none", "ksft_not_none"]
from .env import NetDrvEnv, NetDrvEpEnv, NetDrvContEnv
+ from .feat import set_ethtool_feat
from .load import GenerateTraffic, Iperf3Runner
from .remote import Remote
__all__ += ["NetDrvEnv", "NetDrvEpEnv", "NetDrvContEnv", "GenerateTraffic",
- "Remote", "Iperf3Runner"]
+ "Remote", "Iperf3Runner", "set_ethtool_feat"]
except ModuleNotFoundError as e:
print("Failed importing `net` library from kernel sources")
print(str(e))
diff --git a/tools/testing/selftests/drivers/net/lib/py/feat.py b/tools/testing/selftests/drivers/net/lib/py/feat.py
new file mode 100644
index 0000000000000..b94a24214e597
--- /dev/null
+++ b/tools/testing/selftests/drivers/net/lib/py/feat.py
@@ -0,0 +1,35 @@
+# SPDX-License-Identifier: GPL-2.0
+
+"""
+Netdev feature helper utilities for kernel selftests.
+
+Provides common operations for changing device features via ethtool.
+"""
+
+from . import KsftXfailEx, defer, ethtool, ksft_pr
+
+
+def set_ethtool_feat(dev, current, feats, host=None):
+ """Set ethtool features with defer to restore original state."""
+ s2n = {True: "on", False: "off"}
+
+ new = ["-K", dev]
+ old = ["-K", dev]
+ no_change = True
+ for name, state in feats.items():
+ new += [name, s2n[state]]
+ old += [name, s2n[current[name]["active"]]]
+
+ if current[name]["active"] != state:
+ no_change = False
+ if current[name]["fixed"]:
+ raise KsftXfailEx(f"Device does not support {name}")
+ if no_change:
+ return
+
+ eth_cmd = ethtool(" ".join(new), host=host)
+ defer(ethtool, " ".join(old), host=host)
+
+ # If ethtool printed something kernel must have modified some features
+ if eth_cmd.stdout:
+ ksft_pr(eth_cmd)
|
| 3/2 | 2026/09/13 15:06 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 7387 output: 68 thoughts: 899 Thoughts: **Patch Analysis: WorthFuzzing Evaluation** Alright, let's break down this patch. My initial scan of the diff reveals modifications within the `tools/testing/selftests/drivers/net/` directory. Specifically, I'm seeing changes to Python scripts (`gro_lib.py`, `vlan.py`, various `__init__.py` files and `feat.py`), a `Makefile`, and a `config` file. Given my expertise, my first thought is to determine if this requires fuzzing, so I immediately head to the negative criteria outlined in the instructions. According to Section 2, a "WorthFuzzing=false" result is justified if *all* the modified code falls into one or more of several categories, and my understanding of the implications of these changes in the context of our existing testing framework is critical to getting this right. The instructions list modifications that do *not* require fuzzing: documentation, comments, user-space tools and scripts that don't impact the kernel image or modules, decorative logging, and build system/Kconfig changes that don't alter compiled C logic. Looking closely at the file paths, I immediately see that all changes are confined to the `tools/testing/selftests/drivers/net/` path. This strongly suggests these are *user-space* self-tests, scripts, and configuration files, definitely not kernel code. They live in a completely isolated environment, so there is no risk of them affecting the compiled kernel image (`vmlinux`) or any of the kernel modules. These are Python scripts and configuration files, and a Makefile for building the selftests. Therefore, because the patch strictly modifies user-space selftests, the negative criteria are met. I confirm this by assigning `WorthFuzzing=false`, with no `FocusSymbols` or `EnableConfigs`. The reasoning must be clear and concise. Based on my assessment, I can confidently state that the patch only touches user-space testing infrastructure and does not introduce any changes to the kernel image or kernel modules. After a quick double-check of the instructions and the "set-results" guidelines, I'm sure that this assessment is correct. |
| 4/2 | 2026/09/13 15:07 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The patch exclusively modifies user-space test scripts and configuration files under tools/testing/selftests/drivers/net/, which does not affect the compiled kernel image or kernel modules.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The patch exclusively modifies user-space test scripts and configuration files under tools/testing/selftests/drivers/net/, which does not affect the compiled kernel image or kernel modules.",
"WorthFuzzing": false
} |
| 5/1 | 2026/09/13 15:07 | action | If |
0mArgs:{
"WorthFuzzing": false
}Results: null |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|