| Seq | Timestamp | Type | Name | Duration |
|---|---|---|---|---|
| 0/0 | 2026/09/15 18:38 | flow | patch-triage |
0mArgs:null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"KMSANReasoning": "",
"NeedsKMSAN": false,
"Reasoning": "The changes exclusively modify the HiSilicon Network Subsystem 3 (HNS3) ethernet driver (drivers/net/ethernet/hisilicon/hns3/), including debugfs handling and OOM work scheduling for HNS3 rings. This driver requires proprietary HiSilicon PCIe network hardware (e.g., hip08 SoC family) that is not emulated in standard virtualized environments (QEMU/GCE), making the modified code structurally unreachable for syzkaller fuzzing.",
"WorthFuzzing": false
} |
| 1/1 | 2026/09/15 18:38 | action | read-patch-diff |
0mArgs:null Results: {
"PatchDiff": "commit 87029415a956bb3c8ef0c4616e933078a008eda0\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate: Tue Sep 15 18:38:51 2026 +0000\n\n syz-cluster: applied patch under review\n\ndiff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h\nindex 4286af9239b01..e94cc33da8643 100644\n--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h\n+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h\n@@ -944,6 +944,7 @@ struct hnae3_handle {\n \n \tu8 netdev_flags;\n \tstruct dentry *hnae3_dbgfs;\n+\tstruct mutex dbg_mutex;\t/* protect debugfs against reset/unload */\n \n \t/* Network interface message level enabled bits */\n \tu32 msg_enable;\ndiff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c\nindex 1347edac76993..7d913302f4424 100644\n--- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c\n+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c\n@@ -389,6 +389,12 @@ static const char * const dim_state_str[] = { \"START\", \"IN_PROG\", \"APPLY\" };\n static const char * const\n dim_tune_stat_str[] = { \"ON_TOP\", \"TIRED\", \"RIGHT\", \"LEFT\" };\n \n+static bool hns3_dbg_is_device_busy(struct hns3_nic_priv *priv)\n+{\n+\treturn !test_bit(HNS3_NIC_STATE_INITED, \u0026priv-\u003estate) ||\n+\t test_bit(HNS3_NIC_STATE_RESETTING, \u0026priv-\u003estate);\n+}\n+\n static void hns3_get_coal_info(struct hns3_enet_tqp_vector *tqp_vector,\n \t\t\t struct seq_file *s, int i, bool is_tx)\n {\n@@ -434,7 +440,7 @@ static void hns3_get_coal_info(struct hns3_enet_tqp_vector *tqp_vector,\n \t}\n }\n \n-static void hns3_dump_coal_info(struct seq_file *s, bool is_tx)\n+static int hns3_dump_coal_info(struct seq_file *s, bool is_tx)\n {\n \tstruct hnae3_handle *h = hnae3_seq_file_to_handle(s);\n \tstruct hns3_enet_tqp_vector *tqp_vector;\n@@ -448,18 +454,32 @@ static void hns3_dump_coal_info(struct seq_file *s, bool is_tx)\n \tseq_puts(s, \"HW_GL HW_QL\\n\");\n \n \tfor (i = 0; i \u003c priv-\u003evector_num; i++) {\n+\t\tif (hns3_dbg_is_device_busy(priv))\n+\t\t\treturn -EBUSY;\n+\n \t\ttqp_vector = \u0026priv-\u003etqp_vector[i];\n \t\thns3_get_coal_info(tqp_vector, s, i, is_tx);\n \t}\n+\n+\treturn 0;\n }\n \n static int hns3_dbg_coal_info(struct seq_file *s, void *data)\n {\n-\thns3_dump_coal_info(s, true);\n-\tseq_puts(s, \"\\n\");\n-\thns3_dump_coal_info(s, false);\n+\tstruct hnae3_handle *h = hnae3_seq_file_to_handle(s);\n+\tstruct hns3_nic_priv *priv = h-\u003epriv;\n+\tint ret;\n \n-\treturn 0;\n+\tguard(mutex)(\u0026priv-\u003eae_handle-\u003edbg_mutex);\n+\tif (hns3_dbg_is_device_busy(priv))\n+\t\treturn -EBUSY;\n+\n+\tret = hns3_dump_coal_info(s, true);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tseq_puts(s, \"\\n\");\n+\treturn hns3_dump_coal_info(s, false);\n }\n \n static void hns3_dump_rx_queue_info(struct hns3_enet_ring *ring,\n@@ -504,22 +524,16 @@ static int hns3_dbg_rx_queue_info(struct seq_file *s, void *data)\n \tstruct hns3_enet_ring *ring;\n \tu32 i;\n \n-\tif (!priv-\u003ering) {\n-\t\tdev_err(\u0026h-\u003epdev-\u003edev, \"priv-\u003ering is NULL\\n\");\n-\t\treturn -EFAULT;\n-\t}\n+\tguard(mutex)(\u0026priv-\u003eae_handle-\u003edbg_mutex);\n+\tif (hns3_dbg_is_device_busy(priv))\n+\t\treturn -EBUSY;\n \n \tseq_puts(s, \"QUEUE_ID BD_NUM BD_LEN TAIL HEAD FBDNUM \");\n \tseq_puts(s, \"PKTNUM COPYBREAK RING_EN RX_RING_EN BASE_ADDR\\n\");\n \n \tfor (i = 0; i \u003c h-\u003ekinfo.num_tqps; i++) {\n-\t\t/* Each cycle needs to determine whether the instance is reset,\n-\t\t * to prevent reference to invalid memory. And need to ensure\n-\t\t * that the following code is executed within 100ms.\n-\t\t */\n-\t\tif (!test_bit(HNS3_NIC_STATE_INITED, \u0026priv-\u003estate) ||\n-\t\t test_bit(HNS3_NIC_STATE_RESETTING, \u0026priv-\u003estate))\n-\t\t\treturn -EPERM;\n+\t\tif (hns3_dbg_is_device_busy(priv))\n+\t\t\treturn -EBUSY;\n \n \t\tring = \u0026priv-\u003ering[(u32)(i + h-\u003ekinfo.num_tqps)];\n \t\thns3_dump_rx_queue_info(ring, s, i);\n@@ -569,22 +583,16 @@ static int hns3_dbg_tx_queue_info(struct seq_file *s, void *data)\n \tstruct hns3_enet_ring *ring;\n \tu32 i;\n \n-\tif (!priv-\u003ering) {\n-\t\tdev_err(\u0026h-\u003epdev-\u003edev, \"priv-\u003ering is NULL\\n\");\n-\t\treturn -EFAULT;\n-\t}\n+\tguard(mutex)(\u0026priv-\u003eae_handle-\u003edbg_mutex);\n+\tif (hns3_dbg_is_device_busy(priv))\n+\t\treturn -EBUSY;\n \n \tseq_puts(s, \"QUEUE_ID BD_NUM TC TAIL HEAD FBDNUM OFFSET \");\n \tseq_puts(s, \"PKTNUM RING_EN TX_RING_EN BASE_ADDR\\n\");\n \n \tfor (i = 0; i \u003c h-\u003ekinfo.num_tqps; i++) {\n-\t\t/* Each cycle needs to determine whether the instance is reset,\n-\t\t * to prevent reference to invalid memory. And need to ensure\n-\t\t * that the following code is executed within 100ms.\n-\t\t */\n-\t\tif (!test_bit(HNS3_NIC_STATE_INITED, \u0026priv-\u003estate) ||\n-\t\t test_bit(HNS3_NIC_STATE_RESETTING, \u0026priv-\u003estate))\n-\t\t\treturn -EPERM;\n+\t\tif (hns3_dbg_is_device_busy(priv))\n+\t\t\treturn -EBUSY;\n \n \t\tring = \u0026priv-\u003ering[i];\n \t\thns3_dump_tx_queue_info(ring, s, i);\n@@ -604,9 +612,14 @@ static int hns3_dbg_queue_map(struct seq_file *s, void *data)\n \n \tseq_puts(s, \"local_queue_id global_queue_id vector_id\\n\");\n \n+\tguard(mutex)(\u0026priv-\u003eae_handle-\u003edbg_mutex);\n+\tif (hns3_dbg_is_device_busy(priv))\n+\t\treturn -EBUSY;\n+\n \tfor (i = 0; i \u003c h-\u003ekinfo.num_tqps; i++) {\n-\t\tif (!priv-\u003ering || !priv-\u003ering[i].tqp_vector)\n-\t\t\tcontinue;\n+\t\tif (hns3_dbg_is_device_busy(priv))\n+\t\t\treturn -EBUSY;\n+\n \t\tseq_printf(s, \"%-16u%-17u%d\\n\", i,\n \t\t\t h-\u003eae_algo-\u003eops-\u003eget_global_queue_id(h, i),\n \t\t\t priv-\u003ering[i].tqp_vector-\u003evector_irq);\n@@ -661,8 +674,10 @@ static int hns3_dbg_rx_bd_info(struct seq_file *s, void *private)\n \n \tring = \u0026priv-\u003ering[data-\u003eqid + data-\u003ehandle-\u003ekinfo.num_tqps];\n \tfor (i = 0; i \u003c ring-\u003edesc_num; i++) {\n-\t\tdesc = \u0026ring-\u003edesc[i];\n+\t\tif (hns3_dbg_is_device_busy(priv))\n+\t\t\treturn -EBUSY;\n \n+\t\tdesc = \u0026ring-\u003edesc[i];\n \t\thns3_dump_rx_bd_info(priv, desc, s, i);\n \t}\n \n@@ -706,8 +721,10 @@ static int hns3_dbg_tx_bd_info(struct seq_file *s, void *private)\n \n \tring = \u0026priv-\u003ering[data-\u003eqid];\n \tfor (i = 0; i \u003c ring-\u003edesc_num; i++) {\n-\t\tdesc = \u0026ring-\u003edesc[i];\n+\t\tif (hns3_dbg_is_device_busy(priv))\n+\t\t\treturn -EBUSY;\n \n+\t\tdesc = \u0026ring-\u003edesc[i];\n \t\thns3_dump_tx_bd_info(desc, s, i);\n \t}\n \n@@ -796,10 +813,9 @@ static int hns3_dbg_page_pool_info(struct seq_file *s, void *data)\n \tstruct hns3_enet_ring *ring;\n \tu32 i;\n \n-\tif (!priv-\u003ering) {\n-\t\tdev_err(\u0026h-\u003epdev-\u003edev, \"priv-\u003ering is NULL\\n\");\n-\t\treturn -EFAULT;\n-\t}\n+\tguard(mutex)(\u0026priv-\u003eae_handle-\u003edbg_mutex);\n+\tif (hns3_dbg_is_device_busy(priv))\n+\t\treturn -EBUSY;\n \n \tif (!priv-\u003ering[h-\u003ekinfo.num_tqps].page_pool) {\n \t\tdev_err(\u0026h-\u003epdev-\u003edev, \"page pool is not initialized\\n\");\n@@ -810,9 +826,8 @@ static int hns3_dbg_page_pool_info(struct seq_file *s, void *data)\n \tseq_puts(s, \"POOL_SIZE(PAGE_NUM) ORDER NUMA_ID MAX_LEN\\n\");\n \n \tfor (i = 0; i \u003c h-\u003ekinfo.num_tqps; i++) {\n-\t\tif (!test_bit(HNS3_NIC_STATE_INITED, \u0026priv-\u003estate) ||\n-\t\t test_bit(HNS3_NIC_STATE_RESETTING, \u0026priv-\u003estate))\n-\t\t\treturn -EPERM;\n+\t\tif (hns3_dbg_is_device_busy(priv))\n+\t\t\treturn -EBUSY;\n \n \t\tring = \u0026priv-\u003ering[(u32)(i + h-\u003ekinfo.num_tqps)];\n \t\thns3_dump_page_pool_info(ring, s, i);\n@@ -827,8 +842,8 @@ static int hns3_dbg_bd_info_show(struct seq_file *s, void *private)\n \tstruct hnae3_handle *h = data-\u003ehandle;\n \tstruct hns3_nic_priv *priv = h-\u003epriv;\n \n-\tif (!test_bit(HNS3_NIC_STATE_INITED, \u0026priv-\u003estate) ||\n-\t test_bit(HNS3_NIC_STATE_RESETTING, \u0026priv-\u003estate))\n+\tguard(mutex)(\u0026priv-\u003eae_handle-\u003edbg_mutex);\n+\tif (hns3_dbg_is_device_busy(priv))\n \t\treturn -EBUSY;\n \n \tif (data-\u003ecmd == HNAE3_DBG_CMD_TX_BD)\ndiff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c\nindex 47788be64be68..bae8b32ffc5b8 100644\n--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c\n+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c\n@@ -78,6 +78,8 @@ module_param(page_pool_enabled, bool, 0400);\n #define HNS3_MIN_TX_LEN\t\t33U\n #define HNS3_MIN_TUN_PKT_LEN\t65U\n \n+#define HNS3_OOM_POLL_INTERVAL_MS\t250\n+\n /* hns3_pci_tbl - PCI Device ID Table\n *\n * Last entry must be all 0s\n@@ -3793,6 +3795,7 @@ static int hns3_handle_rx_copybreak(struct sk_buff *skb, int i,\n \n \t\thns3_rl_err(ring_to_netdev(ring),\n \t\t\t \"failed to allocate rx frag\\n\");\n+\t\thns3_ring_set_oom_state(ring);\n \t\treturn -ENOMEM;\n \t}\n \n@@ -4162,6 +4165,7 @@ static int hns3_add_frag(struct hns3_enet_ring *ring)\n \t\t\tif (unlikely(!new_skb)) {\n \t\t\t\thns3_rl_err(ring_to_netdev(ring),\n \t\t\t\t\t \"alloc rx fraglist skb fail\\n\");\n+\t\t\t\thns3_ring_set_oom_state(ring);\n \t\t\t\treturn -ENXIO;\n \t\t\t}\n \n@@ -4451,6 +4455,34 @@ static int hns3_handle_rx_bd(struct hns3_enet_ring *ring)\n \treturn 0;\n }\n \n+static void hns3_oom_task(struct work_struct *work)\n+{\n+\tstruct hns3_nic_priv *priv = container_of(work, struct hns3_nic_priv,\n+\t\t\t\t\t\t oom_task.work);\n+\tstruct net_device *netdev = priv-\u003enetdev;\n+\tstruct hnae3_handle *h = priv-\u003eae_handle;\n+\tu16 i;\n+\n+\tif (test_bit(HNS3_NIC_STATE_DOWN, \u0026priv-\u003estate))\n+\t\treturn;\n+\n+\tnetif_dbg(h, rx_err, netdev, \"oom napi_schedule 0x%*pb\\n\",\n+\t\t priv-\u003evector_num, priv-\u003eoom_vector_bm);\n+\tfor (i = 0; i \u003c priv-\u003evector_num; i++)\n+\t\tif (test_and_clear_bit(i, priv-\u003eoom_vector_bm))\n+\t\t\tnapi_schedule(\u0026priv-\u003etqp_vector[i].napi);\n+}\n+\n+static void hns3_oom_task_schedule(struct hns3_enet_ring *ring)\n+{\n+\tstruct hns3_nic_priv *priv = netdev_priv(ring_to_netdev(ring));\n+\n+\thns3_ring_stats_update(ring, rx_oom_cnt);\n+\thns3_ring_set_oom_state(ring);\n+\tschedule_delayed_work(\u0026priv-\u003eoom_task,\n+\t\t\t msecs_to_jiffies(HNS3_OOM_POLL_INTERVAL_MS));\n+}\n+\n int hns3_clean_rx_ring(struct hns3_enet_ring *ring, int budget,\n \t\t void (*rx_fn)(struct hns3_enet_ring *, struct sk_buff *))\n {\n@@ -4472,6 +4504,9 @@ int hns3_clean_rx_ring(struct hns3_enet_ring *ring, int budget,\n \n \t\t/* Poll one pkt */\n \t\terr = hns3_handle_rx_bd(ring);\n+\t\tif (unlikely(err == -ENOMEM))\n+\t\t\tfailure = true;\n+\n \t\t/* Do not get FE for the packet or failed to alloc skb */\n \t\tif (unlikely(!ring-\u003eskb || err == -ENXIO)) {\n \t\t\tgoto out;\n@@ -4493,7 +4528,10 @@ int hns3_clean_rx_ring(struct hns3_enet_ring *ring, int budget,\n \t\tfailure = failure ||\n \t\t\t hns3_nic_alloc_rx_buffers(ring, unused_count);\n \n-\treturn failure ? budget : recv_pkts;\n+\tif (unlikely(failure || hns3_ring_is_oom_state(ring)))\n+\t\thns3_oom_task_schedule(ring);\n+\n+\treturn recv_pkts;\n }\n \n static void hns3_update_rx_int_coalesce(struct hns3_enet_tqp_vector *tqp_vector)\n@@ -4788,6 +4826,7 @@ static int hns3_nic_init_vector_data(struct hns3_nic_priv *priv)\n \t\t\t hns3_nic_common_poll);\n \t}\n \n+\tINIT_DELAYED_WORK(\u0026priv-\u003eoom_task, hns3_oom_task);\n \treturn 0;\n \n map_ring_fail:\n@@ -4854,7 +4893,7 @@ static int hns3_nic_alloc_vector_data(struct hns3_nic_priv *priv)\n \t\t\t GFP_KERNEL);\n \tif (!priv-\u003etqp_vector) {\n \t\tret = -ENOMEM;\n-\t\tgoto out;\n+\t\tgoto err_put_vector;\n \t}\n \n \tfor (i = 0; i \u003c priv-\u003evector_num; i++) {\n@@ -4865,7 +4904,22 @@ static int hns3_nic_alloc_vector_data(struct hns3_nic_priv *priv)\n \t\thns3_vector_coalesce_init(tqp_vector, priv);\n \t}\n \n-out:\n+\tpriv-\u003eoom_vector_bm = bitmap_zalloc(vector_num, GFP_KERNEL);\n+\tif (!priv-\u003eoom_vector_bm) {\n+\t\tret = -ENOMEM;\n+\t\tgoto err_free_tqp_vector;\n+\t}\n+\n+\tdevm_kfree(\u0026pdev-\u003edev, vector);\n+\treturn 0;\n+\n+err_free_tqp_vector:\n+\tdevm_kfree(\u0026pdev-\u003edev, priv-\u003etqp_vector);\n+\tpriv-\u003etqp_vector = NULL;\n+err_put_vector:\n+\tfor (i = 0; i \u003c vector_num; i++)\n+\t\th-\u003eae_algo-\u003eops-\u003eput_vector(h, vector[i].vector);\n+\tpriv-\u003evector_num = 0;\n \tdevm_kfree(\u0026pdev-\u003edev, vector);\n \treturn ret;\n }\n@@ -4883,6 +4937,7 @@ static void hns3_nic_uninit_vector_data(struct hns3_nic_priv *priv)\n \tstruct hns3_enet_tqp_vector *tqp_vector;\n \tint i;\n \n+\tcancel_delayed_work_sync(\u0026priv-\u003eoom_task);\n \tfor (i = 0; i \u003c priv-\u003evector_num; i++) {\n \t\ttqp_vector = \u0026priv-\u003etqp_vector[i];\n \n@@ -4914,6 +4969,7 @@ static void hns3_nic_dealloc_vector_data(struct hns3_nic_priv *priv)\n \tstruct pci_dev *pdev = h-\u003epdev;\n \tint i, ret;\n \n+\tbitmap_free(priv-\u003eoom_vector_bm);\n \tfor (i = 0; i \u003c priv-\u003evector_num; i++) {\n \t\tstruct hns3_enet_tqp_vector *tqp_vector;\n \n@@ -5393,6 +5449,7 @@ static int hns3_client_init(struct hnae3_handle *handle)\n \tpriv-\u003emin_tx_copybreak = 0;\n \tpriv-\u003emin_tx_spare_buf_size = 0;\n \tset_bit(HNS3_NIC_STATE_DOWN, \u0026priv-\u003estate);\n+\tmutex_init(\u0026handle-\u003edbg_mutex);\n \n \thandle-\u003emsg_enable = netif_msg_init(debug, DEFAULT_MSG_LEVEL);\n \n@@ -5506,6 +5563,7 @@ static int hns3_client_init(struct hnae3_handle *handle)\n \tpriv-\u003ering = NULL;\n out_get_ring_cfg:\n \tpriv-\u003eae_handle = NULL;\n+\tmutex_destroy(\u0026handle-\u003edbg_mutex);\n \tfree_netdev(netdev);\n \treturn ret;\n }\n@@ -5529,6 +5587,7 @@ static void hns3_client_uninit(struct hnae3_handle *handle, bool reset)\n \n \thns3_free_rx_cpu_rmap(netdev);\n \n+\tmutex_lock(\u0026handle-\u003edbg_mutex);\n \thns3_nic_uninit_irq(priv);\n \n \thns3_clear_all_ring(handle, true);\n@@ -5540,9 +5599,11 @@ static void hns3_client_uninit(struct hnae3_handle *handle, bool reset)\n \thns3_uninit_all_ring(priv);\n \n \thns3_put_ring_config(priv);\n+\tmutex_unlock(\u0026handle-\u003edbg_mutex);\n \n out_netdev_free:\n \thns3_dbg_uninit(handle);\n+\tmutex_destroy(\u0026handle-\u003edbg_mutex);\n \tfree_netdev(netdev);\n }\n \n@@ -5819,6 +5880,7 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle)\n \t\treturn 0;\n \t}\n \n+\tguard(mutex)(\u0026handle-\u003edbg_mutex);\n \thns3_free_rx_cpu_rmap(netdev);\n \thns3_nic_uninit_irq(priv);\n \thns3_clear_all_ring(handle, true);\ndiff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h\nindex 933e3527ed824..27a09629cbcab 100644\n--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h\n+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h\n@@ -449,6 +449,7 @@ struct ring_stats {\n \t\t\tu64 non_reuse_pg;\n \t\t\tu64 frag_alloc_err;\n \t\t\tu64 frag_alloc;\n+\t\t\tu64 rx_oom_cnt;\n \t\t};\n \t\t__le16 csum;\n \t};\n@@ -585,6 +586,8 @@ struct hns3_nic_priv {\n \tstruct hns3_enet_tqp_vector *tqp_vector;\n \tu16 vector_num;\n \tu8 max_non_tso_bd_num;\n+\tstruct delayed_work oom_task;\n+\tunsigned long *oom_vector_bm;\n \n \tu64 tx_timeout_count;\n \n@@ -711,6 +714,20 @@ static inline unsigned int hns3_page_order(struct hns3_enet_ring *ring)\n #define hns3_rl_usec_to_reg(int_rl) ((int_rl) \u003e\u003e 2)\n #define hns3_rl_round_down(int_rl) round_down(int_rl, 4)\n \n+static inline void hns3_ring_set_oom_state(struct hns3_enet_ring *ring)\n+{\n+\tstruct hns3_nic_priv *priv = netdev_priv(ring_to_netdev(ring));\n+\n+\tset_bit(ring-\u003etqp_vector-\u003eidx, priv-\u003eoom_vector_bm);\n+}\n+\n+static inline bool hns3_ring_is_oom_state(struct hns3_enet_ring *ring)\n+{\n+\tstruct hns3_nic_priv *priv = netdev_priv(ring_to_netdev(ring));\n+\n+\treturn test_bit(ring-\u003etqp_vector-\u003eidx, priv-\u003eoom_vector_bm);\n+}\n+\n void hns3_ethtool_set_ops(struct net_device *netdev);\n int hns3_set_channels(struct net_device *netdev,\n \t\t struct ethtool_channels *ch);\ndiff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c\nindex e7318f2363157..4e7a7e6b21ee3 100644\n--- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c\n+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c\n@@ -62,6 +62,7 @@ static const struct hns3_stats hns3_rxq_stats[] = {\n \tHNS3_TQP_STAT(\"non_reuse_pg\", non_reuse_pg),\n \tHNS3_TQP_STAT(\"frag_alloc_err\", frag_alloc_err),\n \tHNS3_TQP_STAT(\"frag_alloc\", frag_alloc),\n+\tHNS3_TQP_STAT(\"rx_oom_cnt\", rx_oom_cnt),\n };\n \n #define HNS3_PRIV_FLAGS_LEN ARRAY_SIZE(hns3_priv_flags)\n@@ -1257,6 +1258,7 @@ static int hns3_set_ringparam(struct net_device *ndev,\n \tif (if_running)\n \t\tndev-\u003enetdev_ops-\u003endo_stop(ndev);\n \n+\tguard(mutex)(\u0026h-\u003edbg_mutex);\n \thns3_change_all_ring_bd_num(priv, new_ringparam.tx_desc_num,\n \t\t\t\t new_ringparam.rx_desc_num);\n \thns3_change_rx_buf_len(ndev, new_ringparam.rx_buf_len);\ndiff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c\nindex 9a4e29bfa1666..1e9d3e08b7ded 100644\n--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c\n+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c\n@@ -15,6 +15,12 @@\n #define hclge_seq_file_to_hdev(s)\t\\\n \t\t(((struct hnae3_ae_dev *)hnae3_seq_file_to_ae_dev(s))-\u003epriv)\n \n+static bool hclge_dbg_is_device_busy(struct hclge_dev *hdev)\n+{\n+\treturn test_bit(HCLGE_STATE_RST_HANDLING, \u0026hdev-\u003estate) ||\n+\t test_bit(HCLGE_STATE_RST_FAIL, \u0026hdev-\u003estate);\n+}\n+\n static const char * const hclge_mac_state_str[] = {\n \t\"TO_ADD\", \"TO_DEL\", \"ACTIVE\"\n };\n@@ -2621,6 +2627,10 @@ static int hclge_dbg_dump_umv_info(struct seq_file *s, void *data)\n \tstruct hclge_vport *vport;\n \tu8 i;\n \n+\tguard(mutex)(\u0026hdev-\u003evport[0].nic.dbg_mutex);\n+\tif (hclge_dbg_is_device_busy(hdev))\n+\t\treturn -EBUSY;\n+\n \tseq_printf(s, \"num_alloc_vport : %u\\n\", hdev-\u003enum_alloc_vport);\n \tseq_printf(s, \"max_umv_size : %u\\n\", hdev-\u003emax_umv_size);\n \tseq_printf(s, \"wanted_umv_size : %u\\n\", hdev-\u003ewanted_umv_size);\n@@ -2831,6 +2841,10 @@ static int hclge_dbg_dump_vlan_offload_config(struct hclge_dev *hdev,\n \tint ret;\n \tu8 i;\n \n+\tguard(mutex)(\u0026hdev-\u003evport[0].nic.dbg_mutex);\n+\tif (hclge_dbg_is_device_busy(hdev))\n+\t\treturn -EBUSY;\n+\n \tseq_puts(s, \"FUNC_ID PVID ACCEPT_TAG1 ACCEPT_TAG2 ACCEPT_UNTAG1 \");\n \tseq_puts(s, \"ACCEPT_UNTAG2 INSERT_TAG1 INSERT_TAG2 SHIFT_TAG \");\n \tseq_puts(s, \"STRIP_TAG1 STRIP_TAG2 DROP_TAG1 DROP_TAG2 \");\n"
} |
| 2/1 | 2026/09/15 18:38 | agent | patch-evaluator |
0mModel:core Args: null Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The changes exclusively modify the HiSilicon Network Subsystem 3 (HNS3) ethernet driver (drivers/net/ethernet/hisilicon/hns3/), including debugfs handling and OOM work scheduling for HNS3 rings. This driver requires proprietary HiSilicon PCIe network hardware (e.g., hip08 SoC family) that is not emulated in standard virtualized environments (QEMU/GCE), making the modified code structurally unreachable for syzkaller fuzzing.",
"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 87029415a956bb3c8ef0c4616e933078a008eda0
Author: syz-cluster <triage@syzkaller.com>
Date: Tue Sep 15 18:38:51 2026 +0000
syz-cluster: applied patch under review
diff --git a/drivers/net/ethernet/hisilicon/hns3/hnae3.h b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
index 4286af9239b01..e94cc33da8643 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hnae3.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hnae3.h
@@ -944,6 +944,7 @@ struct hnae3_handle {
u8 netdev_flags;
struct dentry *hnae3_dbgfs;
+ struct mutex dbg_mutex; /* protect debugfs against reset/unload */
/* Network interface message level enabled bits */
u32 msg_enable;
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
index 1347edac76993..7d913302f4424 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
@@ -389,6 +389,12 @@ static const char * const dim_state_str[] = { "START", "IN_PROG", "APPLY" };
static const char * const
dim_tune_stat_str[] = { "ON_TOP", "TIRED", "RIGHT", "LEFT" };
+static bool hns3_dbg_is_device_busy(struct hns3_nic_priv *priv)
+{
+ return !test_bit(HNS3_NIC_STATE_INITED, &priv->state) ||
+ test_bit(HNS3_NIC_STATE_RESETTING, &priv->state);
+}
+
static void hns3_get_coal_info(struct hns3_enet_tqp_vector *tqp_vector,
struct seq_file *s, int i, bool is_tx)
{
@@ -434,7 +440,7 @@ static void hns3_get_coal_info(struct hns3_enet_tqp_vector *tqp_vector,
}
}
-static void hns3_dump_coal_info(struct seq_file *s, bool is_tx)
+static int hns3_dump_coal_info(struct seq_file *s, bool is_tx)
{
struct hnae3_handle *h = hnae3_seq_file_to_handle(s);
struct hns3_enet_tqp_vector *tqp_vector;
@@ -448,18 +454,32 @@ static void hns3_dump_coal_info(struct seq_file *s, bool is_tx)
seq_puts(s, "HW_GL HW_QL\n");
for (i = 0; i < priv->vector_num; i++) {
+ if (hns3_dbg_is_device_busy(priv))
+ return -EBUSY;
+
tqp_vector = &priv->tqp_vector[i];
hns3_get_coal_info(tqp_vector, s, i, is_tx);
}
+
+ return 0;
}
static int hns3_dbg_coal_info(struct seq_file *s, void *data)
{
- hns3_dump_coal_info(s, true);
- seq_puts(s, "\n");
- hns3_dump_coal_info(s, false);
+ struct hnae3_handle *h = hnae3_seq_file_to_handle(s);
+ struct hns3_nic_priv *priv = h->priv;
+ int ret;
- return 0;
+ guard(mutex)(&priv->ae_handle->dbg_mutex);
+ if (hns3_dbg_is_device_busy(priv))
+ return -EBUSY;
+
+ ret = hns3_dump_coal_info(s, true);
+ if (ret)
+ return ret;
+
+ seq_puts(s, "\n");
+ return hns3_dump_coal_info(s, false);
}
static void hns3_dump_rx_queue_info(struct hns3_enet_ring *ring,
@@ -504,22 +524,16 @@ static int hns3_dbg_rx_queue_info(struct seq_file *s, void *data)
struct hns3_enet_ring *ring;
u32 i;
- if (!priv->ring) {
- dev_err(&h->pdev->dev, "priv->ring is NULL\n");
- return -EFAULT;
- }
+ guard(mutex)(&priv->ae_handle->dbg_mutex);
+ if (hns3_dbg_is_device_busy(priv))
+ return -EBUSY;
seq_puts(s, "QUEUE_ID BD_NUM BD_LEN TAIL HEAD FBDNUM ");
seq_puts(s, "PKTNUM COPYBREAK RING_EN RX_RING_EN BASE_ADDR\n");
for (i = 0; i < h->kinfo.num_tqps; i++) {
- /* Each cycle needs to determine whether the instance is reset,
- * to prevent reference to invalid memory. And need to ensure
- * that the following code is executed within 100ms.
- */
- if (!test_bit(HNS3_NIC_STATE_INITED, &priv->state) ||
- test_bit(HNS3_NIC_STATE_RESETTING, &priv->state))
- return -EPERM;
+ if (hns3_dbg_is_device_busy(priv))
+ return -EBUSY;
ring = &priv->ring[(u32)(i + h->kinfo.num_tqps)];
hns3_dump_rx_queue_info(ring, s, i);
@@ -569,22 +583,16 @@ static int hns3_dbg_tx_queue_info(struct seq_file *s, void *data)
struct hns3_enet_ring *ring;
u32 i;
- if (!priv->ring) {
- dev_err(&h->pdev->dev, "priv->ring is NULL\n");
- return -EFAULT;
- }
+ guard(mutex)(&priv->ae_handle->dbg_mutex);
+ if (hns3_dbg_is_device_busy(priv))
+ return -EBUSY;
seq_puts(s, "QUEUE_ID BD_NUM TC TAIL HEAD FBDNUM OFFSET ");
seq_puts(s, "PKTNUM RING_EN TX_RING_EN BASE_ADDR\n");
for (i = 0; i < h->kinfo.num_tqps; i++) {
- /* Each cycle needs to determine whether the instance is reset,
- * to prevent reference to invalid memory. And need to ensure
- * that the following code is executed within 100ms.
- */
- if (!test_bit(HNS3_NIC_STATE_INITED, &priv->state) ||
- test_bit(HNS3_NIC_STATE_RESETTING, &priv->state))
- return -EPERM;
+ if (hns3_dbg_is_device_busy(priv))
+ return -EBUSY;
ring = &priv->ring[i];
hns3_dump_tx_queue_info(ring, s, i);
@@ -604,9 +612,14 @@ static int hns3_dbg_queue_map(struct seq_file *s, void *data)
seq_puts(s, "local_queue_id global_queue_id vector_id\n");
+ guard(mutex)(&priv->ae_handle->dbg_mutex);
+ if (hns3_dbg_is_device_busy(priv))
+ return -EBUSY;
+
for (i = 0; i < h->kinfo.num_tqps; i++) {
- if (!priv->ring || !priv->ring[i].tqp_vector)
- continue;
+ if (hns3_dbg_is_device_busy(priv))
+ return -EBUSY;
+
seq_printf(s, "%-16u%-17u%d\n", i,
h->ae_algo->ops->get_global_queue_id(h, i),
priv->ring[i].tqp_vector->vector_irq);
@@ -661,8 +674,10 @@ static int hns3_dbg_rx_bd_info(struct seq_file *s, void *private)
ring = &priv->ring[data->qid + data->handle->kinfo.num_tqps];
for (i = 0; i < ring->desc_num; i++) {
- desc = &ring->desc[i];
+ if (hns3_dbg_is_device_busy(priv))
+ return -EBUSY;
+ desc = &ring->desc[i];
hns3_dump_rx_bd_info(priv, desc, s, i);
}
@@ -706,8 +721,10 @@ static int hns3_dbg_tx_bd_info(struct seq_file *s, void *private)
ring = &priv->ring[data->qid];
for (i = 0; i < ring->desc_num; i++) {
- desc = &ring->desc[i];
+ if (hns3_dbg_is_device_busy(priv))
+ return -EBUSY;
+ desc = &ring->desc[i];
hns3_dump_tx_bd_info(desc, s, i);
}
@@ -796,10 +813,9 @@ static int hns3_dbg_page_pool_info(struct seq_file *s, void *data)
struct hns3_enet_ring *ring;
u32 i;
- if (!priv->ring) {
- dev_err(&h->pdev->dev, "priv->ring is NULL\n");
- return -EFAULT;
- }
+ guard(mutex)(&priv->ae_handle->dbg_mutex);
+ if (hns3_dbg_is_device_busy(priv))
+ return -EBUSY;
if (!priv->ring[h->kinfo.num_tqps].page_pool) {
dev_err(&h->pdev->dev, "page pool is not initialized\n");
@@ -810,9 +826,8 @@ static int hns3_dbg_page_pool_info(struct seq_file *s, void *data)
seq_puts(s, "POOL_SIZE(PAGE_NUM) ORDER NUMA_ID MAX_LEN\n");
for (i = 0; i < h->kinfo.num_tqps; i++) {
- if (!test_bit(HNS3_NIC_STATE_INITED, &priv->state) ||
- test_bit(HNS3_NIC_STATE_RESETTING, &priv->state))
- return -EPERM;
+ if (hns3_dbg_is_device_busy(priv))
+ return -EBUSY;
ring = &priv->ring[(u32)(i + h->kinfo.num_tqps)];
hns3_dump_page_pool_info(ring, s, i);
@@ -827,8 +842,8 @@ static int hns3_dbg_bd_info_show(struct seq_file *s, void *private)
struct hnae3_handle *h = data->handle;
struct hns3_nic_priv *priv = h->priv;
- if (!test_bit(HNS3_NIC_STATE_INITED, &priv->state) ||
- test_bit(HNS3_NIC_STATE_RESETTING, &priv->state))
+ guard(mutex)(&priv->ae_handle->dbg_mutex);
+ if (hns3_dbg_is_device_busy(priv))
return -EBUSY;
if (data->cmd == HNAE3_DBG_CMD_TX_BD)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 47788be64be68..bae8b32ffc5b8 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -78,6 +78,8 @@ module_param(page_pool_enabled, bool, 0400);
#define HNS3_MIN_TX_LEN 33U
#define HNS3_MIN_TUN_PKT_LEN 65U
+#define HNS3_OOM_POLL_INTERVAL_MS 250
+
/* hns3_pci_tbl - PCI Device ID Table
*
* Last entry must be all 0s
@@ -3793,6 +3795,7 @@ static int hns3_handle_rx_copybreak(struct sk_buff *skb, int i,
hns3_rl_err(ring_to_netdev(ring),
"failed to allocate rx frag\n");
+ hns3_ring_set_oom_state(ring);
return -ENOMEM;
}
@@ -4162,6 +4165,7 @@ static int hns3_add_frag(struct hns3_enet_ring *ring)
if (unlikely(!new_skb)) {
hns3_rl_err(ring_to_netdev(ring),
"alloc rx fraglist skb fail\n");
+ hns3_ring_set_oom_state(ring);
return -ENXIO;
}
@@ -4451,6 +4455,34 @@ static int hns3_handle_rx_bd(struct hns3_enet_ring *ring)
return 0;
}
+static void hns3_oom_task(struct work_struct *work)
+{
+ struct hns3_nic_priv *priv = container_of(work, struct hns3_nic_priv,
+ oom_task.work);
+ struct net_device *netdev = priv->netdev;
+ struct hnae3_handle *h = priv->ae_handle;
+ u16 i;
+
+ if (test_bit(HNS3_NIC_STATE_DOWN, &priv->state))
+ return;
+
+ netif_dbg(h, rx_err, netdev, "oom napi_schedule 0x%*pb\n",
+ priv->vector_num, priv->oom_vector_bm);
+ for (i = 0; i < priv->vector_num; i++)
+ if (test_and_clear_bit(i, priv->oom_vector_bm))
+ napi_schedule(&priv->tqp_vector[i].napi);
+}
+
+static void hns3_oom_task_schedule(struct hns3_enet_ring *ring)
+{
+ struct hns3_nic_priv *priv = netdev_priv(ring_to_netdev(ring));
+
+ hns3_ring_stats_update(ring, rx_oom_cnt);
+ hns3_ring_set_oom_state(ring);
+ schedule_delayed_work(&priv->oom_task,
+ msecs_to_jiffies(HNS3_OOM_POLL_INTERVAL_MS));
+}
+
int hns3_clean_rx_ring(struct hns3_enet_ring *ring, int budget,
void (*rx_fn)(struct hns3_enet_ring *, struct sk_buff *))
{
@@ -4472,6 +4504,9 @@ int hns3_clean_rx_ring(struct hns3_enet_ring *ring, int budget,
/* Poll one pkt */
err = hns3_handle_rx_bd(ring);
+ if (unlikely(err == -ENOMEM))
+ failure = true;
+
/* Do not get FE for the packet or failed to alloc skb */
if (unlikely(!ring->skb || err == -ENXIO)) {
goto out;
@@ -4493,7 +4528,10 @@ int hns3_clean_rx_ring(struct hns3_enet_ring *ring, int budget,
failure = failure ||
hns3_nic_alloc_rx_buffers(ring, unused_count);
- return failure ? budget : recv_pkts;
+ if (unlikely(failure || hns3_ring_is_oom_state(ring)))
+ hns3_oom_task_schedule(ring);
+
+ return recv_pkts;
}
static void hns3_update_rx_int_coalesce(struct hns3_enet_tqp_vector *tqp_vector)
@@ -4788,6 +4826,7 @@ static int hns3_nic_init_vector_data(struct hns3_nic_priv *priv)
hns3_nic_common_poll);
}
+ INIT_DELAYED_WORK(&priv->oom_task, hns3_oom_task);
return 0;
map_ring_fail:
@@ -4854,7 +4893,7 @@ static int hns3_nic_alloc_vector_data(struct hns3_nic_priv *priv)
GFP_KERNEL);
if (!priv->tqp_vector) {
ret = -ENOMEM;
- goto out;
+ goto err_put_vector;
}
for (i = 0; i < priv->vector_num; i++) {
@@ -4865,7 +4904,22 @@ static int hns3_nic_alloc_vector_data(struct hns3_nic_priv *priv)
hns3_vector_coalesce_init(tqp_vector, priv);
}
-out:
+ priv->oom_vector_bm = bitmap_zalloc(vector_num, GFP_KERNEL);
+ if (!priv->oom_vector_bm) {
+ ret = -ENOMEM;
+ goto err_free_tqp_vector;
+ }
+
+ devm_kfree(&pdev->dev, vector);
+ return 0;
+
+err_free_tqp_vector:
+ devm_kfree(&pdev->dev, priv->tqp_vector);
+ priv->tqp_vector = NULL;
+err_put_vector:
+ for (i = 0; i < vector_num; i++)
+ h->ae_algo->ops->put_vector(h, vector[i].vector);
+ priv->vector_num = 0;
devm_kfree(&pdev->dev, vector);
return ret;
}
@@ -4883,6 +4937,7 @@ static void hns3_nic_uninit_vector_data(struct hns3_nic_priv *priv)
struct hns3_enet_tqp_vector *tqp_vector;
int i;
+ cancel_delayed_work_sync(&priv->oom_task);
for (i = 0; i < priv->vector_num; i++) {
tqp_vector = &priv->tqp_vector[i];
@@ -4914,6 +4969,7 @@ static void hns3_nic_dealloc_vector_data(struct hns3_nic_priv *priv)
struct pci_dev *pdev = h->pdev;
int i, ret;
+ bitmap_free(priv->oom_vector_bm);
for (i = 0; i < priv->vector_num; i++) {
struct hns3_enet_tqp_vector *tqp_vector;
@@ -5393,6 +5449,7 @@ static int hns3_client_init(struct hnae3_handle *handle)
priv->min_tx_copybreak = 0;
priv->min_tx_spare_buf_size = 0;
set_bit(HNS3_NIC_STATE_DOWN, &priv->state);
+ mutex_init(&handle->dbg_mutex);
handle->msg_enable = netif_msg_init(debug, DEFAULT_MSG_LEVEL);
@@ -5506,6 +5563,7 @@ static int hns3_client_init(struct hnae3_handle *handle)
priv->ring = NULL;
out_get_ring_cfg:
priv->ae_handle = NULL;
+ mutex_destroy(&handle->dbg_mutex);
free_netdev(netdev);
return ret;
}
@@ -5529,6 +5587,7 @@ static void hns3_client_uninit(struct hnae3_handle *handle, bool reset)
hns3_free_rx_cpu_rmap(netdev);
+ mutex_lock(&handle->dbg_mutex);
hns3_nic_uninit_irq(priv);
hns3_clear_all_ring(handle, true);
@@ -5540,9 +5599,11 @@ static void hns3_client_uninit(struct hnae3_handle *handle, bool reset)
hns3_uninit_all_ring(priv);
hns3_put_ring_config(priv);
+ mutex_unlock(&handle->dbg_mutex);
out_netdev_free:
hns3_dbg_uninit(handle);
+ mutex_destroy(&handle->dbg_mutex);
free_netdev(netdev);
}
@@ -5819,6 +5880,7 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle)
return 0;
}
+ guard(mutex)(&handle->dbg_mutex);
hns3_free_rx_cpu_rmap(netdev);
hns3_nic_uninit_irq(priv);
hns3_clear_all_ring(handle, true);
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
index 933e3527ed824..27a09629cbcab 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
@@ -449,6 +449,7 @@ struct ring_stats {
u64 non_reuse_pg;
u64 frag_alloc_err;
u64 frag_alloc;
+ u64 rx_oom_cnt;
};
__le16 csum;
};
@@ -585,6 +586,8 @@ struct hns3_nic_priv {
struct hns3_enet_tqp_vector *tqp_vector;
u16 vector_num;
u8 max_non_tso_bd_num;
+ struct delayed_work oom_task;
+ unsigned long *oom_vector_bm;
u64 tx_timeout_count;
@@ -711,6 +714,20 @@ static inline unsigned int hns3_page_order(struct hns3_enet_ring *ring)
#define hns3_rl_usec_to_reg(int_rl) ((int_rl) >> 2)
#define hns3_rl_round_down(int_rl) round_down(int_rl, 4)
+static inline void hns3_ring_set_oom_state(struct hns3_enet_ring *ring)
+{
+ struct hns3_nic_priv *priv = netdev_priv(ring_to_netdev(ring));
+
+ set_bit(ring->tqp_vector->idx, priv->oom_vector_bm);
+}
+
+static inline bool hns3_ring_is_oom_state(struct hns3_enet_ring *ring)
+{
+ struct hns3_nic_priv *priv = netdev_priv(ring_to_netdev(ring));
+
+ return test_bit(ring->tqp_vector->idx, priv->oom_vector_bm);
+}
+
void hns3_ethtool_set_ops(struct net_device *netdev);
int hns3_set_channels(struct net_device *netdev,
struct ethtool_channels *ch);
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
index e7318f2363157..4e7a7e6b21ee3 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
@@ -62,6 +62,7 @@ static const struct hns3_stats hns3_rxq_stats[] = {
HNS3_TQP_STAT("non_reuse_pg", non_reuse_pg),
HNS3_TQP_STAT("frag_alloc_err", frag_alloc_err),
HNS3_TQP_STAT("frag_alloc", frag_alloc),
+ HNS3_TQP_STAT("rx_oom_cnt", rx_oom_cnt),
};
#define HNS3_PRIV_FLAGS_LEN ARRAY_SIZE(hns3_priv_flags)
@@ -1257,6 +1258,7 @@ static int hns3_set_ringparam(struct net_device *ndev,
if (if_running)
ndev->netdev_ops->ndo_stop(ndev);
+ guard(mutex)(&h->dbg_mutex);
hns3_change_all_ring_bd_num(priv, new_ringparam.tx_desc_num,
new_ringparam.rx_desc_num);
hns3_change_rx_buf_len(ndev, new_ringparam.rx_buf_len);
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
index 9a4e29bfa1666..1e9d3e08b7ded 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_debugfs.c
@@ -15,6 +15,12 @@
#define hclge_seq_file_to_hdev(s) \
(((struct hnae3_ae_dev *)hnae3_seq_file_to_ae_dev(s))->priv)
+static bool hclge_dbg_is_device_busy(struct hclge_dev *hdev)
+{
+ return test_bit(HCLGE_STATE_RST_HANDLING, &hdev->state) ||
+ test_bit(HCLGE_STATE_RST_FAIL, &hdev->state);
+}
+
static const char * const hclge_mac_state_str[] = {
"TO_ADD", "TO_DEL", "ACTIVE"
};
@@ -2621,6 +2627,10 @@ static int hclge_dbg_dump_umv_info(struct seq_file *s, void *data)
struct hclge_vport *vport;
u8 i;
+ guard(mutex)(&hdev->vport[0].nic.dbg_mutex);
+ if (hclge_dbg_is_device_busy(hdev))
+ return -EBUSY;
+
seq_printf(s, "num_alloc_vport : %u\n", hdev->num_alloc_vport);
seq_printf(s, "max_umv_size : %u\n", hdev->max_umv_size);
seq_printf(s, "wanted_umv_size : %u\n", hdev->wanted_umv_size);
@@ -2831,6 +2841,10 @@ static int hclge_dbg_dump_vlan_offload_config(struct hclge_dev *hdev,
int ret;
u8 i;
+ guard(mutex)(&hdev->vport[0].nic.dbg_mutex);
+ if (hclge_dbg_is_device_busy(hdev))
+ return -EBUSY;
+
seq_puts(s, "FUNC_ID PVID ACCEPT_TAG1 ACCEPT_TAG2 ACCEPT_UNTAG1 ");
seq_puts(s, "ACCEPT_UNTAG2 INSERT_TAG1 INSERT_TAG2 SHIFT_TAG ");
seq_puts(s, "STRIP_TAG1 STRIP_TAG2 DROP_TAG1 DROP_TAG2 ");
|
| 3/2 | 2026/09/15 18:38 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 10484 output: 34 thoughts: 237 Thoughts: **Initial Assessment of a Network Driver Patch** Okay, so I've been asked to dig into a patch series that landed at HEAD. My first instinct, as always, is to get a solid grasp of what's been changed. The request specifies we're looking at network driver code, which means I'll need to pay close attention to the implications for overall network performance and stability. My initial approach will be a file-by-file inspection of the modified code. I see a listing of files: `hnae3.h`, `hns3_debugfs.c`, `hns3_enet.c`, `hns3_enet.h`, `hns3_ethtool.c`, and `hclge_debugfs.c`. A quick scan of these file names immediately gives a hint of the functional areas impacted. The inclusion of `hisilicon/hns3` immediately triggers a search in my mental database. I need to refresh myself, "What exactly is `hisilicon/hns3`? Is this a driver for a specific hardware platform? Is this a new subsystem?" Before I spend too much time, I'll hit `Kconfig` or similar configuration files in the relevant directories to get a quick overview of what this module represents. A quick `grepper` call or a simple file system browse should clarify the purpose and scope of this code, ensuring that I have the proper context. |
| 4/2 | 2026/09/15 18:38 | tool | grepper |
0mArgs:{
"Expression": "config HNS3",
"PathPrefix": "drivers/net/ethernet/hisilicon"
}Results: {
"Output": "drivers/net/ethernet/hisilicon/Kconfig=83=config HNS_ENET\n--\ndrivers/net/ethernet/hisilicon/Kconfig-90-\ndrivers/net/ethernet/hisilicon/Kconfig:91:config HNS3\ndrivers/net/ethernet/hisilicon/Kconfig-92-\ttristate \"Hisilicon Network Subsystem Support HNS3 (Framework)\"\n--\ndrivers/net/ethernet/hisilicon/Kconfig=102=if HNS3\ndrivers/net/ethernet/hisilicon/Kconfig-103-\ndrivers/net/ethernet/hisilicon/Kconfig:104:config HNS3_HCLGE\ndrivers/net/ethernet/hisilicon/Kconfig-105-\ttristate \"Hisilicon HNS3 HCLGE Acceleration Engine \u0026 Compatibility Layer Support\"\n--\ndrivers/net/ethernet/hisilicon/Kconfig-113-\ndrivers/net/ethernet/hisilicon/Kconfig:114:config HNS3_DCB\ndrivers/net/ethernet/hisilicon/Kconfig-115-\tbool \"Hisilicon HNS3 Data Center Bridge Support\"\n--\ndrivers/net/ethernet/hisilicon/Kconfig-122-\ndrivers/net/ethernet/hisilicon/Kconfig:123:config HNS3_HCLGEVF\ndrivers/net/ethernet/hisilicon/Kconfig-124-\ttristate \"Hisilicon HNS3VF Acceleration Engine \u0026 Compatibility Layer Support\"\n--\ndrivers/net/ethernet/hisilicon/Kconfig-131-\ndrivers/net/ethernet/hisilicon/Kconfig:132:config HNS3_ENET\ndrivers/net/ethernet/hisilicon/Kconfig-133-\ttristate \"Hisilicon HNS3 Ethernet Device Support\"\n"
} |
| 5/2 | 2026/09/15 18:38 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 11532 output: 40 thoughts: 27 Thoughts: Here's my summary, as if I were thinking these thoughts: **Examining the Hisilicon Ethernet Driver Configuration** Okay, let's dive in. I need to get a handle on the configuration options for this Hisilicon Ethernet driver. Specifically, I should probably check around lines 80 to 140 of `drivers/net/ethernet/hisilicon/Kconfig`. That's where I usually find the core configuration options are defined. I'm expecting to see things like platform dependencies, feature flags for specific silicon revisions, maybe even the various PHY options or DMA settings if we're lucky. I should be looking for dependencies, default values, and the conditions under which these options are enabled. I'll mentally map these options to the broader system architecture. I anticipate there might be some conditional logic depending on the specific hardware being targeted and any related power management settings too. |
| 6/2 | 2026/09/15 18:39 | tool | read-file |
0mArgs:{
"File": "drivers/net/ethernet/hisilicon/Kconfig",
"FirstLine": 80,
"LineCount": 60
}Results: {
"Contents": " 80:\t\t acceleration engine support. The engine is used in Hisilicon hip05,\n 81:\t\t Hi1610 and further ICT SoC\n 82:\t\n 83:\tconfig HNS_ENET\n 84:\t\ttristate \"Hisilicon HNS Ethernet Device Support\"\n 85:\t\tselect PHYLIB\n 86:\t\tselect HNS\n 87:\t\thelp\n 88:\t\t This selects the general ethernet driver for HNS. This module make\n 89:\t\t use of any HNS AE driver, such as HNS_DSAF\n 90:\t\n 91:\tconfig HNS3\n 92:\t\ttristate \"Hisilicon Network Subsystem Support HNS3 (Framework)\"\n 93:\t\tdepends on PCI\n 94:\t\tselect NET_DEVLINK\n 95:\t\tselect PAGE_POOL\n 96:\t\thelp\n 97:\t\t This selects the framework support for Hisilicon Network Subsystem 3.\n 98:\t\t This layer facilitates clients like ENET, RoCE and user-space ethernet\n 99:\t\t drivers(like ODP)to register with HNAE devices and their associated\n 100:\t\t operations.\n 101:\t\n 102:\tif HNS3\n 103:\t\n 104:\tconfig HNS3_HCLGE\n 105:\t\ttristate \"Hisilicon HNS3 HCLGE Acceleration Engine \u0026 Compatibility Layer Support\"\n 106:\t\tdefault m\n 107:\t\tdepends on PCI_MSI\n 108:\t\tdepends on PTP_1588_CLOCK_OPTIONAL\n 109:\t\thelp\n 110:\t\t This selects the HNS3_HCLGE network acceleration engine \u0026 its hardware\n 111:\t\t compatibility layer. The engine would be used in Hisilicon hip08 family of\n 112:\t\t SoCs and further upcoming SoCs.\n 113:\t\n 114:\tconfig HNS3_DCB\n 115:\t\tbool \"Hisilicon HNS3 Data Center Bridge Support\"\n 116:\t\tdefault n\n 117:\t\tdepends on HNS3_HCLGE \u0026\u0026 DCB\n 118:\t\thelp\n 119:\t\t Say Y here if you want to use Data Center Bridging (DCB) in the HNS3 driver.\n 120:\t\n 121:\t\t If unsure, say N.\n 122:\t\n 123:\tconfig HNS3_HCLGEVF\n 124:\t\ttristate \"Hisilicon HNS3VF Acceleration Engine \u0026 Compatibility Layer Support\"\n 125:\t\tdepends on PCI_MSI\n 126:\t\tdepends on HNS3_HCLGE\n 127:\t\thelp\n 128:\t\t This selects the HNS3 VF drivers network acceleration engine \u0026 its hardware\n 129:\t\t compatibility layer. The engine would be used in Hisilicon hip08 family of\n 130:\t\t SoCs and further upcoming SoCs.\n 131:\t\n 132:\tconfig HNS3_ENET\n 133:\t\ttristate \"Hisilicon HNS3 Ethernet Device Support\"\n 134:\t\tdefault m\n 135:\t\tdepends on 64BIT \u0026\u0026 PCI\n 136:\t\tdepends on INET\n 137:\t\tselect DIMLIB\n 138:\t\thelp\n 139:\t\t This selects the Ethernet Driver for Hisilicon Network Subsystem 3 for hip08\n"
} |
| 7/2 | 2026/09/15 18:39 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 12679 output: 38 thoughts: 80 Thoughts: Okay, let's break this down. **Investigating the Hardware Compatibility of HNS3** Right, so I need to figure out what kind of hardware the HNS3 driver actually targets. Let's start with the basics. What's the target hardware platform? The description mentions "Ethernet Driver for Hisilicon Network Subsystem 3 for hip08 family of SoCs and further upcoming SoCs". Okay, that narrows it down to Hisilicon SoCs, specifically the "hip08" family and future ones. But is this a strictly physical PCI device, or something else, directly on the System-on-Chip? Given that it's a "Network Subsystem," it's probably integrated. To confirm this, I should dig into the driver's code, specifically the `hns3_pci_tbl` or a similar PCI ID table. That table should contain the PCI identifiers that the driver recognizes. If it's there, I can confirm it's a PCI device, if it's not, it's very likely an integrated peripheral on a Hisilicon SoC, requiring a different probing method, or potentially a device tree match. |
| 8/2 | 2026/09/15 18:39 | tool | grepper |
0mArgs:{
"Expression": "hns3_pci_tbl",
"PathPrefix": "drivers/net/ethernet/hisilicon"
}Results: {
"Output": "drivers/net/ethernet/hisilicon/hns3/hns3_enet.c=65=module_param(page_pool_enabled, bool, 0400);\n--\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c-82-\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c:83:/* hns3_pci_tbl - PCI Device ID Table\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c-84- *\n--\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c-89- */\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c:90:static const struct pci_device_id hns3_pci_tbl[] = {\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c-91-\t{\n--\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c-124-};\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c:125:MODULE_DEVICE_TABLE(pci, hns3_pci_tbl);\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c-126-\n--\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c=3128=static void hns3_disable_sriov(struct pci_dev *pdev)\n--\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c-3144- * @pdev: PCI device information struct\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c:3145: * @ent: entry in hns3_pci_tbl\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c-3146- *\n--\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c=3355=static struct pci_driver hns3_driver = {\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c-3356-\t.name = hns3_driver_name,\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c:3357:\t.id_table = hns3_pci_tbl,\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c-3358-\t.probe = hns3_probe,\n"
} |
| 9/2 | 2026/09/15 18:39 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 13746 output: 49 thoughts: 40 Thoughts: Here's a summary of my thought process, as requested: **Diving into the HNS3 PCI Table** Okay, so I need to understand how the HNS3 Ethernet driver is handling PCI device configuration. My instinct is to start by looking at the device table. I'll need to double-check those entries. Let's start with `hns3_pci_tbl`. That table should be declared in the `drivers/net/ethernet/hisilicon/hns3/hns3_enet.c` file. Hopefully, it's well-commented. I want to see how they're matching PCI IDs and what the default settings or driver-specific data are for each supported device. I'm hoping to get a clear picture of their PCI device matching and initialization strategies right away. |
| 10/2 | 2026/09/15 18:39 | tool | read-file |
0mArgs:{
"File": "drivers/net/ethernet/hisilicon/hns3/hns3_enet.c",
"FirstLine": 85,
"LineCount": 45
}Results: {
"Contents": " 85:\t * Last entry must be all 0s\n 86:\t *\n 87:\t * { Vendor ID, Device ID, SubVendor ID, SubDevice ID,\n 88:\t * Class, Class Mask, private data (not used) }\n 89:\t */\n 90:\tstatic const struct pci_device_id hns3_pci_tbl[] = {\n 91:\t\t{\n 92:\t\t\tPCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_GE),\n 93:\t\t\t.driver_data = 0,\n 94:\t\t}, {\n 95:\t\t\tPCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_25GE),\n 96:\t\t\t.driver_data = 0,\n 97:\t\t}, {\n 98:\t\t\tPCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_25GE_RDMA),\n 99:\t\t\t.driver_data = HNAE3_DEV_SUPPORT_ROCE_DCB_BITS,\n 100:\t\t}, {\n 101:\t\t\tPCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_25GE_RDMA_MACSEC),\n 102:\t\t\t.driver_data = HNAE3_DEV_SUPPORT_ROCE_DCB_BITS,\n 103:\t\t}, {\n 104:\t\t\tPCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_50GE_RDMA),\n 105:\t\t\t.driver_data = HNAE3_DEV_SUPPORT_ROCE_DCB_BITS,\n 106:\t\t}, {\n 107:\t\t\tPCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_50GE_RDMA_MACSEC),\n 108:\t\t\t.driver_data = HNAE3_DEV_SUPPORT_ROCE_DCB_BITS,\n 109:\t\t}, {\n 110:\t\t\tPCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_100G_RDMA_MACSEC),\n 111:\t\t\t.driver_data = HNAE3_DEV_SUPPORT_ROCE_DCB_BITS,\n 112:\t\t}, {\n 113:\t\t\tPCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_200G_RDMA),\n 114:\t\t\t.driver_data = HNAE3_DEV_SUPPORT_ROCE_DCB_BITS,\n 115:\t\t}, {\n 116:\t\t\tPCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_VF),\n 117:\t\t\t.driver_data = 0,\n 118:\t\t}, {\n 119:\t\t\tPCI_VDEVICE(HUAWEI, HNAE3_DEV_ID_RDMA_DCB_PFC_VF),\n 120:\t\t\t.driver_data = HNAE3_DEV_SUPPORT_ROCE_DCB_BITS,\n 121:\t\t},\n 122:\t\t/* required last entry */\n 123:\t\t{ }\n 124:\t};\n 125:\tMODULE_DEVICE_TABLE(pci, hns3_pci_tbl);\n 126:\t\n 127:\t#define HNS3_RX_PTYPE_ENTRY(ptype, l, s, t, h) \\\n 128:\t\t{\tptype, \\\n 129:\t\t\tl, \\\n"
} |
| 11/2 | 2026/09/15 18:39 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 14884 output: 39 thoughts: 376 Thoughts: **My Assessment of WorthFuzzing for Huawei HNS3 NICs** Okay, so I'm looking at these Huawei HNS3 NICs, specifically the PCIe network cards from HiSilicon and Huawei. We're talking about various speeds here, GE, 25GE, all the way up to 200G and VFs. The instructions tell me when NOT to fuzz, the negative criteria. Let's see... section 2... and here are the reasons. The key thing that jumps out is the "Structurally unreachable hardware" category. Specifically, it mentions vendor-specific PCIe switches, SmartNICs, and GPU drivers requiring physical ASICs or PCIe cards *not* emulated in standard QEMU. That's a red flag! Now, does HNS3 fall into this trap? My experience says it does. QEMU doesn't emulate Hisilicon HNS3 NICs. We're talking about bare metal hardware here. Standard virtual environments like GCE or the standard QEMU setup use e1000, virtio-net, rtl8139, etc., not anything close to these Huawei HNS3 devices. Let's quickly verify that there's no soft or virtual driver or netdev simulation for HNS3. No point in spending time on it if there's no path to trigger functionality in a fuzzer. Let me check if there are any mock or virtual devices that might use hnae3 or hns3. |
| 12/2 | 2026/09/15 18:39 | tool | grepper |
0mArgs:{
"Expression": "hnae3_register_ae_algo",
"PathPrefix": "drivers/net/ethernet/hisilicon"
}Results: {
"Output": "drivers/net/ethernet/hisilicon/hns3/hnae3.c=210=EXPORT_SYMBOL(hnae3_unregister_client);\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c-211-\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c:212:/* hnae3_register_ae_algo - register a AE algorithm to hnae3 framework\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c-213- * @ae_algo: AE algorithm\n--\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c-215- */\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c:216:void hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo)\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c-217-{\n--\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c-265-}\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c:266:EXPORT_SYMBOL(hnae3_register_ae_algo);\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c-267-\n--\ndrivers/net/ethernet/hisilicon/hns3/hnae3.h=986=void hnae3_unregister_ae_algo(struct hnae3_ae_algo *ae_algo);\ndrivers/net/ethernet/hisilicon/hns3/hnae3.h:987:void hnae3_register_ae_algo(struct hnae3_ae_algo *ae_algo);\ndrivers/net/ethernet/hisilicon/hns3/hnae3.h-988-\n--\ndrivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c=10717=static int __init hclge_init(void)\n--\ndrivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c-10727-\ndrivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c:10728:\thnae3_register_ae_algo(\u0026ae_algo);\ndrivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c-10729-\n--\ndrivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c=3409=static int __init hclgevf_init(void)\n--\ndrivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c-3418-\ndrivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c:3419:\thnae3_register_ae_algo(\u0026ae_algovf);\ndrivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c-3420-\n"
} |
| 13/2 | 2026/09/15 18:39 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 16444 output: 39 thoughts: 36 Thoughts: **My Current Investigative Path** Okay, so I'm digging into this code and I've zeroed in on the registration of these `ae_algo` things. It looks like, according to the code I've been looking at, only `hclge_main.c` and `hclgevf_main.c` are actually taking on the registration duty for `ae_algo`. That's a good starting point, narrows down the potential areas I need to be concerned with, or consider. Now, though, I'm thinking about the registration of `ae_dev`. Where exactly is *that* happening? The registration of these devices is crucial, of course. Time to switch gears and see which module(s) are responsible for that registration. I need to track down the responsible code for that and start digging through it. Let’s do a quick search. |
| 14/2 | 2026/09/15 18:39 | tool | grepper |
0mArgs:{
"Expression": "hnae3_register_ae_dev",
"PathPrefix": "drivers/net/ethernet/hisilicon"
}Results: {
"Output": "drivers/net/ethernet/hisilicon/hns3/hnae3.c=304=EXPORT_SYMBOL(hnae3_unregister_ae_algo);\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c-305-\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c:306:/* hnae3_register_ae_dev - registers a AE device to hnae3 framework\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c-307- * @ae_dev: the AE device\n--\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c-309- */\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c:310:int hnae3_register_ae_dev(struct hnae3_ae_dev *ae_dev)\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c-311-{\n--\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c-369-}\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c:370:EXPORT_SYMBOL(hnae3_register_ae_dev);\ndrivers/net/ethernet/hisilicon/hns3/hnae3.c-371-\n--\ndrivers/net/ethernet/hisilicon/hns3/hnae3.h=973=static inline void hnae3_format_mac_addr(char *format_mac_addr,\n--\ndrivers/net/ethernet/hisilicon/hns3/hnae3.h-981-\ndrivers/net/ethernet/hisilicon/hns3/hnae3.h:982:int hnae3_register_ae_dev(struct hnae3_ae_dev *ae_dev);\ndrivers/net/ethernet/hisilicon/hns3/hnae3.h-983-void hnae3_unregister_ae_dev(struct hnae3_ae_dev *ae_dev);\n--\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c=3153=static int hns3_probe(struct pci_dev *pdev, const struct pci_device_id *ent)\n--\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c-3165-\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c:3166:\tret = hnae3_register_ae_dev(ae_dev);\ndrivers/net/ethernet/hisilicon/hns3/hns3_enet.c-3167-\tif (ret)\n"
} |
| 15/2 | 2026/09/15 18:39 | llm | patch-evaluator |
0mModel:gemini-3.8-flash Args: null Results: null Tokens: input: 17411 output: 132 thoughts: 799 Thoughts: **Analysis of the Huawei HNS3 Ethernet Driver Patch** Okay, so I'm looking at this patch and immediately, my expert eye hones in on the `hns3_probe` function. That's the PCI device probe function for the `hns3_driver`, which is a `pci_driver` specifically binding to Huawei PCIe devices. I can see the vendor ID is `PCI_VENDOR_ID_HUAWEI` (0x19e5) and the device IDs include things like `HNAE3_DEV_ID_GE`. These are definitely Huawei HiSilicon HNS3 network devices. The modified files listed – `hnae3.h`, `hns3_debugfs.c`, `hns3_enet.c`, `hns3_enet.h`, `hns3_ethtool.c`, and `hclge_debugfs.c` – all reside within `drivers/net/ethernet/hisilicon/hns3/`. That's a very specific path, screaming "Huawei HiSilicon HNS3 driver." So this is a focused set of changes within a dedicated driver. Now, my experience tells me that these types of NICs, these Huawei HiSilicon HNS3 hardware devices, are *not* emulated in standard environments like QEMU or GCE. The instructions explicitly say that vendor-specific PCIe switches, SmartNICs, etc., are structurally unreachable if they require physical hardware that isn't emulated. This falls squarely into that category. To be completely sure, I'd usually check the `git log` or `git diff HEAD~1..HEAD` to confirm that the changes *only* touch the `drivers/net/ethernet/hisilicon/hns3/` directory. But the prompt already confirms that, so I'm not worried. Therefore, this code is *structurally unreachable* for syzkaller. There's no way to trigger these changes within the common test environment. So, the conclusion is clear: * `WorthFuzzing` must be `false`. * `FocusSymbols` should be an empty list `[]`. * `EnableConfigs` should be an empty list `[]`. * `Reasoning` should explain that the patch modifies the Huawei/Hisilicon HNS3 Ethernet driver and its debugfs/ring handling, which requires physical HiSilicon PCIe network hardware not emulated in standard virtualized environments (QEMU/GCE), making the code structurally unreachable for syzkaller. Let me sanity-check those parameters before calling `set-results`: * `WorthFuzzing: false` - Correct. * `FocusSymbols: []` - Correct. * `EnableConfigs: []` - Correct. * `Reasoning: "..."` - Time to set it up as a detailed text and submit it. Okay, ready to call `set-results`. |
| 16/2 | 2026/09/15 18:39 | tool | set-results |
0mArgs:{
"EnableConfigs": [],
"FocusSymbols": [],
"Reasoning": "The changes exclusively modify the HiSilicon Network Subsystem 3 (HNS3) ethernet driver (drivers/net/ethernet/hisilicon/hns3/), including debugfs handling and OOM work scheduling for HNS3 rings. This driver requires proprietary HiSilicon PCIe network hardware (e.g., hip08 SoC family) that is not emulated in standard virtualized environments (QEMU/GCE), making the modified code structurally unreachable for syzkaller fuzzing.",
"WorthFuzzing": false
}Results: {
"EnableConfigs": null,
"FocusSymbols": [],
"Reasoning": "The changes exclusively modify the HiSilicon Network Subsystem 3 (HNS3) ethernet driver (drivers/net/ethernet/hisilicon/hns3/), including debugfs handling and OOM work scheduling for HNS3 rings. This driver requires proprietary HiSilicon PCIe network hardware (e.g., hip08 SoC family) that is not emulated in standard virtualized environments (QEMU/GCE), making the modified code structurally unreachable for syzkaller fuzzing.",
"WorthFuzzing": false
} |
| 17/1 | 2026/09/15 18:39 | 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) |
|---|