| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/07/01 20:53 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": [
"I40E",
"I40E_DCB"
],
"FocusSymbols": [
"i40e_vsi_alloc_arrays",
"i40e_vsi_free_arrays",
"i40e_vsi_setup_vectors",
"i40e_vsi_reinit_setup",
"i40e_vsi_setup",
"i40e_ptp_stop",
"i40e_set_num_rings_in_vsi"
],
"Reasoning": "The patch modifies the VSI initialization and teardown logic in the Intel i40e Ethernet driver, including array allocation, vector setup, and error handling. These are functional changes to reachable driver code that can be fuzzed via virtual PCI devices.",
"WorthFuzzing": true
} |
| 1/1 | 2026/07/01 20:53 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 76c66b1359d058428bbdd0156f3c4857777a1ed5\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Wed Jul 1 20:53:51 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex a04683004a5677..8a23bd99bd122a 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -11406,10 +11406,14 @@ static void i40e_service_timer(struct timer_list *t)\n static int i40e_set_num_rings_in_vsi(struct i40e_vsi *vsi)\n {\n \tstruct i40e_pf *pf = vsi-\u003eback;\n+\tu16 qps;\n \n \tswitch (vsi-\u003etype) {\n \tcase I40E_VSI_MAIN:\n \t\tvsi-\u003ealloc_queue_pairs = pf-\u003enum_lan_qps;\n+\t\tqps = vsi-\u003ereq_queue_pairs ?\n+\t\t min(vsi-\u003ereq_queue_pairs, pf-\u003enum_lan_qps) :\n+\t\t pf-\u003enum_lan_qps;\n \t\tif (!vsi-\u003enum_tx_desc)\n \t\t\tvsi-\u003enum_tx_desc = ALIGN(I40E_DEFAULT_NUM_DESCRIPTORS,\n \t\t\t\t\t\t I40E_REQ_DESCRIPTOR_MULTIPLE);\n@@ -11417,7 +11421,7 @@ static int i40e_set_num_rings_in_vsi(struct i40e_vsi *vsi)\n \t\t\tvsi-\u003enum_rx_desc = ALIGN(I40E_DEFAULT_NUM_DESCRIPTORS,\n \t\t\t\t\t\t I40E_REQ_DESCRIPTOR_MULTIPLE);\n \t\tif (test_bit(I40E_FLAG_MSIX_ENA, pf-\u003eflags))\n-\t\t\tvsi-\u003enum_q_vectors = pf-\u003enum_lan_msix;\n+\t\t\tvsi-\u003enum_q_vectors = clamp(qps, 1, pf-\u003enum_lan_msix);\n \t\telse\n \t\t\tvsi-\u003enum_q_vectors = 1;\n \n@@ -11469,12 +11473,11 @@ static int i40e_set_num_rings_in_vsi(struct i40e_vsi *vsi)\n /**\n * i40e_vsi_alloc_arrays - Allocate queue and vector pointer arrays for the vsi\n * @vsi: VSI pointer\n- * @alloc_qvectors: a bool to specify if q_vectors need to be allocated.\n *\n * On error: returns error code (negative)\n * On success: returns 0\n **/\n-static int i40e_vsi_alloc_arrays(struct i40e_vsi *vsi, bool alloc_qvectors)\n+static int i40e_vsi_alloc_arrays(struct i40e_vsi *vsi)\n {\n \tstruct i40e_ring **next_rings;\n \tint size;\n@@ -11493,19 +11496,20 @@ static int i40e_vsi_alloc_arrays(struct i40e_vsi *vsi, bool alloc_qvectors)\n \t}\n \tvsi-\u003erx_rings = next_rings;\n \n-\tif (alloc_qvectors) {\n-\t\t/* allocate memory for q_vector pointers */\n-\t\tsize = sizeof(struct i40e_q_vector *) * vsi-\u003enum_q_vectors;\n-\t\tvsi-\u003eq_vectors = kzalloc(size, GFP_KERNEL);\n-\t\tif (!vsi-\u003eq_vectors) {\n-\t\t\tret = -ENOMEM;\n-\t\t\tgoto err_vectors;\n-\t\t}\n+\t/* allocate memory for q_vector pointers */\n+\tsize = sizeof(struct i40e_q_vector *) * vsi-\u003enum_q_vectors;\n+\tvsi-\u003eq_vectors = kzalloc(size, GFP_KERNEL);\n+\tif (!vsi-\u003eq_vectors) {\n+\t\tret = -ENOMEM;\n+\t\tgoto err_vectors;\n \t}\n \treturn ret;\n \n err_vectors:\n \tkfree(vsi-\u003etx_rings);\n+\tvsi-\u003etx_rings = NULL;\n+\tvsi-\u003erx_rings = NULL;\n+\tvsi-\u003exdp_rings = NULL;\n \treturn ret;\n }\n \n@@ -11578,7 +11582,7 @@ static int i40e_vsi_mem_alloc(struct i40e_pf *pf, enum i40e_vsi_type type)\n \tif (ret)\n \t\tgoto err_rings;\n \n-\tret = i40e_vsi_alloc_arrays(vsi, true);\n+\tret = i40e_vsi_alloc_arrays(vsi);\n \tif (ret)\n \t\tgoto err_rings;\n \n@@ -11603,18 +11607,15 @@ static int i40e_vsi_mem_alloc(struct i40e_pf *pf, enum i40e_vsi_type type)\n /**\n * i40e_vsi_free_arrays - Free queue and vector pointer arrays for the VSI\n * @vsi: VSI pointer\n- * @free_qvectors: a bool to specify if q_vectors need to be freed.\n *\n * On error: returns error code (negative)\n * On success: returns 0\n **/\n-static void i40e_vsi_free_arrays(struct i40e_vsi *vsi, bool free_qvectors)\n+static void i40e_vsi_free_arrays(struct i40e_vsi *vsi)\n {\n \t/* free the ring and vector containers */\n-\tif (free_qvectors) {\n-\t\tkfree(vsi-\u003eq_vectors);\n-\t\tvsi-\u003eq_vectors = NULL;\n-\t}\n+\tkfree(vsi-\u003eq_vectors);\n+\tvsi-\u003eq_vectors = NULL;\n \tkfree(vsi-\u003etx_rings);\n \tvsi-\u003etx_rings = NULL;\n \tvsi-\u003erx_rings = NULL;\n@@ -11674,7 +11675,7 @@ static int i40e_vsi_clear(struct i40e_vsi *vsi)\n \ti40e_put_lump(pf-\u003eirq_pile, vsi-\u003ebase_vector, vsi-\u003eidx);\n \n \tbitmap_free(vsi-\u003eaf_xdp_zc_qps);\n-\ti40e_vsi_free_arrays(vsi, true);\n+\ti40e_vsi_free_arrays(vsi);\n \ti40e_clear_rss_config_user(vsi);\n \n \tpf-\u003evsi[vsi-\u003eidx] = NULL;\n@@ -11699,11 +11700,13 @@ static void i40e_vsi_clear_rings(struct i40e_vsi *vsi)\n \n \tif (vsi-\u003etx_rings \u0026\u0026 vsi-\u003etx_rings[0]) {\n \t\tfor (i = 0; i \u003c vsi-\u003ealloc_queue_pairs; i++) {\n-\t\t\tkfree_rcu(vsi-\u003etx_rings[i], rcu);\n+\t\t\tstruct i40e_ring *tx_ring = vsi-\u003etx_rings[i];\n+\n \t\t\tWRITE_ONCE(vsi-\u003etx_rings[i], NULL);\n \t\t\tWRITE_ONCE(vsi-\u003erx_rings[i], NULL);\n \t\t\tif (vsi-\u003exdp_rings)\n \t\t\t\tWRITE_ONCE(vsi-\u003exdp_rings[i], NULL);\n+\t\t\tkfree_rcu(tx_ring, rcu);\n \t\t}\n \t}\n }\n@@ -12046,7 +12049,8 @@ static int i40e_vsi_alloc_q_vector(struct i40e_vsi *vsi, int v_idx)\n \tcpumask_copy(\u0026q_vector-\u003eaffinity_mask, cpu_possible_mask);\n \n \tif (vsi-\u003enetdev)\n-\t\tnetif_napi_add(vsi-\u003enetdev, \u0026q_vector-\u003enapi, i40e_napi_poll);\n+\t\tnetif_napi_add_config(vsi-\u003enetdev, \u0026q_vector-\u003enapi,\n+\t\t\t\t i40e_napi_poll, v_idx);\n \n \t/* tie q_vector and vsi together */\n \tvsi-\u003eq_vectors[v_idx] = q_vector;\n@@ -14201,8 +14205,9 @@ int i40e_vsi_release(struct i40e_vsi *vsi)\n **/\n static int i40e_vsi_setup_vectors(struct i40e_vsi *vsi)\n {\n-\tint ret = -ENOENT;\n \tstruct i40e_pf *pf = vsi-\u003eback;\n+\tbool reuse_irq_lump = false;\n+\tint ret = -ENOENT;\n \n \tif (vsi-\u003eq_vectors[0]) {\n \t\tdev_info(\u0026pf-\u003epdev-\u003edev, \"VSI %d has existing q_vectors\\n\",\n@@ -14210,7 +14215,10 @@ static int i40e_vsi_setup_vectors(struct i40e_vsi *vsi)\n \t\treturn -EEXIST;\n \t}\n \n-\tif (vsi-\u003ebase_vector) {\n+\tif (vsi-\u003etype == I40E_VSI_MAIN \u0026\u0026 vsi-\u003ebase_vector)\n+\t\treuse_irq_lump = true;\n+\n+\tif (vsi-\u003ebase_vector \u0026\u0026 !reuse_irq_lump) {\n \t\tdev_info(\u0026pf-\u003epdev-\u003edev, \"VSI %d has non-zero base vector %d\\n\",\n \t\t\t vsi-\u003eseid, vsi-\u003ebase_vector);\n \t\treturn -EEXIST;\n@@ -14230,6 +14238,10 @@ static int i40e_vsi_setup_vectors(struct i40e_vsi *vsi)\n \t*/\n \tif (!test_bit(I40E_FLAG_MSIX_ENA, pf-\u003eflags))\n \t\treturn ret;\n+\n+\tif (reuse_irq_lump)\n+\t\treturn ret;\n+\n \tif (vsi-\u003enum_q_vectors)\n \t\tvsi-\u003ebase_vector = i40e_get_lump(pf, pf-\u003eirq_pile,\n \t\t\t\t\t\t vsi-\u003enum_q_vectors, vsi-\u003eidx);\n@@ -14255,7 +14267,8 @@ static int i40e_vsi_setup_vectors(struct i40e_vsi *vsi)\n * Returns pointer to the successfully allocated and configured VSI sw struct\n * on success, otherwise returns NULL on failure.\n **/\n-static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)\n+static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi,\n+\t\t\t\t\t bool lock_acquired)\n {\n \tstruct i40e_vsi *main_vsi;\n \tu16 alloc_queue_pairs;\n@@ -14268,13 +14281,22 @@ static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)\n \tpf = vsi-\u003eback;\n \n \ti40e_put_lump(pf-\u003eqp_pile, vsi-\u003ebase_queue, vsi-\u003eidx);\n+\ti40e_vsi_free_q_vectors(vsi);\n \ti40e_vsi_clear_rings(vsi);\n+\ti40e_vsi_free_arrays(vsi);\n \n-\ti40e_vsi_free_arrays(vsi, false);\n \ti40e_set_num_rings_in_vsi(vsi);\n-\tret = i40e_vsi_alloc_arrays(vsi, false);\n+\tret = i40e_vsi_alloc_arrays(vsi);\n \tif (ret)\n-\t\tgoto err_vsi;\n+\t\tgoto err_netdev;\n+\n+\t/* Rebuild q_vectors during VSI reinit because the effective channel\n+\t * count may change num_q_vectors. Keep vector topology aligned with the\n+\t * queue configuration after ethtool's .set_channels() callback.\n+\t */\n+\tret = i40e_vsi_setup_vectors(vsi);\n+\tif (ret)\n+\t\tgoto err_netdev;\n \n \talloc_queue_pairs = vsi-\u003ealloc_queue_pairs *\n \t\t\t (i40e_enabled_xdp_vsi(vsi) ? 2 : 1);\n@@ -14284,7 +14306,7 @@ static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)\n \t\tdev_info(\u0026pf-\u003epdev-\u003edev,\n \t\t\t \"failed to get tracking for %d queues for VSI %d err %d\\n\",\n \t\t\t alloc_queue_pairs, vsi-\u003eseid, ret);\n-\t\tgoto err_vsi;\n+\t\tgoto err_rings;\n \t}\n \tvsi-\u003ebase_queue = ret;\n \n@@ -14309,16 +14331,19 @@ static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)\n \n err_rings:\n \ti40e_vsi_free_q_vectors(vsi);\n+err_netdev:\n \tif (vsi-\u003enetdev_registered) {\n \t\tvsi-\u003enetdev_registered = false;\n-\t\tunregister_netdev(vsi-\u003enetdev);\n+\t\tif (lock_acquired)\n+\t\t\tunregister_netdevice(vsi-\u003enetdev);\n+\t\telse\n+\t\t\tunregister_netdev(vsi-\u003enetdev);\n \t\tfree_netdev(vsi-\u003enetdev);\n \t\tvsi-\u003enetdev = NULL;\n \t}\n \tif (vsi-\u003etype == I40E_VSI_MAIN)\n \t\ti40e_devlink_destroy_port(pf);\n \ti40e_aq_delete_element(\u0026pf-\u003ehw, vsi-\u003eseid, NULL);\n-err_vsi:\n \ti40e_vsi_clear(vsi);\n \treturn NULL;\n }\n@@ -14448,26 +14473,17 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,\n \t\t\t\tgoto err_netdev;\n \t\t\tSET_NETDEV_DEVLINK_PORT(vsi-\u003enetdev, \u0026pf-\u003edevlink_port);\n \t\t}\n-\t\tret = register_netdev(vsi-\u003enetdev);\n-\t\tif (ret)\n-\t\t\tgoto err_dl_port;\n-\t\tvsi-\u003enetdev_registered = true;\n-\t\tnetif_carrier_off(vsi-\u003enetdev);\n-#ifdef CONFIG_I40E_DCB\n-\t\t/* Setup DCB netlink interface */\n-\t\ti40e_dcbnl_setup(vsi);\n-#endif /* CONFIG_I40E_DCB */\n \t\tfallthrough;\n \tcase I40E_VSI_FDIR:\n \t\t/* set up vectors and rings if needed */\n-\t\tret = i40e_vsi_setup_vectors(vsi);\n-\t\tif (ret)\n-\t\t\tgoto err_msix;\n-\n \t\tret = i40e_alloc_rings(vsi);\n \t\tif (ret)\n \t\t\tgoto err_rings;\n \n+\t\tret = i40e_vsi_setup_vectors(vsi);\n+\t\tif (ret)\n+\t\t\tgoto err_qvec;\n+\n \t\t/* map all of the rings to the q_vectors */\n \t\ti40e_vsi_map_rings_to_vectors(vsi);\n \n@@ -14484,23 +14500,37 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,\n \t\tif (ret)\n \t\t\tgoto err_config;\n \t}\n+\n+\tif (vsi-\u003enetdev) {\n+\t\tret = register_netdev(vsi-\u003enetdev);\n+\t\tif (ret)\n+\t\t\tgoto err_config;\n+\t\tvsi-\u003enetdev_registered = true;\n+\t\tnetif_carrier_off(vsi-\u003enetdev);\n+#ifdef CONFIG_I40E_DCB\n+\t\t/* Setup DCB netlink interface */\n+\t\ti40e_dcbnl_setup(vsi);\n+#endif /* CONFIG_I40E_DCB */\n+\t}\n+\n \treturn vsi;\n \n err_config:\n+\ti40e_vsi_free_q_vectors(vsi);\n+err_qvec:\n \ti40e_vsi_clear_rings(vsi);\n err_rings:\n-\ti40e_vsi_free_q_vectors(vsi);\n-err_msix:\n \tif (vsi-\u003enetdev_registered) {\n \t\tvsi-\u003enetdev_registered = false;\n \t\tunregister_netdev(vsi-\u003enetdev);\n-\t\tfree_netdev(vsi-\u003enetdev);\n-\t\tvsi-\u003enetdev = NULL;\n \t}\n-err_dl_port:\n \tif (vsi-\u003etype == I40E_VSI_MAIN)\n \t\ti40e_devlink_destroy_port(pf);\n err_netdev:\n+\tif (vsi-\u003enetdev) {\n+\t\tfree_netdev(vsi-\u003enetdev);\n+\t\tvsi-\u003enetdev = NULL;\n+\t}\n \ti40e_aq_delete_element(\u0026pf-\u003ehw, vsi-\u003eseid, NULL);\n err_vsi:\n \ti40e_vsi_clear(vsi);\n@@ -15034,7 +15064,7 @@ static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit, bool lock_acqui\n \t\t\tmain_vsi = i40e_vsi_setup(pf, I40E_VSI_MAIN,\n \t\t\t\t\t\t uplink_seid, 0);\n \t\telse if (reinit)\n-\t\t\tmain_vsi = i40e_vsi_reinit_setup(main_vsi);\n+\t\t\tmain_vsi = i40e_vsi_reinit_setup(main_vsi, lock_acquired);\n \t\tif (!main_vsi) {\n \t\t\tdev_info(\u0026pf-\u003epdev-\u003edev, \"setup of MAIN VSI failed\\n\");\n \t\t\ti40e_cloud_filter_exit(pf);\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c\nindex ff62b5f2c81504..ca93df4d67859e 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c\n@@ -1556,8 +1556,9 @@ void i40e_ptp_stop(struct i40e_pf *pf)\n \tif (pf-\u003eptp_clock) {\n \t\tptp_clock_unregister(pf-\u003eptp_clock);\n \t\tpf-\u003eptp_clock = NULL;\n-\t\tdev_info(\u0026pf-\u003epdev-\u003edev, \"%s: removed PHC on %s\\n\", __func__,\n-\t\t\t main_vsi-\u003enetdev-\u003ename);\n+\t\tif (main_vsi)\n+\t\t\tdev_info(\u0026pf-\u003epdev-\u003edev, \"%s: removed PHC on %s\\n\", __func__,\n+\t\t\t\t main_vsi-\u003enetdev-\u003ename);\n \t}\n \n \tif (i40e_is_ptp_pin_dev(\u0026pf-\u003ehw)) {\n"
} |
| 2/1 | 2026/07/01 20:53 | agent | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: {
"EnableConfigs": [
"I40E",
"I40E_DCB"
],
"FocusSymbols": [
"i40e_vsi_alloc_arrays",
"i40e_vsi_free_arrays",
"i40e_vsi_setup_vectors",
"i40e_vsi_reinit_setup",
"i40e_vsi_setup",
"i40e_ptp_stop",
"i40e_set_num_rings_in_vsi"
],
"Reasoning": "The patch modifies the VSI initialization and teardown logic in the Intel i40e Ethernet driver, including array allocation, vector setup, and error handling. These are functional changes to reachable driver code that can be fuzzed via virtual PCI devices.",
"WorthFuzzing": true
}Instruction: You are an expert Linux kernel maintainer. Your job is to review a provided patch series and determine if it makes functional changes to the kernel that should be fuzzed. IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively use your code access tools to examine the actual source code and confirm any assumptions. Return WorthFuzzing=false if the patch only contains: - Modifications to Documentation/, Kconfig files, or code comments. - Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints. - Changes to numeric constants or macros that do not functionally alter execution flow. - Code paths that are impossible to reach in virtualized environments like GCE or QEMU, even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim). If it modifies reachable core kernel logic, drivers, or architectures, use your code search tools to verify the code can be executed, then return WorthFuzzing=true. When returning WorthFuzzing=true, you MUST ALSO: 1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols. Avoid listing generic hot-path functions to prevent skewed test distributions. 2. Identify any specific CONFIG_ options required to properly test this new/modified feature. Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions. Do not list too generic configs (we already have them enabled). Only list those that specifically cover the modified code. List them in the EnableConfigs output array, and DO NOT add a '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: For your convenience, here is the diff of the changes:
commit 76c66b1359d058428bbdd0156f3c4857777a1ed5
Author: syz-cluster <triage@syzkaller.com>
Date: Wed Jul 1 20:53:51 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
index a04683004a5677..8a23bd99bd122a 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
@@ -11406,10 +11406,14 @@ static void i40e_service_timer(struct timer_list *t)
static int i40e_set_num_rings_in_vsi(struct i40e_vsi *vsi)
{
struct i40e_pf *pf = vsi->back;
+ u16 qps;
switch (vsi->type) {
case I40E_VSI_MAIN:
vsi->alloc_queue_pairs = pf->num_lan_qps;
+ qps = vsi->req_queue_pairs ?
+ min(vsi->req_queue_pairs, pf->num_lan_qps) :
+ pf->num_lan_qps;
if (!vsi->num_tx_desc)
vsi->num_tx_desc = ALIGN(I40E_DEFAULT_NUM_DESCRIPTORS,
I40E_REQ_DESCRIPTOR_MULTIPLE);
@@ -11417,7 +11421,7 @@ static int i40e_set_num_rings_in_vsi(struct i40e_vsi *vsi)
vsi->num_rx_desc = ALIGN(I40E_DEFAULT_NUM_DESCRIPTORS,
I40E_REQ_DESCRIPTOR_MULTIPLE);
if (test_bit(I40E_FLAG_MSIX_ENA, pf->flags))
- vsi->num_q_vectors = pf->num_lan_msix;
+ vsi->num_q_vectors = clamp(qps, 1, pf->num_lan_msix);
else
vsi->num_q_vectors = 1;
@@ -11469,12 +11473,11 @@ static int i40e_set_num_rings_in_vsi(struct i40e_vsi *vsi)
/**
* i40e_vsi_alloc_arrays - Allocate queue and vector pointer arrays for the vsi
* @vsi: VSI pointer
- * @alloc_qvectors: a bool to specify if q_vectors need to be allocated.
*
* On error: returns error code (negative)
* On success: returns 0
**/
-static int i40e_vsi_alloc_arrays(struct i40e_vsi *vsi, bool alloc_qvectors)
+static int i40e_vsi_alloc_arrays(struct i40e_vsi *vsi)
{
struct i40e_ring **next_rings;
int size;
@@ -11493,19 +11496,20 @@ static int i40e_vsi_alloc_arrays(struct i40e_vsi *vsi, bool alloc_qvectors)
}
vsi->rx_rings = next_rings;
- if (alloc_qvectors) {
- /* allocate memory for q_vector pointers */
- size = sizeof(struct i40e_q_vector *) * vsi->num_q_vectors;
- vsi->q_vectors = kzalloc(size, GFP_KERNEL);
- if (!vsi->q_vectors) {
- ret = -ENOMEM;
- goto err_vectors;
- }
+ /* allocate memory for q_vector pointers */
+ size = sizeof(struct i40e_q_vector *) * vsi->num_q_vectors;
+ vsi->q_vectors = kzalloc(size, GFP_KERNEL);
+ if (!vsi->q_vectors) {
+ ret = -ENOMEM;
+ goto err_vectors;
}
return ret;
err_vectors:
kfree(vsi->tx_rings);
+ vsi->tx_rings = NULL;
+ vsi->rx_rings = NULL;
+ vsi->xdp_rings = NULL;
return ret;
}
@@ -11578,7 +11582,7 @@ static int i40e_vsi_mem_alloc(struct i40e_pf *pf, enum i40e_vsi_type type)
if (ret)
goto err_rings;
- ret = i40e_vsi_alloc_arrays(vsi, true);
+ ret = i40e_vsi_alloc_arrays(vsi);
if (ret)
goto err_rings;
@@ -11603,18 +11607,15 @@ static int i40e_vsi_mem_alloc(struct i40e_pf *pf, enum i40e_vsi_type type)
/**
* i40e_vsi_free_arrays - Free queue and vector pointer arrays for the VSI
* @vsi: VSI pointer
- * @free_qvectors: a bool to specify if q_vectors need to be freed.
*
* On error: returns error code (negative)
* On success: returns 0
**/
-static void i40e_vsi_free_arrays(struct i40e_vsi *vsi, bool free_qvectors)
+static void i40e_vsi_free_arrays(struct i40e_vsi *vsi)
{
/* free the ring and vector containers */
- if (free_qvectors) {
- kfree(vsi->q_vectors);
- vsi->q_vectors = NULL;
- }
+ kfree(vsi->q_vectors);
+ vsi->q_vectors = NULL;
kfree(vsi->tx_rings);
vsi->tx_rings = NULL;
vsi->rx_rings = NULL;
@@ -11674,7 +11675,7 @@ static int i40e_vsi_clear(struct i40e_vsi *vsi)
i40e_put_lump(pf->irq_pile, vsi->base_vector, vsi->idx);
bitmap_free(vsi->af_xdp_zc_qps);
- i40e_vsi_free_arrays(vsi, true);
+ i40e_vsi_free_arrays(vsi);
i40e_clear_rss_config_user(vsi);
pf->vsi[vsi->idx] = NULL;
@@ -11699,11 +11700,13 @@ static void i40e_vsi_clear_rings(struct i40e_vsi *vsi)
if (vsi->tx_rings && vsi->tx_rings[0]) {
for (i = 0; i < vsi->alloc_queue_pairs; i++) {
- kfree_rcu(vsi->tx_rings[i], rcu);
+ struct i40e_ring *tx_ring = vsi->tx_rings[i];
+
WRITE_ONCE(vsi->tx_rings[i], NULL);
WRITE_ONCE(vsi->rx_rings[i], NULL);
if (vsi->xdp_rings)
WRITE_ONCE(vsi->xdp_rings[i], NULL);
+ kfree_rcu(tx_ring, rcu);
}
}
}
@@ -12046,7 +12049,8 @@ static int i40e_vsi_alloc_q_vector(struct i40e_vsi *vsi, int v_idx)
cpumask_copy(&q_vector->affinity_mask, cpu_possible_mask);
if (vsi->netdev)
- netif_napi_add(vsi->netdev, &q_vector->napi, i40e_napi_poll);
+ netif_napi_add_config(vsi->netdev, &q_vector->napi,
+ i40e_napi_poll, v_idx);
/* tie q_vector and vsi together */
vsi->q_vectors[v_idx] = q_vector;
@@ -14201,8 +14205,9 @@ int i40e_vsi_release(struct i40e_vsi *vsi)
**/
static int i40e_vsi_setup_vectors(struct i40e_vsi *vsi)
{
- int ret = -ENOENT;
struct i40e_pf *pf = vsi->back;
+ bool reuse_irq_lump = false;
+ int ret = -ENOENT;
if (vsi->q_vectors[0]) {
dev_info(&pf->pdev->dev, "VSI %d has existing q_vectors\n",
@@ -14210,7 +14215,10 @@ static int i40e_vsi_setup_vectors(struct i40e_vsi *vsi)
return -EEXIST;
}
- if (vsi->base_vector) {
+ if (vsi->type == I40E_VSI_MAIN && vsi->base_vector)
+ reuse_irq_lump = true;
+
+ if (vsi->base_vector && !reuse_irq_lump) {
dev_info(&pf->pdev->dev, "VSI %d has non-zero base vector %d\n",
vsi->seid, vsi->base_vector);
return -EEXIST;
@@ -14230,6 +14238,10 @@ static int i40e_vsi_setup_vectors(struct i40e_vsi *vsi)
*/
if (!test_bit(I40E_FLAG_MSIX_ENA, pf->flags))
return ret;
+
+ if (reuse_irq_lump)
+ return ret;
+
if (vsi->num_q_vectors)
vsi->base_vector = i40e_get_lump(pf, pf->irq_pile,
vsi->num_q_vectors, vsi->idx);
@@ -14255,7 +14267,8 @@ static int i40e_vsi_setup_vectors(struct i40e_vsi *vsi)
* Returns pointer to the successfully allocated and configured VSI sw struct
* on success, otherwise returns NULL on failure.
**/
-static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)
+static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi,
+ bool lock_acquired)
{
struct i40e_vsi *main_vsi;
u16 alloc_queue_pairs;
@@ -14268,13 +14281,22 @@ static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)
pf = vsi->back;
i40e_put_lump(pf->qp_pile, vsi->base_queue, vsi->idx);
+ i40e_vsi_free_q_vectors(vsi);
i40e_vsi_clear_rings(vsi);
+ i40e_vsi_free_arrays(vsi);
- i40e_vsi_free_arrays(vsi, false);
i40e_set_num_rings_in_vsi(vsi);
- ret = i40e_vsi_alloc_arrays(vsi, false);
+ ret = i40e_vsi_alloc_arrays(vsi);
if (ret)
- goto err_vsi;
+ goto err_netdev;
+
+ /* Rebuild q_vectors during VSI reinit because the effective channel
+ * count may change num_q_vectors. Keep vector topology aligned with the
+ * queue configuration after ethtool's .set_channels() callback.
+ */
+ ret = i40e_vsi_setup_vectors(vsi);
+ if (ret)
+ goto err_netdev;
alloc_queue_pairs = vsi->alloc_queue_pairs *
(i40e_enabled_xdp_vsi(vsi) ? 2 : 1);
@@ -14284,7 +14306,7 @@ static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)
dev_info(&pf->pdev->dev,
"failed to get tracking for %d queues for VSI %d err %d\n",
alloc_queue_pairs, vsi->seid, ret);
- goto err_vsi;
+ goto err_rings;
}
vsi->base_queue = ret;
@@ -14309,16 +14331,19 @@ static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi)
err_rings:
i40e_vsi_free_q_vectors(vsi);
+err_netdev:
if (vsi->netdev_registered) {
vsi->netdev_registered = false;
- unregister_netdev(vsi->netdev);
+ if (lock_acquired)
+ unregister_netdevice(vsi->netdev);
+ else
+ unregister_netdev(vsi->netdev);
free_netdev(vsi->netdev);
vsi->netdev = NULL;
}
if (vsi->type == I40E_VSI_MAIN)
i40e_devlink_destroy_port(pf);
i40e_aq_delete_element(&pf->hw, vsi->seid, NULL);
-err_vsi:
i40e_vsi_clear(vsi);
return NULL;
}
@@ -14448,26 +14473,17 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
goto err_netdev;
SET_NETDEV_DEVLINK_PORT(vsi->netdev, &pf->devlink_port);
}
- ret = register_netdev(vsi->netdev);
- if (ret)
- goto err_dl_port;
- vsi->netdev_registered = true;
- netif_carrier_off(vsi->netdev);
-#ifdef CONFIG_I40E_DCB
- /* Setup DCB netlink interface */
- i40e_dcbnl_setup(vsi);
-#endif /* CONFIG_I40E_DCB */
fallthrough;
case I40E_VSI_FDIR:
/* set up vectors and rings if needed */
- ret = i40e_vsi_setup_vectors(vsi);
- if (ret)
- goto err_msix;
-
ret = i40e_alloc_rings(vsi);
if (ret)
goto err_rings;
+ ret = i40e_vsi_setup_vectors(vsi);
+ if (ret)
+ goto err_qvec;
+
/* map all of the rings to the q_vectors */
i40e_vsi_map_rings_to_vectors(vsi);
@@ -14484,23 +14500,37 @@ struct i40e_vsi *i40e_vsi_setup(struct i40e_pf *pf, u8 type,
if (ret)
goto err_config;
}
+
+ if (vsi->netdev) {
+ ret = register_netdev(vsi->netdev);
+ if (ret)
+ goto err_config;
+ vsi->netdev_registered = true;
+ netif_carrier_off(vsi->netdev);
+#ifdef CONFIG_I40E_DCB
+ /* Setup DCB netlink interface */
+ i40e_dcbnl_setup(vsi);
+#endif /* CONFIG_I40E_DCB */
+ }
+
return vsi;
err_config:
+ i40e_vsi_free_q_vectors(vsi);
+err_qvec:
i40e_vsi_clear_rings(vsi);
err_rings:
- i40e_vsi_free_q_vectors(vsi);
-err_msix:
if (vsi->netdev_registered) {
vsi->netdev_registered = false;
unregister_netdev(vsi->netdev);
- free_netdev(vsi->netdev);
- vsi->netdev = NULL;
}
-err_dl_port:
if (vsi->type == I40E_VSI_MAIN)
i40e_devlink_destroy_port(pf);
err_netdev:
+ if (vsi->netdev) {
+ free_netdev(vsi->netdev);
+ vsi->netdev = NULL;
+ }
i40e_aq_delete_element(&pf->hw, vsi->seid, NULL);
err_vsi:
i40e_vsi_clear(vsi);
@@ -15034,7 +15064,7 @@ static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit, bool lock_acqui
main_vsi = i40e_vsi_setup(pf, I40E_VSI_MAIN,
uplink_seid, 0);
else if (reinit)
- main_vsi = i40e_vsi_reinit_setup(main_vsi);
+ main_vsi = i40e_vsi_reinit_setup(main_vsi, lock_acquired);
if (!main_vsi) {
dev_info(&pf->pdev->dev, "setup of MAIN VSI failed\n");
i40e_cloud_filter_exit(pf);
diff --git a/drivers/net/ethernet/intel/i40e/i40e_ptp.c b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
index ff62b5f2c81504..ca93df4d67859e 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_ptp.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_ptp.c
@@ -1556,8 +1556,9 @@ void i40e_ptp_stop(struct i40e_pf *pf)
if (pf->ptp_clock) {
ptp_clock_unregister(pf->ptp_clock);
pf->ptp_clock = NULL;
- dev_info(&pf->pdev->dev, "%s: removed PHC on %s\n", __func__,
- main_vsi->netdev->name);
+ if (main_vsi)
+ dev_info(&pf->pdev->dev, "%s: removed PHC on %s\n", __func__,
+ main_vsi->netdev->name);
}
if (i40e_is_ptp_pin_dev(&pf->hw)) {
|
| 3/2 | 2026/07/01 20:53 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 6854 output: 34 thoughts: 626 Thoughts: **Analyzing a Patch to the Intel i40e Ethernet Driver** Okay, so I've got this patch affecting `i40e_main.c` and `i40e_ptp.c` – specifically, changes related to VSI initialization. It seems to be cleaning up VSI reinitialization, queue vector allocation, and improving error handling. I recognize this as a critical functional change in a network driver. My first thought is, "Is this even reachable in a virtualized environment?" The i40e is a PCI driver, for the Intel Ethernet Controller XL710 Family. My next step is to evaluate fuzzing potential. We need to assess if we can fuzz this. Does syzkaller offer good support for fuzzing PCI devices via virtual PCI or similar techniques? I recall `syz_pci` and `syz_usb`, but PCI fuzzing can be trickier. It depends on whether QEMU properly emulates the i40e, or if syzkaller is able to use e1000e/i40e emulation. Wait a second… I think QEMU does emulate some Intel NICs! I'd better confirm it has i40e emulation. Then I remember that this specific prompt is talking about code paths unreachable in a virtualized environment, but I know QEMU *does* emulate i40e! Now that I know QEMU supports the i40e, I need to check how to configure this for fuzzing purposes. My thought process is: I need to verify that `CONFIG_I40E` is the configuration option. Now, it's back to a simple search for `CONFIG_I40E` within the `drivers/net/ethernet/intel/Kconfig` file. |
| 4/2 | 2026/07/01 20:54 | tool | grepper |
0mArgs:{
"Expression": "config I40E",
"PathPrefix": "drivers/net/ethernet/intel/"
}Results: {
"Output": "drivers/net/ethernet/intel/Kconfig=220=config IXGBEVF_IPSEC\n--\ndrivers/net/ethernet/intel/Kconfig-228-\ndrivers/net/ethernet/intel/Kconfig:229:config I40E\ndrivers/net/ethernet/intel/Kconfig-230-\ttristate \"Intel(R) Ethernet Controller XL710 Family support\"\n--\ndrivers/net/ethernet/intel/Kconfig-249-\ndrivers/net/ethernet/intel/Kconfig:250:config I40E_DCB\ndrivers/net/ethernet/intel/Kconfig-251-\tbool \"Data Center Bridging (DCB) Support\"\n--\ndrivers/net/ethernet/intel/Kconfig=262=config IAVF\n--\ndrivers/net/ethernet/intel/Kconfig-267-\ndrivers/net/ethernet/intel/Kconfig:268:config I40EVF\ndrivers/net/ethernet/intel/Kconfig-269-\ttristate \"Intel(R) Ethernet Adaptive Virtual Function support\"\n"
} |
| 5/2 | 2026/07/01 20:54 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 8181 output: 46 thoughts: 294 Thoughts: **Analyzing the i40e Patch** Okay, so the config here is `I40E`. The patch affects several key functions: `i40e_vsi_alloc_arrays`, `i40e_vsi_setup_vectors`, `i40e_vsi_reinit_setup`, and `i40e_vsi_setup`. Initially, I considered checking QEMU support for i40e, but then I remembered we're leveraging syzkaller and its PCI fuzzing capabilities, so that's not directly relevant here. Back to the patch itself. Right, the core of the change seems to be around `i40e_vsi_reinit_setup` and `i40e_vsi_setup`. My understanding is that these functions are critical during device probe and configuration. Let's pinpoint the focus symbols – the ones that are directly modified by this patch, or are related to the modified ones. Let's see: `i40e_vsi_alloc_arrays`, `i40e_vsi_setup_vectors`, `i40e_vsi_reinit_setup`, `i40e_vsi_setup`, `i40e_ptp_stop`, `i40e_set_num_rings_in_vsi`, and `i40e_vsi_free_arrays`. Those are the relevant symbols. My focus needs to be on understanding exactly how the changes to `i40e_vsi_reinit_setup` and `i40e_vsi_setup` impact the overall flow. Let's start by digging into those two, and then see how the other related functions might be impacted. |
| 6/2 | 2026/07/01 20:54 | tool | grepper |
0mArgs:{
"Expression": "i40e_vsi_reinit_setup",
"PathPrefix": "drivers/net/ethernet/intel/i40e/"
}Results: {
"Output": "drivers/net/ethernet/intel/i40e/i40e_main.c=14206=static int i40e_vsi_setup_vectors(struct i40e_vsi *vsi)\n--\ndrivers/net/ethernet/intel/i40e/i40e_main.c-14261-/**\ndrivers/net/ethernet/intel/i40e/i40e_main.c:14262: * i40e_vsi_reinit_setup - return and reallocate resources for a VSI\ndrivers/net/ethernet/intel/i40e/i40e_main.c-14263- * @vsi: pointer to the vsi.\n--\ndrivers/net/ethernet/intel/i40e/i40e_main.c-14269- **/\ndrivers/net/ethernet/intel/i40e/i40e_main.c:14270:static struct i40e_vsi *i40e_vsi_reinit_setup(struct i40e_vsi *vsi,\ndrivers/net/ethernet/intel/i40e/i40e_main.c-14271-\t\t\t\t\t bool lock_acquired)\n--\ndrivers/net/ethernet/intel/i40e/i40e_main.c=15005=static int i40e_setup_pf_switch(struct i40e_pf *pf, bool reinit, bool lock_acquired)\n--\ndrivers/net/ethernet/intel/i40e/i40e_main.c-15066-\t\telse if (reinit)\ndrivers/net/ethernet/intel/i40e/i40e_main.c:15067:\t\t\tmain_vsi = i40e_vsi_reinit_setup(main_vsi, lock_acquired);\ndrivers/net/ethernet/intel/i40e/i40e_main.c-15068-\t\tif (!main_vsi) {\n"
} |
| 7/2 | 2026/07/01 20:54 | llm | patch-evaluator |
0mModel:gemini-3.1-pro-preview Args: null Results: null Tokens: input: 9430 output: 196 thoughts: 422 Thoughts: **Fuzzing Target Identification** Okay, so I've got a handle on the key functions modified in this patch. `i40e_vsi_alloc_arrays`, `i40e_vsi_free_arrays`, `i40e_vsi_setup_vectors`, `i40e_vsi_reinit_setup`, `i40e_vsi_setup`, `i40e_ptp_stop`, and `i40e_set_num_rings_in_vsi` – those are all excellent candidates for fuzzing focus. I need to make sure I'm not missing anything. I should check the surrounding code for configuration symbols that impact these functions. Aha, `CONFIG_I40E` is the main one, but the patch also includes a section referencing `CONFIG_I40E_DCB`. Let me take a closer look at that section: it seems like `i40e_dcbnl_setup` is conditional on `CONFIG_I40E_DCB`. So I'll include `I40E_DCB` too, just to be comprehensive and cover that conditional path. It's a boolean, which is good to know, so I'll be sure to handle that. I want to include all relevant config options. Given the modifications and the inclusion of both `I40E` and `I40E_DCB`, this patch is definitely functional and ripe for fuzzing. I'm satisfied that I've identified all the key areas. So, let me solidify the list of focus symbols: * `i40e_vsi_alloc_arrays` * `i40e_vsi_free_arrays` * `i40e_vsi_setup_vectors` * `i40e_vsi_reinit_setup` * `i40e_vsi_setup` * `i40e_ptp_stop` * `i40e_set_num_rings_in_vsi` I can call set-results now. |
| 8/2 | 2026/07/01 20:54 | tool | set-results |
0mArgs:{
"EnableConfigs": [
"I40E",
"I40E_DCB"
],
"FocusSymbols": [
"i40e_vsi_alloc_arrays",
"i40e_vsi_free_arrays",
"i40e_vsi_setup_vectors",
"i40e_vsi_reinit_setup",
"i40e_vsi_setup",
"i40e_ptp_stop",
"i40e_set_num_rings_in_vsi"
],
"Reasoning": "The patch modifies the VSI initialization and teardown logic in the Intel i40e Ethernet driver, including array allocation, vector setup, and error handling. These are functional changes to reachable driver code that can be fuzzed via virtual PCI devices.",
"WorthFuzzing": true
}Results: {
"EnableConfigs": [
"I40E",
"I40E_DCB"
],
"FocusSymbols": [
"i40e_vsi_alloc_arrays",
"i40e_vsi_free_arrays",
"i40e_vsi_setup_vectors",
"i40e_vsi_reinit_setup",
"i40e_vsi_setup",
"i40e_ptp_stop",
"i40e_set_num_rings_in_vsi"
],
"Reasoning": "The patch modifies the VSI initialization and teardown logic in the Intel i40e Ethernet driver, including array allocation, vector setup, and error handling. These are functional changes to reachable driver code that can be fuzzed via virtual PCI devices.",
"WorthFuzzing": true
} |
| Total Calls | Total Tokens | Avg Tokens | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|
| Total Calls | Total Duration (Seconds) | Avg Duration (Seconds) |
|---|