AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/09/29 05:17 flow patch-triage
0m Args:
null

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "KMSANReasoning": "",
  "NeedsKMSAN": false,
  "Reasoning": "The patch modifies the Marvell OcteonTX2 RVU (Resource Virtualization Unit) driver under drivers/net/ethernet/marvell/octeontx2/. This is vendor-specific SmartNIC / network processor hardware requiring physical PCIe devices (PCI_VENDOR_ID_CAVIUM) not emulated in standard QEMU or GCE virtualized environments, making the modified code structurally unreachable for fuzzing.",
  "WorthFuzzing": false
}

1/1 2026/09/29 05:17 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit b61ee6c366e792f8cde61545680b4a54797688b6\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Tue Sep 29 05:17:57 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h\nindex cece197d1074b..d114faeba1bbf 100644\n--- a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h\n+++ b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h\n@@ -1777,10 +1777,12 @@ struct ptp_get_cap_rsp {\n \tu64 cap;\n };\n \n+#define RVU_MAX_REP\t64\n+\n struct get_rep_cnt_rsp {\n \tstruct mbox_msghdr hdr;\n \tu16 rep_cnt;\n-\tu16 rep_pf_map[64];\n+\tu16 rep_pf_map[RVU_MAX_REP];\n \tu64 rsvd;\n };\n \ndiff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c\nindex 937b085582b5f..baba564259436 100644\n--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c\n+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c\n@@ -3555,9 +3555,26 @@ static void rvu_update_module_params(struct rvu *rvu)\n \n static atomic_t device_bound = ATOMIC_INIT(0);\n \n+static struct workqueue_struct *rvu_rep_evtq_disable(struct rvu *rvu)\n+{\n+\tstruct workqueue_struct *rep_wq;\n+\n+\tmutex_lock(\u0026rvu-\u003ersrc_lock);\n+\tWRITE_ONCE(rvu-\u003erep_evt_teardown, true);\n+\trep_wq = rvu-\u003erep_evt_wq;\n+\tWRITE_ONCE(rvu-\u003erep_evt_wq, NULL);\n+\tmutex_unlock(\u0026rvu-\u003ersrc_lock);\n+\n+\tif (rep_wq)\n+\t\tflush_workqueue(rep_wq);\n+\n+\treturn rep_wq;\n+}\n+\n static int rvu_probe(struct pci_dev *pdev, const struct pci_device_id *id)\n {\n \tstruct device *dev = \u0026pdev-\u003edev;\n+\tstruct workqueue_struct *rep_wq;\n \tstruct rvu *rvu;\n \tint    err;\n \n@@ -3686,7 +3703,18 @@ static int rvu_probe(struct pci_dev *pdev, const struct pci_device_id *id)\n err_dl:\n \trvu_unregister_dl(rvu);\n err_irq:\n+\t/*\n+\t * GET_REP_CNT may have allocated rep_evt_wq before this failure.\n+\t * Drain it before unregistering interrupts.\n+\t */\n+\trep_wq = rvu_rep_evtq_disable(rvu);\n+\n \trvu_unregister_interrupts(rvu);\n+\n+\tif (rep_wq) {\n+\t\tflush_workqueue(rvu-\u003eafpf_wq_info.mbox_wq);\n+\t\tdestroy_workqueue(rep_wq);\n+\t}\n err_flr:\n \trvu_flr_wq_destroy(rvu);\n err_mbox:\n@@ -3715,12 +3743,25 @@ static int rvu_probe(struct pci_dev *pdev, const struct pci_device_id *id)\n \n static void rvu_remove(struct pci_dev *pdev)\n {\n+\tstruct workqueue_struct *rep_wq;\n \tstruct rvu *rvu = pci_get_drvdata(pdev);\n \n \trvu_dbg_exit(rvu);\n \trvu_unregister_dl(rvu);\n+\n+\t/* Block get_rep_cnt() from allocating a new rep_evt_wq. */\n+\trep_wq = rvu_rep_evtq_disable(rvu);\n+\n \trvu_unregister_interrupts(rvu);\n \trvu_flr_wq_destroy(rvu);\n+\n+\t/* Flush both mbox workqueues before destroying rep_wq. */\n+\tflush_workqueue(rvu-\u003eafpf_wq_info.mbox_wq);\n+\tif (rvu-\u003eafvf_wq_info.mbox_wq)\n+\t\tflush_workqueue(rvu-\u003eafvf_wq_info.mbox_wq);\n+\tif (rep_wq)\n+\t\tdestroy_workqueue(rep_wq);\n+\n \trvu_cgx_exit(rvu);\n \trvu_fwdata_exit(rvu);\n \trvu_mcs_exit(rvu);\ndiff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h\nindex 094227404ef9f..04a2bc36fbbe5 100644\n--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h\n+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h\n@@ -571,7 +571,7 @@ struct npc_kpu_profile_adapter {\n #define RVU_SWITCH_LBK_CHAN\t63\n \n struct rvu_switch {\n-\tstruct mutex switch_lock; /* Serialize flow installation */\n+\tstruct mutex switch_lock; /* Serialize flow installation and entry2pcifunc access */\n \tu32 used_entries;\n \tu16 *entry2pcifunc;\n \tu16 mode;\n@@ -675,6 +675,7 @@ struct rvu {\n \tstruct list_head\trep_evtq_head;\n \t/* Representor event lock */\n \tspinlock_t\t\trep_evtq_lock;\n+\tbool\t\t\trep_evt_teardown;\n \n \tstruct ng_rvu           *ng_rvu;\n };\ndiff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c\nindex a2781e0f504e3..4c4171515d743 100644\n--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c\n+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c\n@@ -44,7 +44,16 @@ static int rvu_rep_up_notify(struct rvu *rvu, struct rep_event *event)\n \tif (event-\u003eevent \u0026 RVU_EVENT_MAC_ADDR_CHANGE)\n \t\tether_addr_copy(pfvf-\u003emac_addr, event-\u003eevt_data.mac);\n \n+\tif (event-\u003eevent \u0026 RVU_EVENT_PFVF_STATE)\n+\t\tpf = rvu_get_pf(rvu-\u003epdev, event-\u003ehdr.pcifunc);\n+\n \tmutex_lock(\u0026rvu-\u003embox_lock);\n+\n+\tif (!READ_ONCE(rvu-\u003erep_mode)) {\n+\t\tmutex_unlock(\u0026rvu-\u003embox_lock);\n+\t\treturn -ENODEV;\n+\t}\n+\n \tmsg = otx2_mbox_alloc_msg_rep_event_up_notify(rvu, pf);\n \tif (!msg) {\n \t\tmutex_unlock(\u0026rvu-\u003embox_lock);\n@@ -53,6 +62,10 @@ static int rvu_rep_up_notify(struct rvu *rvu, struct rep_event *event)\n \n \tmsg-\u003ehdr.pcifunc = event-\u003epcifunc;\n \tmsg-\u003eevent = event-\u003eevent;\n+\tmsg-\u003epcifunc = event-\u003epcifunc;\n+\n+\tif (event-\u003eevent \u0026 RVU_EVENT_PFVF_STATE)\n+\t\tmsg-\u003ehdr.pcifunc = event-\u003ehdr.pcifunc;\n \n \tmemcpy(\u0026msg-\u003eevt_data, \u0026event-\u003eevt_data, sizeof(struct rep_evt_data));\n \n@@ -87,7 +100,12 @@ static void rvu_rep_wq_handler(struct work_struct *work)\n \n \t\tevent = \u0026qentry-\u003eevent;\n \n-\t\trvu_rep_up_notify(rvu, event);\n+\t\t/* Once teardown has started the AF-PF mbox interrupt may\n+\t\t * already be disabled, so sending would just block until\n+\t\t * otx2_mbox_wait_for_rsp() times out. Drop the event instead.\n+\t\t */\n+\t\tif (!READ_ONCE(rvu-\u003erep_evt_teardown))\n+\t\t\trvu_rep_up_notify(rvu, event);\n \t\tkfree(qentry);\n \t} while (1);\n }\n@@ -95,55 +113,71 @@ static void rvu_rep_wq_handler(struct work_struct *work)\n int rvu_mbox_handler_rep_event_notify(struct rvu *rvu, struct rep_event *req,\n \t\t\t\t      struct msg_rsp *rsp)\n {\n+\tstruct workqueue_struct *wq;\n \tstruct rep_evtq_ent *qentry;\n \n-\t/* The mailbox dispatcher normalises only the header pcifunc; the\n-\t * nested struct rep_event::pcifunc body field is sender-controlled\n-\t * and is later used by rvu_rep_up_notify() to index rvu-\u003epf[] /\n-\t * rvu-\u003ehwvf[].  Reject out-of-range body selectors before queueing.\n-\t */\n+\twq = smp_load_acquire(\u0026rvu-\u003erep_evt_wq);\n+\tif (!wq)\n+\t\treturn -EINVAL;\n+\n+\t/* Only the registered representor PF may send REP_EVENT_NOTIFY. */\n+\tif (req-\u003ehdr.pcifunc != rvu-\u003erep_pcifunc)\n+\t\treturn -EPERM;\n+\n \tif (!is_pf_func_valid(rvu, req-\u003epcifunc))\n \t\treturn -EINVAL;\n \n+\t/* Only CGX-mapped PFs are present in the representor map. */\n+\tif (!is_pf_cgxmapped(rvu, rvu_get_pf(rvu-\u003epdev, req-\u003epcifunc)))\n+\t\treturn -EINVAL;\n+\n+\tif ((req-\u003eevent \u0026 RVU_EVENT_PFVF_STATE) \u0026\u0026\n+\t    rvu_get_pf(rvu-\u003epdev, req-\u003ehdr.pcifunc) \u003e= rvu-\u003ehw-\u003etotal_pfs)\n+\t\treturn -EINVAL;\n+\n \tqentry = kmalloc_obj(*qentry, GFP_ATOMIC);\n \tif (!qentry)\n \t\treturn -ENOMEM;\n \n \tqentry-\u003eevent = *req;\n \tspin_lock(\u0026rvu-\u003erep_evtq_lock);\n+\tif (!rvu-\u003erep_mode) {\n+\t\tspin_unlock(\u0026rvu-\u003erep_evtq_lock);\n+\t\tkfree(qentry);\n+\t\treturn -ENODEV;\n+\t}\n \tlist_add_tail(\u0026qentry-\u003enode, \u0026rvu-\u003erep_evtq_head);\n \tspin_unlock(\u0026rvu-\u003erep_evtq_lock);\n-\tqueue_work(rvu-\u003erep_evt_wq, \u0026rvu-\u003erep_evt_work);\n+\n+\tqueue_work(wq, \u0026rvu-\u003erep_evt_work);\n \treturn 0;\n }\n \n-int rvu_rep_notify_pfvf_state(struct rvu *rvu, u16 pcifunc, bool enable)\n+static void rvu_rep_evtq_drain(struct rvu *rvu)\n {\n-\tstruct rep_event *req;\n-\tint pf;\n-\n-\tif (!is_pf_cgxmapped(rvu, rvu_get_pf(rvu-\u003epdev, pcifunc)))\n-\t\treturn 0;\n-\n-\tpf = rvu_get_pf(rvu-\u003epdev, rvu-\u003erep_pcifunc);\n+\tstruct rep_evtq_ent *qentry;\n \n-\tmutex_lock(\u0026rvu-\u003embox_lock);\n-\treq = otx2_mbox_alloc_msg_rep_event_up_notify(rvu, pf);\n-\tif (!req) {\n-\t\tmutex_unlock(\u0026rvu-\u003embox_lock);\n-\t\treturn -ENOMEM;\n+\twhile (!list_empty(\u0026rvu-\u003erep_evtq_head)) {\n+\t\tqentry = list_first_entry(\u0026rvu-\u003erep_evtq_head,\n+\t\t\t\t\t  struct rep_evtq_ent, node);\n+\t\tlist_del(\u0026qentry-\u003enode);\n+\t\tkfree(qentry);\n \t}\n+}\n \n-\treq-\u003ehdr.pcifunc = rvu-\u003erep_pcifunc;\n-\treq-\u003eevent |= RVU_EVENT_PFVF_STATE;\n-\treq-\u003epcifunc = pcifunc;\n-\treq-\u003eevt_data.vf_state = enable;\n+int rvu_rep_notify_pfvf_state(struct rvu *rvu, u16 pcifunc, bool enable)\n+{\n+\tstruct rep_event req = { 0 };\n+\tstruct msg_rsp rsp;\n \n-\totx2_mbox_wait_for_zero(\u0026rvu-\u003eafpf_wq_info.mbox_up, pf);\n-\totx2_mbox_msg_send_up(\u0026rvu-\u003eafpf_wq_info.mbox_up, pf);\n+\tif (!is_pf_cgxmapped(rvu, rvu_get_pf(rvu-\u003epdev, pcifunc)))\n+\t\treturn 0;\n \n-\tmutex_unlock(\u0026rvu-\u003embox_lock);\n-\treturn 0;\n+\treq.hdr.pcifunc = rvu-\u003erep_pcifunc;\n+\treq.event = RVU_EVENT_PFVF_STATE;\n+\treq.pcifunc = pcifunc;\n+\treq.evt_data.vf_state = enable;\n+\treturn rvu_mbox_handler_rep_event_notify(rvu, \u0026req, \u0026rsp);\n }\n \n #define RVU_LF_RX_STATS(reg) \\\n@@ -325,8 +359,10 @@ int rvu_rep_install_mcam_rules(struct rvu *rvu)\n \tu16 start = rswitch-\u003estart_entry;\n \tstruct rvu_hwinfo *hw = rvu-\u003ehw;\n \tu16 pcifunc, entry = 0;\n+\tstruct rvu_pfvf *pfvf;\n \tint pf, vf, numvfs;\n \tint err, nixlf, i;\n+\tbool lbk_enabled;\n \tu8 rep;\n \n \tfor (pf = 1; pf \u003c hw-\u003etotal_pfs; pf++) {\n@@ -334,29 +370,43 @@ int rvu_rep_install_mcam_rules(struct rvu *rvu)\n \t\t\tcontinue;\n \n \t\tpcifunc = rvu_make_pcifunc(rvu-\u003epdev, pf, 0);\n+\t\tpfvf = rvu_get_pfvf(rvu, pcifunc);\n \t\trvu_get_nix_blkaddr(rvu, pcifunc);\n+\t\tlbk_enabled = test_bit(NIXLF_INITIALIZED, \u0026pfvf-\u003eflags);\n+\t\tif (lbk_enabled)\n+\t\t\trvu_switch_enable_lbk_link(rvu, pcifunc, true);\n \t\trep = true;\n \t\tfor (i = 0; i \u003c 2; i++) {\n \t\t\terr = rvu_rep_install_rx_rule(rvu, pcifunc,\n \t\t\t\t\t\t      start + entry, rep);\n \t\t\tif (err)\n-\t\t\t\treturn err;\n+\t\t\t\tgoto err_disable_lbk;\n \t\t\trswitch-\u003eentry2pcifunc[entry++] = pcifunc;\n \n \t\t\terr = rvu_rep_install_tx_rule(rvu, pcifunc,\n \t\t\t\t\t\t      start + entry, rep);\n \t\t\tif (err)\n-\t\t\t\treturn err;\n+\t\t\t\tgoto err_disable_lbk;\n \t\t\trswitch-\u003eentry2pcifunc[entry++] = pcifunc;\n \t\t\trep = false;\n \t\t}\n \n+\t\t/* Sync initial link state for a PF brought up before\n+\t\t * switchdev mode was enabled.\n+\t\t */\n+\t\tif (lbk_enabled)\n+\t\t\trvu_rep_notify_pfvf_state(rvu, pcifunc, true);\n+\n \t\trvu_get_pf_numvfs(rvu, pf, \u0026numvfs, NULL);\n \t\tfor (vf = 0; vf \u003c numvfs; vf++) {\n \t\t\tpcifunc = rvu_make_pcifunc(rvu-\u003epdev, pf, vf + 1);\n+\t\t\tpfvf = rvu_get_pfvf(rvu, pcifunc);\n \t\t\trvu_get_nix_blkaddr(rvu, pcifunc);\n+\t\t\tlbk_enabled = test_bit(NIXLF_INITIALIZED, \u0026pfvf-\u003eflags);\n+\t\t\tif (lbk_enabled)\n+\t\t\t\trvu_switch_enable_lbk_link(rvu, pcifunc, true);\n \n-\t\t\t/* Skip installimg rules if nixlf is not attached */\n+\t\t\t/* Skip installing rules if nixlf is not attached */\n \t\t\terr = nix_get_nixlf(rvu, pcifunc, \u0026nixlf, NULL);\n \t\t\tif (err)\n \t\t\t\tcontinue;\n@@ -366,47 +416,65 @@ int rvu_rep_install_mcam_rules(struct rvu *rvu)\n \t\t\t\t\t\t\t      start + entry,\n \t\t\t\t\t\t\t      rep);\n \t\t\t\tif (err)\n-\t\t\t\t\treturn err;\n+\t\t\t\t\tgoto err_disable_lbk;\n \t\t\t\trswitch-\u003eentry2pcifunc[entry++] = pcifunc;\n \n \t\t\t\terr = rvu_rep_install_tx_rule(rvu, pcifunc,\n \t\t\t\t\t\t\t      start + entry,\n \t\t\t\t\t\t\t      rep);\n \t\t\t\tif (err)\n-\t\t\t\t\treturn err;\n+\t\t\t\t\tgoto err_disable_lbk;\n \t\t\t\trswitch-\u003eentry2pcifunc[entry++] = pcifunc;\n \t\t\t\trep = false;\n \t\t\t}\n+\n+\t\t\t/* Sync initial link state for a VF brought up before\n+\t\t\t * switchdev mode was enabled.\n+\t\t\t */\n+\t\t\tif (lbk_enabled)\n+\t\t\t\trvu_rep_notify_pfvf_state(rvu, pcifunc, true);\n \t\t}\n \t}\n+\treturn 0;\n \n-\t/* Initialize the wq for handling REP events */\n-\tspin_lock_init(\u0026rvu-\u003erep_evtq_lock);\n-\tINIT_LIST_HEAD(\u0026rvu-\u003erep_evtq_head);\n-\tINIT_WORK(\u0026rvu-\u003erep_evt_work, rvu_rep_wq_handler);\n-\trvu-\u003erep_evt_wq = alloc_workqueue(\"rep_evt_wq\", WQ_PERCPU, 0);\n-\tif (!rvu-\u003erep_evt_wq) {\n-\t\tdev_err(rvu-\u003edev, \"REP workqueue allocation failed\\n\");\n-\t\treturn -ENOMEM;\n+err_disable_lbk:\n+\t/* Undo any LBK links enabled above before the MCAM rule failure.\n+\t * Disabling a link that was never enabled is a safe no-op.\n+\t */\n+\tfor (pf = 1; pf \u003c hw-\u003etotal_pfs; pf++) {\n+\t\tif (!is_pf_cgxmapped(rvu, pf))\n+\t\t\tcontinue;\n+\t\tpcifunc = rvu_make_pcifunc(rvu-\u003epdev, pf, 0);\n+\t\trvu_switch_enable_lbk_link(rvu, pcifunc, false);\n+\t\trvu_get_pf_numvfs(rvu, pf, \u0026numvfs, NULL);\n+\t\tfor (vf = 0; vf \u003c numvfs; vf++) {\n+\t\t\tpcifunc = rvu_make_pcifunc(rvu-\u003epdev, pf, vf + 1);\n+\t\t\trvu_switch_enable_lbk_link(rvu, pcifunc, false);\n+\t\t}\n \t}\n-\treturn 0;\n+\treturn err;\n }\n \n void rvu_rep_update_rules(struct rvu *rvu, u16 pcifunc, bool ena)\n {\n \tstruct rvu_switch *rswitch = \u0026rvu-\u003erswitch;\n \tstruct npc_mcam *mcam = \u0026rvu-\u003ehw-\u003emcam;\n-\tu32 max = rswitch-\u003eused_entries;\n \tint blkaddr;\n \tu16 entry;\n+\tu32 max;\n \n-\tif (!rswitch-\u003eused_entries)\n+\tmutex_lock(\u0026rswitch-\u003eswitch_lock);\n+\tmax = rswitch-\u003eused_entries;\n+\tif (!max) {\n+\t\tmutex_unlock(\u0026rswitch-\u003eswitch_lock);\n \t\treturn;\n+\t}\n \n \tblkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0);\n-\n-\tif (blkaddr \u003c 0)\n+\tif (blkaddr \u003c 0) {\n+\t\tmutex_unlock(\u0026rswitch-\u003eswitch_lock);\n \t\treturn;\n+\t}\n \n \trvu_switch_enable_lbk_link(rvu, pcifunc, ena);\n \tmutex_lock(\u0026mcam-\u003elock);\n@@ -415,6 +483,7 @@ void rvu_rep_update_rules(struct rvu *rvu, u16 pcifunc, bool ena)\n \t\t\tnpc_enable_mcam_entry(rvu, mcam, blkaddr, entry, ena);\n \t}\n \tmutex_unlock(\u0026mcam-\u003elock);\n+\tmutex_unlock(\u0026rswitch-\u003eswitch_lock);\n }\n \n int rvu_rep_pf_init(struct rvu *rvu)\n@@ -435,10 +504,31 @@ int rvu_mbox_handler_esw_cfg(struct rvu *rvu, struct esw_cfg_req *req,\n \tif (req-\u003ehdr.pcifunc != rvu-\u003erep_pcifunc)\n \t\treturn 0;\n \n-\trvu-\u003erep_mode = req-\u003eena;\n+\tif (req-\u003eena) {\n+\t\trvu-\u003erep_mode = true;\n+\t} else {\n+\t\tspin_lock(\u0026rvu-\u003erep_evtq_lock);\n+\t\tWRITE_ONCE(rvu-\u003erep_mode, false);\n+\t\trvu_rep_evtq_drain(rvu);\n+\t\tspin_unlock(\u0026rvu-\u003erep_evtq_lock);\n \n-\tif (!rvu-\u003erep_mode)\n \t\trvu_npc_free_mcam_entries(rvu, req-\u003ehdr.pcifunc, -1);\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int rvu_rep_get_rep_map(struct rvu *rvu, struct msg_req *req,\n+\t\t\t       struct get_rep_cnt_rsp *rsp)\n+{\n+\tint rep;\n+\n+\tif (req-\u003ehdr.pcifunc != rvu-\u003erep_pcifunc)\n+\t\treturn -EPERM;\n+\n+\trsp-\u003erep_cnt = rvu-\u003erep_cnt;\n+\tfor (rep = 0; rep \u003c rvu-\u003erep_cnt; rep++)\n+\t\trsp-\u003erep_pf_map[rep] = rvu-\u003erep2pfvf_map[rep];\n \n \treturn 0;\n }\n@@ -446,32 +536,96 @@ int rvu_mbox_handler_esw_cfg(struct rvu *rvu, struct esw_cfg_req *req,\n int rvu_mbox_handler_get_rep_cnt(struct rvu *rvu, struct msg_req *req,\n \t\t\t\t struct get_rep_cnt_rsp *rsp)\n {\n-\tint pf, vf, numvfs, hwvf, rep = 0;\n+\tint pf, vf, numvfs, hwvf, rep = 0, cnt;\n+\tstruct workqueue_struct *wq;\n+\tint ret = 0;\n \tu16 pcifunc;\n+\tu16 *map;\n \n-\trvu-\u003erep_pcifunc = req-\u003ehdr.pcifunc;\n-\trsp-\u003erep_cnt = rvu-\u003ecgx_mapped_pfs + rvu-\u003ecgx_mapped_vfs;\n-\trvu-\u003erep_cnt = rsp-\u003erep_cnt;\n+\t/* Serialize first-time initialization since mbox_wq is WQ_PERCPU. */\n+\tmutex_lock(\u0026rvu-\u003ersrc_lock);\n \n-\trvu-\u003erep2pfvf_map = devm_kzalloc(rvu-\u003edev, rvu-\u003erep_cnt *\n-\t\t\t\t\t sizeof(u16), GFP_KERNEL);\n-\tif (!rvu-\u003erep2pfvf_map)\n-\t\treturn -ENOMEM;\n+\tif (rvu-\u003erep_evt_teardown) {\n+\t\tret = -ENODEV;\n+\t\tgoto unlock;\n+\t}\n+\n+\tif (rvu-\u003erep2pfvf_map) {\n+\t\tret = rvu_rep_get_rep_map(rvu, req, rsp);\n+\t\tgoto unlock;\n+\t}\n+\n+\t/* Only a PF can register as the representor, not a VF. */\n+\tif (req-\u003ehdr.pcifunc \u0026 RVU_PFVF_FUNC_MASK) {\n+\t\tret = -EPERM;\n+\t\tgoto unlock;\n+\t}\n+\n+\tcnt = rvu-\u003ecgx_mapped_pfs + rvu-\u003ecgx_mapped_vfs;\n+\tif (cnt \u003e RVU_MAX_REP) {\n+\t\tdev_err(rvu-\u003edev, \"Representor count %d exceeds max %d\\n\",\n+\t\t\tcnt, RVU_MAX_REP);\n+\t\tret = -EINVAL;\n+\t\tgoto unlock;\n+\t}\n+\n+\t/* Allocate at least one element so the pointer is always non-NULL\n+\t * once published, keeping the fast-path check above reliable.\n+\t */\n+\tmap = devm_kzalloc(rvu-\u003edev, (cnt ?: 1) * sizeof(u16), GFP_KERNEL);\n+\tif (!map) {\n+\t\tret = -ENOMEM;\n+\t\tgoto unlock;\n+\t}\n \n \tfor (pf = 0; pf \u003c rvu-\u003ehw-\u003etotal_pfs; pf++) {\n \t\tif (!is_pf_cgxmapped(rvu, pf))\n \t\t\tcontinue;\n+\t\tif (rep \u003e= cnt)\n+\t\t\tbreak;\n \t\tpcifunc = rvu_make_pcifunc(rvu-\u003epdev, pf, 0);\n-\t\trvu-\u003erep2pfvf_map[rep] = pcifunc;\n+\t\tmap[rep] = pcifunc;\n \t\trsp-\u003erep_pf_map[rep] = pcifunc;\n \t\trep++;\n \t\trvu_get_pf_numvfs(rvu, pf, \u0026numvfs, \u0026hwvf);\n-\t\tfor (vf = 0; vf \u003c numvfs; vf++) {\n-\t\t\trvu-\u003erep2pfvf_map[rep] = pcifunc |\n-\t\t\t\t((vf + 1) \u0026 RVU_PFVF_FUNC_MASK);\n-\t\t\trsp-\u003erep_pf_map[rep] = rvu-\u003erep2pfvf_map[rep];\n+\t\tfor (vf = 0; vf \u003c numvfs \u0026\u0026 rep \u003c cnt; vf++) {\n+\t\t\tmap[rep] = pcifunc | ((vf + 1) \u0026 RVU_PFVF_FUNC_MASK);\n+\t\t\trsp-\u003erep_pf_map[rep] = map[rep];\n \t\t\trep++;\n \t\t}\n \t}\n-\treturn 0;\n+\n+\t/* Initialize even when cnt is 0, so esw_cfg drain never sees an uninitialized list. */\n+\tspin_lock_init(\u0026rvu-\u003erep_evtq_lock);\n+\tINIT_LIST_HEAD(\u0026rvu-\u003erep_evtq_head);\n+\tINIT_WORK(\u0026rvu-\u003erep_evt_work, rvu_rep_wq_handler);\n+\n+\tif (!cnt) {\n+\t\trsp-\u003erep_cnt = cnt;\n+\t\trvu-\u003erep_cnt = cnt;\n+\t\trvu-\u003erep2pfvf_map = map;\n+\t\trvu-\u003erep_pcifunc = req-\u003ehdr.pcifunc;\n+\t\tgoto unlock;\n+\t}\n+\n+\twq = alloc_workqueue(\"rep_evt_wq\", WQ_UNBOUND, 0);\n+\tif (!wq) {\n+\t\tdev_err(rvu-\u003edev, \"REP workqueue allocation failed\\n\");\n+\t\tdevm_kfree(rvu-\u003edev, map);\n+\t\tret = -ENOMEM;\n+\t\tgoto unlock;\n+\t}\n+\n+\trvu-\u003erep_cnt = cnt;\n+\trsp-\u003erep_cnt = cnt;\n+\trvu-\u003erep2pfvf_map = map;\n+\trvu-\u003erep_pcifunc = req-\u003ehdr.pcifunc;\n+\n+\t/* Pairs with smp_load_acquire() in rvu_mbox_handler_rep_event_notify()\n+\t * to publish the above initialization before wq becomes visible.\n+\t */\n+\tsmp_store_release(\u0026rvu-\u003erep_evt_wq, wq);\n+unlock:\n+\tmutex_unlock(\u0026rvu-\u003ersrc_lock);\n+\treturn ret;\n }\ndiff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_switch.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_switch.c\nindex 49ce38685a7e6..0897598c6edea 100644\n--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_switch.c\n+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_switch.c\n@@ -12,11 +12,18 @@ void rvu_switch_enable_lbk_link(struct rvu *rvu, u16 pcifunc, bool enable)\n {\n \tstruct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc);\n \tstruct nix_hw *nix_hw;\n+\tint blkaddr;\n \n-\tnix_hw = get_nix_hw(rvu-\u003ehw, pfvf-\u003enix_blkaddr);\n+\tmutex_lock(\u0026rvu-\u003ersrc_lock);\n+\tblkaddr = pfvf-\u003enix_blkaddr;\n+\tnix_hw = get_nix_hw(rvu-\u003ehw, blkaddr);\n \t/* Enable LBK links with channel 63 for TX MCAM rule */\n-\trvu_nix_tx_tl2_cfg(rvu, pfvf-\u003enix_blkaddr, pcifunc,\n+\tif (!nix_hw)\n+\t\tgoto unlock;\n+\trvu_nix_tx_tl2_cfg(rvu, blkaddr, pcifunc,\n \t\t\t   \u0026nix_hw-\u003etxsch[NIX_TXSCH_LVL_TL2], enable);\n+unlock:\n+\tmutex_unlock(\u0026rvu-\u003ersrc_lock);\n }\n \n static int rvu_switch_install_rx_rule(struct rvu *rvu, u16 pcifunc,\n@@ -188,7 +195,7 @@ void rvu_switch_enable(struct rvu *rvu)\n \tif (!rswitch-\u003eentry2pcifunc)\n \t\tgoto free_entries;\n \n-\trswitch-\u003eused_entries = alloc_rsp.count;\n+\t/* Publish used_entries only after entry2pcifunc[] is fully populated. */\n \trswitch-\u003estart_entry = alloc_rsp.entry;\n \n \tif (rvu-\u003erep_mode) {\n@@ -200,13 +207,25 @@ void rvu_switch_enable(struct rvu *rvu)\n \tif (ret)\n \t\tgoto uninstall_rules;\n \n+\tmutex_lock(\u0026rswitch-\u003eswitch_lock);\n+\trswitch-\u003eused_entries = alloc_rsp.count;\n+\tmutex_unlock(\u0026rswitch-\u003eswitch_lock);\n+\n \treturn;\n \n uninstall_rules:\n+\tif (rvu-\u003erep_mode \u0026\u0026 rvu-\u003erep_pcifunc)\n+\t\trvu_switch_enable_lbk_link(rvu, rvu-\u003erep_pcifunc, false);\n+\n \tuninstall_req.start = rswitch-\u003estart_entry;\n-\tuninstall_req.end =  rswitch-\u003estart_entry + rswitch-\u003eused_entries - 1;\n+\tuninstall_req.end =  rswitch-\u003estart_entry + alloc_rsp.count - 1;\n \trvu_mbox_handler_npc_delete_flow(rvu, \u0026uninstall_req, \u0026uninstall_rsp);\n+\tmutex_lock(\u0026rswitch-\u003eswitch_lock);\n+\trswitch-\u003eused_entries = 0;\n+\trswitch-\u003estart_entry = 0;\n \tkfree(rswitch-\u003eentry2pcifunc);\n+\trswitch-\u003eentry2pcifunc = NULL;\n+\tmutex_unlock(\u0026rswitch-\u003eswitch_lock);\n free_entries:\n \tfree_req.all = 1;\n \trvu_mbox_handler_npc_mcam_free_entry(rvu, \u0026free_req, \u0026rsp);\n@@ -229,8 +248,23 @@ void rvu_switch_disable(struct rvu *rvu)\n \tif (!rswitch-\u003eused_entries)\n \t\treturn;\n \n-\tif (rvu-\u003erep_mode)\n+\tif (rvu-\u003erep_mode) {\n+\t\tif (rvu-\u003erep_pcifunc)\n+\t\t\trvu_switch_enable_lbk_link(rvu, rvu-\u003erep_pcifunc, false);\n+\n+\t\tfor (pf = 1; pf \u003c hw-\u003etotal_pfs; pf++) {\n+\t\t\tif (!is_pf_cgxmapped(rvu, pf))\n+\t\t\t\tcontinue;\n+\t\t\tpcifunc = rvu_make_pcifunc(rvu-\u003epdev, pf, 0);\n+\t\t\trvu_switch_enable_lbk_link(rvu, pcifunc, false);\n+\t\t\trvu_get_pf_numvfs(rvu, pf, \u0026numvfs, NULL);\n+\t\t\tfor (vf = 0; vf \u003c numvfs; vf++) {\n+\t\t\t\tpcifunc = rvu_make_pcifunc(rvu-\u003epdev, pf, vf + 1);\n+\t\t\t\trvu_switch_enable_lbk_link(rvu, pcifunc, false);\n+\t\t\t}\n+\t\t}\n \t\tgoto free_ents;\n+\t}\n \n \tfor (pf = 1; pf \u003c hw-\u003etotal_pfs; pf++) {\n \t\tif (!is_pf_cgxmapped(rvu, pf))\n@@ -260,35 +294,46 @@ void rvu_switch_disable(struct rvu *rvu)\n \t}\n \n free_ents:\n+\tmutex_lock(\u0026rswitch-\u003eswitch_lock);\n \tuninstall_req.start = rswitch-\u003estart_entry;\n-\tuninstall_req.end =  rswitch-\u003estart_entry + rswitch-\u003eused_entries - 1;\n+\tuninstall_req.end   = rswitch-\u003estart_entry + rswitch-\u003eused_entries - 1;\n+\trswitch-\u003eused_entries = 0;\n+\tkfree(rswitch-\u003eentry2pcifunc);\n+\trswitch-\u003eentry2pcifunc = NULL;\n+\tmutex_unlock(\u0026rswitch-\u003eswitch_lock);\n+\n \tfree_req.all = 1;\n \trvu_mbox_handler_npc_delete_flow(rvu, \u0026uninstall_req, \u0026uninstall_rsp);\n \trvu_mbox_handler_npc_mcam_free_entry(rvu, \u0026free_req, \u0026rsp);\n-\trswitch-\u003eused_entries = 0;\n-\tkfree(rswitch-\u003eentry2pcifunc);\n }\n \n void rvu_switch_update_rules(struct rvu *rvu, u16 pcifunc, bool ena)\n {\n \tstruct rvu_switch *rswitch = \u0026rvu-\u003erswitch;\n-\tu32 max = rswitch-\u003eused_entries;\n+\tu16 start_entry;\n \tu16 entry;\n+\tu32 max;\n \n \tif (rvu-\u003erep_mode)\n \t\treturn rvu_rep_update_rules(rvu, pcifunc, ena);\n \n-\tif (!rswitch-\u003eused_entries)\n+\tmutex_lock(\u0026rswitch-\u003eswitch_lock);\n+\tmax = rswitch-\u003eused_entries;\n+\tif (!max) {\n+\t\tmutex_unlock(\u0026rswitch-\u003eswitch_lock);\n \t\treturn;\n+\t}\n \n \tfor (entry = 0; entry \u003c max; entry++) {\n \t\tif (rswitch-\u003eentry2pcifunc[entry] == pcifunc)\n \t\t\tbreak;\n \t}\n+\tstart_entry = rswitch-\u003estart_entry;\n+\tmutex_unlock(\u0026rswitch-\u003eswitch_lock);\n \n \tif (entry \u003e= max)\n \t\treturn;\n \n-\trvu_switch_install_tx_rule(rvu, pcifunc, rswitch-\u003estart_entry + entry);\n+\trvu_switch_install_tx_rule(rvu, pcifunc, start_entry + entry);\n \trvu_switch_install_rx_rule(rvu, pcifunc, 0x0);\n }\ndiff --git a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c\nindex 0f5d5642d3f7a..21b5802cb9431 100644\n--- a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c\n+++ b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c\n@@ -297,11 +297,27 @@ static int rvu_rep_notify_pfvf(struct otx2_nic *priv, u16 event,\n static void rvu_rep_state_evt_handler(struct otx2_nic *priv,\n \t\t\t\t      struct rep_event *info)\n {\n+\tstruct rep_dev **reps;\n \tstruct rep_dev *rep;\n \tint rep_id;\n \n+\t/* Capture a stable snapshot.  rvu_rep_destroy() sets priv-\u003ereps to\n+\t * NULL and then calls flush_work() to wait for any in-flight handler\n+\t * to finish before freeing the array, so using the local copy here\n+\t * is safe for the lifetime of this function.\n+\t */\n+\treps = READ_ONCE(priv-\u003ereps);\n+\tif (!reps)\n+\t\treturn;\n+\n \trep_id = rvu_rep_get_repid(priv, info-\u003epcifunc);\n-\trep = priv-\u003ereps[rep_id];\n+\tif (rep_id \u003c 0) {\n+\t\tdev_warn_ratelimited(priv-\u003edev,\n+\t\t\t\t     \"REP state event for unknown pcifunc 0x%x (err %d)\\n\",\n+\t\t\t\t     info-\u003epcifunc, rep_id);\n+\t\treturn;\n+\t}\n+\trep = reps[rep_id];\n \tif (info-\u003eevt_data.vf_state)\n \t\trep-\u003eflags |= RVU_REP_VF_INITIALIZED;\n \telse\n@@ -459,6 +475,9 @@ static int rvu_rep_open(struct net_device *dev)\n \tnetif_carrier_on(dev);\n \tnetif_tx_start_all_queues(dev);\n \n+\tif (rep-\u003epcifunc \u0026 RVU_PFVF_FUNC_MASK)\n+\t\treturn 0;\n+\n \tevt.event = RVU_EVENT_PORT_STATE;\n \tevt.evt_data.port_state = 1;\n \tevt.pcifunc = rep-\u003epcifunc;\n@@ -478,6 +497,13 @@ static int rvu_rep_stop(struct net_device *dev)\n \tnetif_carrier_off(dev);\n \tnetif_tx_disable(dev);\n \n+\tif (rep-\u003epcifunc \u0026 RVU_PFVF_FUNC_MASK)\n+\t\treturn 0;\n+\n+\t/* Don't notify the AF during teardown */\n+\tif (priv-\u003eflags \u0026 OTX2_FLAG_INTF_DOWN)\n+\t\treturn 0;\n+\n \tevt.event = RVU_EVENT_PORT_STATE;\n \tevt.pcifunc = rep-\u003epcifunc;\n \trvu_rep_notify_pfvf(priv, RVU_EVENT_PORT_STATE, \u0026evt);\n@@ -628,20 +654,27 @@ static int rvu_rep_rsrc_init(struct otx2_nic *priv)\n \n void rvu_rep_destroy(struct otx2_nic *priv)\n {\n+\tstruct rep_dev **reps = priv-\u003ereps;\n \tstruct rep_dev *rep;\n \tint rep_id;\n \n \trvu_eswitch_config(priv, false);\n \tpriv-\u003eflags |= OTX2_FLAG_INTF_DOWN;\n \trvu_rep_free_cq_rsrc(priv);\n+\n+\tpriv-\u003ereps = NULL;\n+\t/* Wait for any in-flight rvu_rep_state_evt_handler() using the old\n+\t * reps snapshot to finish before freeing the entries below.\n+\t */\n+\tflush_work(\u0026priv-\u003embox.mbox_up_wrk);\n \tfor (rep_id = 0; rep_id \u003c priv-\u003erep_cnt; rep_id++) {\n-\t\trep = priv-\u003ereps[rep_id];\n+\t\trep = reps[rep_id];\n \t\tunregister_netdev(rep-\u003enetdev);\n \t\trvu_rep_devlink_port_unregister(rep);\n \t\tfree_netdev(rep-\u003enetdev);\n \t\tkfree(rep-\u003eflow_cfg);\n \t}\n-\tkfree(priv-\u003ereps);\n+\tkfree(reps);\n \trvu_rep_rsrc_free(priv);\n }\n \ndiff --git a/drivers/net/ethernet/marvell/octeontx2/nic/rep.h b/drivers/net/ethernet/marvell/octeontx2/nic/rep.h\nindex 5bc9e2c7d800b..b98fe191e83a3 100644\n--- a/drivers/net/ethernet/marvell/octeontx2/nic/rep.h\n+++ b/drivers/net/ethernet/marvell/octeontx2/nic/rep.h\n@@ -16,7 +16,6 @@\n \n #define PCI_DEVID_RVU_REP\t0xA0E0\n \n-#define RVU_MAX_REP\tOTX2_MAX_CQ_CNT\n \n struct rep_stats {\n \tu64 rx_bytes;\n"
}

2/1 2026/09/29 05:17 agent patch-evaluator
0m Model:
core

Args:
null

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "Reasoning": "The patch modifies the Marvell OcteonTX2 RVU (Resource Virtualization Unit) driver under drivers/net/ethernet/marvell/octeontx2/. This is vendor-specific SmartNIC / network processor hardware requiring physical PCIe devices (PCI_VENDOR_ID_CAVIUM) not emulated in standard QEMU or GCE virtualized environments, making the modified code structurally unreachable for 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 b61ee6c366e792f8cde61545680b4a54797688b6
Author: syz-cluster <triage@syzkaller.com>
Date:   Tue Sep 29 05:17:57 2026 +0000

    syz-cluster: applied patch under review

diff --git a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h
index cece197d1074b..d114faeba1bbf 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/mbox.h
+++ b/drivers/net/ethernet/marvell/octeontx2/af/mbox.h
@@ -1777,10 +1777,12 @@ struct ptp_get_cap_rsp {
 	u64 cap;
 };
 
+#define RVU_MAX_REP	64
+
 struct get_rep_cnt_rsp {
 	struct mbox_msghdr hdr;
 	u16 rep_cnt;
-	u16 rep_pf_map[64];
+	u16 rep_pf_map[RVU_MAX_REP];
 	u64 rsvd;
 };
 
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
index 937b085582b5f..baba564259436 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.c
@@ -3555,9 +3555,26 @@ static void rvu_update_module_params(struct rvu *rvu)
 
 static atomic_t device_bound = ATOMIC_INIT(0);
 
+static struct workqueue_struct *rvu_rep_evtq_disable(struct rvu *rvu)
+{
+	struct workqueue_struct *rep_wq;
+
+	mutex_lock(&rvu->rsrc_lock);
+	WRITE_ONCE(rvu->rep_evt_teardown, true);
+	rep_wq = rvu->rep_evt_wq;
+	WRITE_ONCE(rvu->rep_evt_wq, NULL);
+	mutex_unlock(&rvu->rsrc_lock);
+
+	if (rep_wq)
+		flush_workqueue(rep_wq);
+
+	return rep_wq;
+}
+
 static int rvu_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 {
 	struct device *dev = &pdev->dev;
+	struct workqueue_struct *rep_wq;
 	struct rvu *rvu;
 	int    err;
 
@@ -3686,7 +3703,18 @@ static int rvu_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 err_dl:
 	rvu_unregister_dl(rvu);
 err_irq:
+	/*
+	 * GET_REP_CNT may have allocated rep_evt_wq before this failure.
+	 * Drain it before unregistering interrupts.
+	 */
+	rep_wq = rvu_rep_evtq_disable(rvu);
+
 	rvu_unregister_interrupts(rvu);
+
+	if (rep_wq) {
+		flush_workqueue(rvu->afpf_wq_info.mbox_wq);
+		destroy_workqueue(rep_wq);
+	}
 err_flr:
 	rvu_flr_wq_destroy(rvu);
 err_mbox:
@@ -3715,12 +3743,25 @@ static int rvu_probe(struct pci_dev *pdev, const struct pci_device_id *id)
 
 static void rvu_remove(struct pci_dev *pdev)
 {
+	struct workqueue_struct *rep_wq;
 	struct rvu *rvu = pci_get_drvdata(pdev);
 
 	rvu_dbg_exit(rvu);
 	rvu_unregister_dl(rvu);
+
+	/* Block get_rep_cnt() from allocating a new rep_evt_wq. */
+	rep_wq = rvu_rep_evtq_disable(rvu);
+
 	rvu_unregister_interrupts(rvu);
 	rvu_flr_wq_destroy(rvu);
+
+	/* Flush both mbox workqueues before destroying rep_wq. */
+	flush_workqueue(rvu->afpf_wq_info.mbox_wq);
+	if (rvu->afvf_wq_info.mbox_wq)
+		flush_workqueue(rvu->afvf_wq_info.mbox_wq);
+	if (rep_wq)
+		destroy_workqueue(rep_wq);
+
 	rvu_cgx_exit(rvu);
 	rvu_fwdata_exit(rvu);
 	rvu_mcs_exit(rvu);
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
index 094227404ef9f..04a2bc36fbbe5 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu.h
@@ -571,7 +571,7 @@ struct npc_kpu_profile_adapter {
 #define RVU_SWITCH_LBK_CHAN	63
 
 struct rvu_switch {
-	struct mutex switch_lock; /* Serialize flow installation */
+	struct mutex switch_lock; /* Serialize flow installation and entry2pcifunc access */
 	u32 used_entries;
 	u16 *entry2pcifunc;
 	u16 mode;
@@ -675,6 +675,7 @@ struct rvu {
 	struct list_head	rep_evtq_head;
 	/* Representor event lock */
 	spinlock_t		rep_evtq_lock;
+	bool			rep_evt_teardown;
 
 	struct ng_rvu           *ng_rvu;
 };
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c
index a2781e0f504e3..4c4171515d743 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_rep.c
@@ -44,7 +44,16 @@ static int rvu_rep_up_notify(struct rvu *rvu, struct rep_event *event)
 	if (event->event & RVU_EVENT_MAC_ADDR_CHANGE)
 		ether_addr_copy(pfvf->mac_addr, event->evt_data.mac);
 
+	if (event->event & RVU_EVENT_PFVF_STATE)
+		pf = rvu_get_pf(rvu->pdev, event->hdr.pcifunc);
+
 	mutex_lock(&rvu->mbox_lock);
+
+	if (!READ_ONCE(rvu->rep_mode)) {
+		mutex_unlock(&rvu->mbox_lock);
+		return -ENODEV;
+	}
+
 	msg = otx2_mbox_alloc_msg_rep_event_up_notify(rvu, pf);
 	if (!msg) {
 		mutex_unlock(&rvu->mbox_lock);
@@ -53,6 +62,10 @@ static int rvu_rep_up_notify(struct rvu *rvu, struct rep_event *event)
 
 	msg->hdr.pcifunc = event->pcifunc;
 	msg->event = event->event;
+	msg->pcifunc = event->pcifunc;
+
+	if (event->event & RVU_EVENT_PFVF_STATE)
+		msg->hdr.pcifunc = event->hdr.pcifunc;
 
 	memcpy(&msg->evt_data, &event->evt_data, sizeof(struct rep_evt_data));
 
@@ -87,7 +100,12 @@ static void rvu_rep_wq_handler(struct work_struct *work)
 
 		event = &qentry->event;
 
-		rvu_rep_up_notify(rvu, event);
+		/* Once teardown has started the AF-PF mbox interrupt may
+		 * already be disabled, so sending would just block until
+		 * otx2_mbox_wait_for_rsp() times out. Drop the event instead.
+		 */
+		if (!READ_ONCE(rvu->rep_evt_teardown))
+			rvu_rep_up_notify(rvu, event);
 		kfree(qentry);
 	} while (1);
 }
@@ -95,55 +113,71 @@ static void rvu_rep_wq_handler(struct work_struct *work)
 int rvu_mbox_handler_rep_event_notify(struct rvu *rvu, struct rep_event *req,
 				      struct msg_rsp *rsp)
 {
+	struct workqueue_struct *wq;
 	struct rep_evtq_ent *qentry;
 
-	/* The mailbox dispatcher normalises only the header pcifunc; the
-	 * nested struct rep_event::pcifunc body field is sender-controlled
-	 * and is later used by rvu_rep_up_notify() to index rvu->pf[] /
-	 * rvu->hwvf[].  Reject out-of-range body selectors before queueing.
-	 */
+	wq = smp_load_acquire(&rvu->rep_evt_wq);
+	if (!wq)
+		return -EINVAL;
+
+	/* Only the registered representor PF may send REP_EVENT_NOTIFY. */
+	if (req->hdr.pcifunc != rvu->rep_pcifunc)
+		return -EPERM;
+
 	if (!is_pf_func_valid(rvu, req->pcifunc))
 		return -EINVAL;
 
+	/* Only CGX-mapped PFs are present in the representor map. */
+	if (!is_pf_cgxmapped(rvu, rvu_get_pf(rvu->pdev, req->pcifunc)))
+		return -EINVAL;
+
+	if ((req->event & RVU_EVENT_PFVF_STATE) &&
+	    rvu_get_pf(rvu->pdev, req->hdr.pcifunc) >= rvu->hw->total_pfs)
+		return -EINVAL;
+
 	qentry = kmalloc_obj(*qentry, GFP_ATOMIC);
 	if (!qentry)
 		return -ENOMEM;
 
 	qentry->event = *req;
 	spin_lock(&rvu->rep_evtq_lock);
+	if (!rvu->rep_mode) {
+		spin_unlock(&rvu->rep_evtq_lock);
+		kfree(qentry);
+		return -ENODEV;
+	}
 	list_add_tail(&qentry->node, &rvu->rep_evtq_head);
 	spin_unlock(&rvu->rep_evtq_lock);
-	queue_work(rvu->rep_evt_wq, &rvu->rep_evt_work);
+
+	queue_work(wq, &rvu->rep_evt_work);
 	return 0;
 }
 
-int rvu_rep_notify_pfvf_state(struct rvu *rvu, u16 pcifunc, bool enable)
+static void rvu_rep_evtq_drain(struct rvu *rvu)
 {
-	struct rep_event *req;
-	int pf;
-
-	if (!is_pf_cgxmapped(rvu, rvu_get_pf(rvu->pdev, pcifunc)))
-		return 0;
-
-	pf = rvu_get_pf(rvu->pdev, rvu->rep_pcifunc);
+	struct rep_evtq_ent *qentry;
 
-	mutex_lock(&rvu->mbox_lock);
-	req = otx2_mbox_alloc_msg_rep_event_up_notify(rvu, pf);
-	if (!req) {
-		mutex_unlock(&rvu->mbox_lock);
-		return -ENOMEM;
+	while (!list_empty(&rvu->rep_evtq_head)) {
+		qentry = list_first_entry(&rvu->rep_evtq_head,
+					  struct rep_evtq_ent, node);
+		list_del(&qentry->node);
+		kfree(qentry);
 	}
+}
 
-	req->hdr.pcifunc = rvu->rep_pcifunc;
-	req->event |= RVU_EVENT_PFVF_STATE;
-	req->pcifunc = pcifunc;
-	req->evt_data.vf_state = enable;
+int rvu_rep_notify_pfvf_state(struct rvu *rvu, u16 pcifunc, bool enable)
+{
+	struct rep_event req = { 0 };
+	struct msg_rsp rsp;
 
-	otx2_mbox_wait_for_zero(&rvu->afpf_wq_info.mbox_up, pf);
-	otx2_mbox_msg_send_up(&rvu->afpf_wq_info.mbox_up, pf);
+	if (!is_pf_cgxmapped(rvu, rvu_get_pf(rvu->pdev, pcifunc)))
+		return 0;
 
-	mutex_unlock(&rvu->mbox_lock);
-	return 0;
+	req.hdr.pcifunc = rvu->rep_pcifunc;
+	req.event = RVU_EVENT_PFVF_STATE;
+	req.pcifunc = pcifunc;
+	req.evt_data.vf_state = enable;
+	return rvu_mbox_handler_rep_event_notify(rvu, &req, &rsp);
 }
 
 #define RVU_LF_RX_STATS(reg) \
@@ -325,8 +359,10 @@ int rvu_rep_install_mcam_rules(struct rvu *rvu)
 	u16 start = rswitch->start_entry;
 	struct rvu_hwinfo *hw = rvu->hw;
 	u16 pcifunc, entry = 0;
+	struct rvu_pfvf *pfvf;
 	int pf, vf, numvfs;
 	int err, nixlf, i;
+	bool lbk_enabled;
 	u8 rep;
 
 	for (pf = 1; pf < hw->total_pfs; pf++) {
@@ -334,29 +370,43 @@ int rvu_rep_install_mcam_rules(struct rvu *rvu)
 			continue;
 
 		pcifunc = rvu_make_pcifunc(rvu->pdev, pf, 0);
+		pfvf = rvu_get_pfvf(rvu, pcifunc);
 		rvu_get_nix_blkaddr(rvu, pcifunc);
+		lbk_enabled = test_bit(NIXLF_INITIALIZED, &pfvf->flags);
+		if (lbk_enabled)
+			rvu_switch_enable_lbk_link(rvu, pcifunc, true);
 		rep = true;
 		for (i = 0; i < 2; i++) {
 			err = rvu_rep_install_rx_rule(rvu, pcifunc,
 						      start + entry, rep);
 			if (err)
-				return err;
+				goto err_disable_lbk;
 			rswitch->entry2pcifunc[entry++] = pcifunc;
 
 			err = rvu_rep_install_tx_rule(rvu, pcifunc,
 						      start + entry, rep);
 			if (err)
-				return err;
+				goto err_disable_lbk;
 			rswitch->entry2pcifunc[entry++] = pcifunc;
 			rep = false;
 		}
 
+		/* Sync initial link state for a PF brought up before
+		 * switchdev mode was enabled.
+		 */
+		if (lbk_enabled)
+			rvu_rep_notify_pfvf_state(rvu, pcifunc, true);
+
 		rvu_get_pf_numvfs(rvu, pf, &numvfs, NULL);
 		for (vf = 0; vf < numvfs; vf++) {
 			pcifunc = rvu_make_pcifunc(rvu->pdev, pf, vf + 1);
+			pfvf = rvu_get_pfvf(rvu, pcifunc);
 			rvu_get_nix_blkaddr(rvu, pcifunc);
+			lbk_enabled = test_bit(NIXLF_INITIALIZED, &pfvf->flags);
+			if (lbk_enabled)
+				rvu_switch_enable_lbk_link(rvu, pcifunc, true);
 
-			/* Skip installimg rules if nixlf is not attached */
+			/* Skip installing rules if nixlf is not attached */
 			err = nix_get_nixlf(rvu, pcifunc, &nixlf, NULL);
 			if (err)
 				continue;
@@ -366,47 +416,65 @@ int rvu_rep_install_mcam_rules(struct rvu *rvu)
 							      start + entry,
 							      rep);
 				if (err)
-					return err;
+					goto err_disable_lbk;
 				rswitch->entry2pcifunc[entry++] = pcifunc;
 
 				err = rvu_rep_install_tx_rule(rvu, pcifunc,
 							      start + entry,
 							      rep);
 				if (err)
-					return err;
+					goto err_disable_lbk;
 				rswitch->entry2pcifunc[entry++] = pcifunc;
 				rep = false;
 			}
+
+			/* Sync initial link state for a VF brought up before
+			 * switchdev mode was enabled.
+			 */
+			if (lbk_enabled)
+				rvu_rep_notify_pfvf_state(rvu, pcifunc, true);
 		}
 	}
+	return 0;
 
-	/* Initialize the wq for handling REP events */
-	spin_lock_init(&rvu->rep_evtq_lock);
-	INIT_LIST_HEAD(&rvu->rep_evtq_head);
-	INIT_WORK(&rvu->rep_evt_work, rvu_rep_wq_handler);
-	rvu->rep_evt_wq = alloc_workqueue("rep_evt_wq", WQ_PERCPU, 0);
-	if (!rvu->rep_evt_wq) {
-		dev_err(rvu->dev, "REP workqueue allocation failed\n");
-		return -ENOMEM;
+err_disable_lbk:
+	/* Undo any LBK links enabled above before the MCAM rule failure.
+	 * Disabling a link that was never enabled is a safe no-op.
+	 */
+	for (pf = 1; pf < hw->total_pfs; pf++) {
+		if (!is_pf_cgxmapped(rvu, pf))
+			continue;
+		pcifunc = rvu_make_pcifunc(rvu->pdev, pf, 0);
+		rvu_switch_enable_lbk_link(rvu, pcifunc, false);
+		rvu_get_pf_numvfs(rvu, pf, &numvfs, NULL);
+		for (vf = 0; vf < numvfs; vf++) {
+			pcifunc = rvu_make_pcifunc(rvu->pdev, pf, vf + 1);
+			rvu_switch_enable_lbk_link(rvu, pcifunc, false);
+		}
 	}
-	return 0;
+	return err;
 }
 
 void rvu_rep_update_rules(struct rvu *rvu, u16 pcifunc, bool ena)
 {
 	struct rvu_switch *rswitch = &rvu->rswitch;
 	struct npc_mcam *mcam = &rvu->hw->mcam;
-	u32 max = rswitch->used_entries;
 	int blkaddr;
 	u16 entry;
+	u32 max;
 
-	if (!rswitch->used_entries)
+	mutex_lock(&rswitch->switch_lock);
+	max = rswitch->used_entries;
+	if (!max) {
+		mutex_unlock(&rswitch->switch_lock);
 		return;
+	}
 
 	blkaddr = rvu_get_blkaddr(rvu, BLKTYPE_NPC, 0);
-
-	if (blkaddr < 0)
+	if (blkaddr < 0) {
+		mutex_unlock(&rswitch->switch_lock);
 		return;
+	}
 
 	rvu_switch_enable_lbk_link(rvu, pcifunc, ena);
 	mutex_lock(&mcam->lock);
@@ -415,6 +483,7 @@ void rvu_rep_update_rules(struct rvu *rvu, u16 pcifunc, bool ena)
 			npc_enable_mcam_entry(rvu, mcam, blkaddr, entry, ena);
 	}
 	mutex_unlock(&mcam->lock);
+	mutex_unlock(&rswitch->switch_lock);
 }
 
 int rvu_rep_pf_init(struct rvu *rvu)
@@ -435,10 +504,31 @@ int rvu_mbox_handler_esw_cfg(struct rvu *rvu, struct esw_cfg_req *req,
 	if (req->hdr.pcifunc != rvu->rep_pcifunc)
 		return 0;
 
-	rvu->rep_mode = req->ena;
+	if (req->ena) {
+		rvu->rep_mode = true;
+	} else {
+		spin_lock(&rvu->rep_evtq_lock);
+		WRITE_ONCE(rvu->rep_mode, false);
+		rvu_rep_evtq_drain(rvu);
+		spin_unlock(&rvu->rep_evtq_lock);
 
-	if (!rvu->rep_mode)
 		rvu_npc_free_mcam_entries(rvu, req->hdr.pcifunc, -1);
+	}
+
+	return 0;
+}
+
+static int rvu_rep_get_rep_map(struct rvu *rvu, struct msg_req *req,
+			       struct get_rep_cnt_rsp *rsp)
+{
+	int rep;
+
+	if (req->hdr.pcifunc != rvu->rep_pcifunc)
+		return -EPERM;
+
+	rsp->rep_cnt = rvu->rep_cnt;
+	for (rep = 0; rep < rvu->rep_cnt; rep++)
+		rsp->rep_pf_map[rep] = rvu->rep2pfvf_map[rep];
 
 	return 0;
 }
@@ -446,32 +536,96 @@ int rvu_mbox_handler_esw_cfg(struct rvu *rvu, struct esw_cfg_req *req,
 int rvu_mbox_handler_get_rep_cnt(struct rvu *rvu, struct msg_req *req,
 				 struct get_rep_cnt_rsp *rsp)
 {
-	int pf, vf, numvfs, hwvf, rep = 0;
+	int pf, vf, numvfs, hwvf, rep = 0, cnt;
+	struct workqueue_struct *wq;
+	int ret = 0;
 	u16 pcifunc;
+	u16 *map;
 
-	rvu->rep_pcifunc = req->hdr.pcifunc;
-	rsp->rep_cnt = rvu->cgx_mapped_pfs + rvu->cgx_mapped_vfs;
-	rvu->rep_cnt = rsp->rep_cnt;
+	/* Serialize first-time initialization since mbox_wq is WQ_PERCPU. */
+	mutex_lock(&rvu->rsrc_lock);
 
-	rvu->rep2pfvf_map = devm_kzalloc(rvu->dev, rvu->rep_cnt *
-					 sizeof(u16), GFP_KERNEL);
-	if (!rvu->rep2pfvf_map)
-		return -ENOMEM;
+	if (rvu->rep_evt_teardown) {
+		ret = -ENODEV;
+		goto unlock;
+	}
+
+	if (rvu->rep2pfvf_map) {
+		ret = rvu_rep_get_rep_map(rvu, req, rsp);
+		goto unlock;
+	}
+
+	/* Only a PF can register as the representor, not a VF. */
+	if (req->hdr.pcifunc & RVU_PFVF_FUNC_MASK) {
+		ret = -EPERM;
+		goto unlock;
+	}
+
+	cnt = rvu->cgx_mapped_pfs + rvu->cgx_mapped_vfs;
+	if (cnt > RVU_MAX_REP) {
+		dev_err(rvu->dev, "Representor count %d exceeds max %d\n",
+			cnt, RVU_MAX_REP);
+		ret = -EINVAL;
+		goto unlock;
+	}
+
+	/* Allocate at least one element so the pointer is always non-NULL
+	 * once published, keeping the fast-path check above reliable.
+	 */
+	map = devm_kzalloc(rvu->dev, (cnt ?: 1) * sizeof(u16), GFP_KERNEL);
+	if (!map) {
+		ret = -ENOMEM;
+		goto unlock;
+	}
 
 	for (pf = 0; pf < rvu->hw->total_pfs; pf++) {
 		if (!is_pf_cgxmapped(rvu, pf))
 			continue;
+		if (rep >= cnt)
+			break;
 		pcifunc = rvu_make_pcifunc(rvu->pdev, pf, 0);
-		rvu->rep2pfvf_map[rep] = pcifunc;
+		map[rep] = pcifunc;
 		rsp->rep_pf_map[rep] = pcifunc;
 		rep++;
 		rvu_get_pf_numvfs(rvu, pf, &numvfs, &hwvf);
-		for (vf = 0; vf < numvfs; vf++) {
-			rvu->rep2pfvf_map[rep] = pcifunc |
-				((vf + 1) & RVU_PFVF_FUNC_MASK);
-			rsp->rep_pf_map[rep] = rvu->rep2pfvf_map[rep];
+		for (vf = 0; vf < numvfs && rep < cnt; vf++) {
+			map[rep] = pcifunc | ((vf + 1) & RVU_PFVF_FUNC_MASK);
+			rsp->rep_pf_map[rep] = map[rep];
 			rep++;
 		}
 	}
-	return 0;
+
+	/* Initialize even when cnt is 0, so esw_cfg drain never sees an uninitialized list. */
+	spin_lock_init(&rvu->rep_evtq_lock);
+	INIT_LIST_HEAD(&rvu->rep_evtq_head);
+	INIT_WORK(&rvu->rep_evt_work, rvu_rep_wq_handler);
+
+	if (!cnt) {
+		rsp->rep_cnt = cnt;
+		rvu->rep_cnt = cnt;
+		rvu->rep2pfvf_map = map;
+		rvu->rep_pcifunc = req->hdr.pcifunc;
+		goto unlock;
+	}
+
+	wq = alloc_workqueue("rep_evt_wq", WQ_UNBOUND, 0);
+	if (!wq) {
+		dev_err(rvu->dev, "REP workqueue allocation failed\n");
+		devm_kfree(rvu->dev, map);
+		ret = -ENOMEM;
+		goto unlock;
+	}
+
+	rvu->rep_cnt = cnt;
+	rsp->rep_cnt = cnt;
+	rvu->rep2pfvf_map = map;
+	rvu->rep_pcifunc = req->hdr.pcifunc;
+
+	/* Pairs with smp_load_acquire() in rvu_mbox_handler_rep_event_notify()
+	 * to publish the above initialization before wq becomes visible.
+	 */
+	smp_store_release(&rvu->rep_evt_wq, wq);
+unlock:
+	mutex_unlock(&rvu->rsrc_lock);
+	return ret;
 }
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_switch.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_switch.c
index 49ce38685a7e6..0897598c6edea 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_switch.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_switch.c
@@ -12,11 +12,18 @@ void rvu_switch_enable_lbk_link(struct rvu *rvu, u16 pcifunc, bool enable)
 {
 	struct rvu_pfvf *pfvf = rvu_get_pfvf(rvu, pcifunc);
 	struct nix_hw *nix_hw;
+	int blkaddr;
 
-	nix_hw = get_nix_hw(rvu->hw, pfvf->nix_blkaddr);
+	mutex_lock(&rvu->rsrc_lock);
+	blkaddr = pfvf->nix_blkaddr;
+	nix_hw = get_nix_hw(rvu->hw, blkaddr);
 	/* Enable LBK links with channel 63 for TX MCAM rule */
-	rvu_nix_tx_tl2_cfg(rvu, pfvf->nix_blkaddr, pcifunc,
+	if (!nix_hw)
+		goto unlock;
+	rvu_nix_tx_tl2_cfg(rvu, blkaddr, pcifunc,
 			   &nix_hw->txsch[NIX_TXSCH_LVL_TL2], enable);
+unlock:
+	mutex_unlock(&rvu->rsrc_lock);
 }
 
 static int rvu_switch_install_rx_rule(struct rvu *rvu, u16 pcifunc,
@@ -188,7 +195,7 @@ void rvu_switch_enable(struct rvu *rvu)
 	if (!rswitch->entry2pcifunc)
 		goto free_entries;
 
-	rswitch->used_entries = alloc_rsp.count;
+	/* Publish used_entries only after entry2pcifunc[] is fully populated. */
 	rswitch->start_entry = alloc_rsp.entry;
 
 	if (rvu->rep_mode) {
@@ -200,13 +207,25 @@ void rvu_switch_enable(struct rvu *rvu)
 	if (ret)
 		goto uninstall_rules;
 
+	mutex_lock(&rswitch->switch_lock);
+	rswitch->used_entries = alloc_rsp.count;
+	mutex_unlock(&rswitch->switch_lock);
+
 	return;
 
 uninstall_rules:
+	if (rvu->rep_mode && rvu->rep_pcifunc)
+		rvu_switch_enable_lbk_link(rvu, rvu->rep_pcifunc, false);
+
 	uninstall_req.start = rswitch->start_entry;
-	uninstall_req.end =  rswitch->start_entry + rswitch->used_entries - 1;
+	uninstall_req.end =  rswitch->start_entry + alloc_rsp.count - 1;
 	rvu_mbox_handler_npc_delete_flow(rvu, &uninstall_req, &uninstall_rsp);
+	mutex_lock(&rswitch->switch_lock);
+	rswitch->used_entries = 0;
+	rswitch->start_entry = 0;
 	kfree(rswitch->entry2pcifunc);
+	rswitch->entry2pcifunc = NULL;
+	mutex_unlock(&rswitch->switch_lock);
 free_entries:
 	free_req.all = 1;
 	rvu_mbox_handler_npc_mcam_free_entry(rvu, &free_req, &rsp);
@@ -229,8 +248,23 @@ void rvu_switch_disable(struct rvu *rvu)
 	if (!rswitch->used_entries)
 		return;
 
-	if (rvu->rep_mode)
+	if (rvu->rep_mode) {
+		if (rvu->rep_pcifunc)
+			rvu_switch_enable_lbk_link(rvu, rvu->rep_pcifunc, false);
+
+		for (pf = 1; pf < hw->total_pfs; pf++) {
+			if (!is_pf_cgxmapped(rvu, pf))
+				continue;
+			pcifunc = rvu_make_pcifunc(rvu->pdev, pf, 0);
+			rvu_switch_enable_lbk_link(rvu, pcifunc, false);
+			rvu_get_pf_numvfs(rvu, pf, &numvfs, NULL);
+			for (vf = 0; vf < numvfs; vf++) {
+				pcifunc = rvu_make_pcifunc(rvu->pdev, pf, vf + 1);
+				rvu_switch_enable_lbk_link(rvu, pcifunc, false);
+			}
+		}
 		goto free_ents;
+	}
 
 	for (pf = 1; pf < hw->total_pfs; pf++) {
 		if (!is_pf_cgxmapped(rvu, pf))
@@ -260,35 +294,46 @@ void rvu_switch_disable(struct rvu *rvu)
 	}
 
 free_ents:
+	mutex_lock(&rswitch->switch_lock);
 	uninstall_req.start = rswitch->start_entry;
-	uninstall_req.end =  rswitch->start_entry + rswitch->used_entries - 1;
+	uninstall_req.end   = rswitch->start_entry + rswitch->used_entries - 1;
+	rswitch->used_entries = 0;
+	kfree(rswitch->entry2pcifunc);
+	rswitch->entry2pcifunc = NULL;
+	mutex_unlock(&rswitch->switch_lock);
+
 	free_req.all = 1;
 	rvu_mbox_handler_npc_delete_flow(rvu, &uninstall_req, &uninstall_rsp);
 	rvu_mbox_handler_npc_mcam_free_entry(rvu, &free_req, &rsp);
-	rswitch->used_entries = 0;
-	kfree(rswitch->entry2pcifunc);
 }
 
 void rvu_switch_update_rules(struct rvu *rvu, u16 pcifunc, bool ena)
 {
 	struct rvu_switch *rswitch = &rvu->rswitch;
-	u32 max = rswitch->used_entries;
+	u16 start_entry;
 	u16 entry;
+	u32 max;
 
 	if (rvu->rep_mode)
 		return rvu_rep_update_rules(rvu, pcifunc, ena);
 
-	if (!rswitch->used_entries)
+	mutex_lock(&rswitch->switch_lock);
+	max = rswitch->used_entries;
+	if (!max) {
+		mutex_unlock(&rswitch->switch_lock);
 		return;
+	}
 
 	for (entry = 0; entry < max; entry++) {
 		if (rswitch->entry2pcifunc[entry] == pcifunc)
 			break;
 	}
+	start_entry = rswitch->start_entry;
+	mutex_unlock(&rswitch->switch_lock);
 
 	if (entry >= max)
 		return;
 
-	rvu_switch_install_tx_rule(rvu, pcifunc, rswitch->start_entry + entry);
+	rvu_switch_install_tx_rule(rvu, pcifunc, start_entry + entry);
 	rvu_switch_install_rx_rule(rvu, pcifunc, 0x0);
 }
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
index 0f5d5642d3f7a..21b5802cb9431 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/rep.c
@@ -297,11 +297,27 @@ static int rvu_rep_notify_pfvf(struct otx2_nic *priv, u16 event,
 static void rvu_rep_state_evt_handler(struct otx2_nic *priv,
 				      struct rep_event *info)
 {
+	struct rep_dev **reps;
 	struct rep_dev *rep;
 	int rep_id;
 
+	/* Capture a stable snapshot.  rvu_rep_destroy() sets priv->reps to
+	 * NULL and then calls flush_work() to wait for any in-flight handler
+	 * to finish before freeing the array, so using the local copy here
+	 * is safe for the lifetime of this function.
+	 */
+	reps = READ_ONCE(priv->reps);
+	if (!reps)
+		return;
+
 	rep_id = rvu_rep_get_repid(priv, info->pcifunc);
-	rep = priv->reps[rep_id];
+	if (rep_id < 0) {
+		dev_warn_ratelimited(priv->dev,
+				     "REP state event for unknown pcifunc 0x%x (err %d)\n",
+				     info->pcifunc, rep_id);
+		return;
+	}
+	rep = reps[rep_id];
 	if (info->evt_data.vf_state)
 		rep->flags |= RVU_REP_VF_INITIALIZED;
 	else
@@ -459,6 +475,9 @@ static int rvu_rep_open(struct net_device *dev)
 	netif_carrier_on(dev);
 	netif_tx_start_all_queues(dev);
 
+	if (rep->pcifunc & RVU_PFVF_FUNC_MASK)
+		return 0;
+
 	evt.event = RVU_EVENT_PORT_STATE;
 	evt.evt_data.port_state = 1;
 	evt.pcifunc = rep->pcifunc;
@@ -478,6 +497,13 @@ static int rvu_rep_stop(struct net_device *dev)
 	netif_carrier_off(dev);
 	netif_tx_disable(dev);
 
+	if (rep->pcifunc & RVU_PFVF_FUNC_MASK)
+		return 0;
+
+	/* Don't notify the AF during teardown */
+	if (priv->flags & OTX2_FLAG_INTF_DOWN)
+		return 0;
+
 	evt.event = RVU_EVENT_PORT_STATE;
 	evt.pcifunc = rep->pcifunc;
 	rvu_rep_notify_pfvf(priv, RVU_EVENT_PORT_STATE, &evt);
@@ -628,20 +654,27 @@ static int rvu_rep_rsrc_init(struct otx2_nic *priv)
 
 void rvu_rep_destroy(struct otx2_nic *priv)
 {
+	struct rep_dev **reps = priv->reps;
 	struct rep_dev *rep;
 	int rep_id;
 
 	rvu_eswitch_config(priv, false);
 	priv->flags |= OTX2_FLAG_INTF_DOWN;
 	rvu_rep_free_cq_rsrc(priv);
+
+	priv->reps = NULL;
+	/* Wait for any in-flight rvu_rep_state_evt_handler() using the old
+	 * reps snapshot to finish before freeing the entries below.
+	 */
+	flush_work(&priv->mbox.mbox_up_wrk);
 	for (rep_id = 0; rep_id < priv->rep_cnt; rep_id++) {
-		rep = priv->reps[rep_id];
+		rep = reps[rep_id];
 		unregister_netdev(rep->netdev);
 		rvu_rep_devlink_port_unregister(rep);
 		free_netdev(rep->netdev);
 		kfree(rep->flow_cfg);
 	}
-	kfree(priv->reps);
+	kfree(reps);
 	rvu_rep_rsrc_free(priv);
 }
 
diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/rep.h b/drivers/net/ethernet/marvell/octeontx2/nic/rep.h
index 5bc9e2c7d800b..b98fe191e83a3 100644
--- a/drivers/net/ethernet/marvell/octeontx2/nic/rep.h
+++ b/drivers/net/ethernet/marvell/octeontx2/nic/rep.h
@@ -16,7 +16,6 @@
 
 #define PCI_DEVID_RVU_REP	0xA0E0
 
-#define RVU_MAX_REP	OTX2_MAX_CQ_CNT
 
 struct rep_stats {
 	u64 rx_bytes;

3/2 2026/09/29 05:17 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 13630
							output: 42
							thoughts: 507
						

Thoughts:
**Analyzing the Patch for Fuzzing Potential**

Okay, let's break this down. My initial instinct is to assess this patch and see if it's a good candidate for fuzzing, given the guidelines we have. The patch touches files within the `drivers/net/ethernet/marvell/octeontx2` directory: specifically, `af/mbox.h`, `af/rvu.c`, `af/rvu.h`, `af/rvu_rep.c`, `af/rvu_switch.c`, `nic/rep.c`, and `nic/rep.h`.

But wait a minute... Marvell OcteonTX2. I need to be sure. I have to quickly refresh my understanding of what that actually *is*. Right, it's Marvell's SoC, a SmartNIC, or a network processor, likely a PCIe device. Specifically, it seems, it's a vendor-specific piece of hardware.

Now, let's cross-reference this with the "NEGATIVE CRITERIA" section of the instructions, section 2. This is crucial. We only return `WorthFuzzing=false` if *all* of the modified code falls into one or more of the specified categories.

Specifically, I need to check if the OcteonTX2 falls under: "Structurally unreachable hardware: Vendor-specific PCIe switches, SmartNICs, or GPU drivers... requiring physical ASIC/PCIe cards not emulated in standard QEMU". That's the key. If it *does* require physical hardware not emulated in QEMU, then it's a no-go for fuzzing.

Therefore, before I go any further, I need to determine exactly what the OcteonTX2's hardware requirements are, and whether it can be run in QEMU, virtio, or a virtual bus environment. Time to fire up `grep` and find out what I can. This is the critical piece of information.



4/2 2026/09/29 05:18 tool grepper
0m Args:
{
  "Expression": "CONFIG_OCTEONTX2",
  "PathPrefix": "drivers/net/ethernet/marvell/octeontx2"
}

Results:
{
  "Output": "drivers/net/ethernet/marvell/octeontx2/Makefile-5-\ndrivers/net/ethernet/marvell/octeontx2/Makefile:6:obj-$(CONFIG_OCTEONTX2_MBOX) += af/\ndrivers/net/ethernet/marvell/octeontx2/Makefile:7:obj-$(CONFIG_OCTEONTX2_AF) += af/\ndrivers/net/ethernet/marvell/octeontx2/Makefile:8:obj-$(CONFIG_OCTEONTX2_PF) += nic/\n--\ndrivers/net/ethernet/marvell/octeontx2/af/Makefile=6=ccflags-y += -I$(src)\ndrivers/net/ethernet/marvell/octeontx2/af/Makefile:7:obj-$(CONFIG_OCTEONTX2_MBOX) += rvu_mbox.o\ndrivers/net/ethernet/marvell/octeontx2/af/Makefile:8:obj-$(CONFIG_OCTEONTX2_AF) += rvu_af.o\ndrivers/net/ethernet/marvell/octeontx2/af/Makefile-9-\n--\ndrivers/net/ethernet/marvell/octeontx2/nic/Makefile-5-\ndrivers/net/ethernet/marvell/octeontx2/nic/Makefile:6:obj-$(CONFIG_OCTEONTX2_PF) += rvu_nicpf.o otx2_ptp.o\ndrivers/net/ethernet/marvell/octeontx2/nic/Makefile:7:obj-$(CONFIG_OCTEONTX2_VF) += rvu_nicvf.o otx2_ptp.o\ndrivers/net/ethernet/marvell/octeontx2/nic/Makefile-8-obj-$(CONFIG_RVU_ESWITCH) += rvu_rep.o\n"
}

5/2 2026/09/29 05:18 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 15064
							output: 36
							thoughts: 25
						

Thoughts:
Here's my thought process, as if I were considering this myself:

**Kconfig Review for OCTEONTX2 Configurations**

Okay, time to dive into the Kconfig files. My initial thought is to quickly verify the presence and configuration of the OCTEONTX2-related symbols. Specifically, I need to see how `OCTEONTX2_AF`, `OCTEONTX2_PF`, and any related options are defined and handled. I need to understand the dependencies and relationships these symbols have with other features and hardware configurations within the system. Are they tristate or boolean? What's the default value for each? This will help me understand which features are enabled, disabled, or selectable based on the broader system setup, and identify any potential conflicts or areas where I need to take a closer look. I'll need to pay close attention to the implications of these configurations on the driver code and hardware initialization sequence. Any conditional includes, or dependencies will be noted.



6/2 2026/09/29 05:18 tool grepper
0m Args:
{
  "Expression": "config OCTEONTX2",
  "PathPrefix": "drivers/net/ethernet/marvell/"
}

Results:
{
  "Output": "drivers/net/ethernet/marvell/octeontx2/Kconfig-5-\ndrivers/net/ethernet/marvell/octeontx2/Kconfig:6:config OCTEONTX2_MBOX\ndrivers/net/ethernet/marvell/octeontx2/Kconfig-7-\ttristate\ndrivers/net/ethernet/marvell/octeontx2/Kconfig-8-\ndrivers/net/ethernet/marvell/octeontx2/Kconfig:9:config OCTEONTX2_AF\ndrivers/net/ethernet/marvell/octeontx2/Kconfig-10-\ttristate \"Marvell OcteonTX2 RVU Admin Function driver\"\n--\ndrivers/net/ethernet/marvell/octeontx2/Kconfig=22=config NDC_DIS_DYNAMIC_CACHING\n--\ndrivers/net/ethernet/marvell/octeontx2/Kconfig-30-\ndrivers/net/ethernet/marvell/octeontx2/Kconfig:31:config OCTEONTX2_PF\ndrivers/net/ethernet/marvell/octeontx2/Kconfig-32-\ttristate \"Marvell OcteonTX2 NIC Physical Function driver\"\n--\ndrivers/net/ethernet/marvell/octeontx2/Kconfig-44-\ndrivers/net/ethernet/marvell/octeontx2/Kconfig:45:config OCTEONTX2_VF\ndrivers/net/ethernet/marvell/octeontx2/Kconfig-46-\ttristate \"Marvell OcteonTX2 NIC Virtual Function driver\"\n"
}

7/2 2026/09/29 05:18 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 15740
							output: 44
							thoughts: 30
						

Thoughts:
Okay, here's my interpretation of that request, formatted for a user who's deeply familiar with kernel configuration.

**Diving into the OcteonTX2 Ethernet Driver Configuration**

Alright, let's pull up the Kconfig file for the OcteonTX2 Ethernet driver. I need to get a clear picture of its configuration options, so I'm focusing on lines 1 through 60, right at the start. I’m thinking there's a good chance that section will cover the core driver module enable/disable switches, perhaps some basic hardware feature flags, and potentially the very initial options for things like firmware selection or base address configurations. Knowing my usual starting point, I anticipate these first lines will provide the groundwork and outline the fundamental architecture options I'm going to want to examine. I'll need to understand the initial flags and dependencies before I dive deeper into the more nuanced configurations. It's time to get a feel for how this driver is structured at its most fundamental level.



8/2 2026/09/29 05:18 tool read-file
0m Args:
{
  "File": "drivers/net/ethernet/marvell/octeontx2/Kconfig",
  "FirstLine": 1,
  "LineCount": 60
}

Results:
{
  "Contents": "   1:\t# SPDX-License-Identifier: GPL-2.0-only\n   2:\t#\n   3:\t# Marvell RVU Network drivers configuration\n   4:\t#\n   5:\t\n   6:\tconfig OCTEONTX2_MBOX\n   7:\t\ttristate\n   8:\t\n   9:\tconfig OCTEONTX2_AF\n  10:\t\ttristate \"Marvell OcteonTX2 RVU Admin Function driver\"\n  11:\t\tselect OCTEONTX2_MBOX\n  12:\t\tselect NET_DEVLINK\n  13:\t\tdepends on (64BIT \u0026\u0026 COMPILE_TEST) || ARM64\n  14:\t\tdepends on PCI\n  15:\t\tdepends on PTP_1588_CLOCK_OPTIONAL\n  16:\t\thelp\n  17:\t\t  This driver supports Marvell's OcteonTX2 Resource Virtualization\n  18:\t\t  Unit's admin function manager which manages all RVU HW resources\n  19:\t\t  and provides a medium to other PF/VFs to configure HW. Should be\n  20:\t\t  enabled for other RVU device drivers to work.\n  21:\t\n  22:\tconfig NDC_DIS_DYNAMIC_CACHING\n  23:\t\tbool \"Disable caching of dynamic entries in NDC\"\n  24:\t\tdepends on OCTEONTX2_AF\n  25:\t\tdefault n\n  26:\t\thelp\n  27:\t\t  This config option disables caching of dynamic entries such as NIX SQEs\n  28:\t\t  , NPA stack pages etc in NDC. Also locks down NIX SQ/CQ/RQ/RSS and\n  29:\t\t  NPA Aura/Pool contexts.\n  30:\t\n  31:\tconfig OCTEONTX2_PF\n  32:\t\ttristate \"Marvell OcteonTX2 NIC Physical Function driver\"\n  33:\t\tselect OCTEONTX2_MBOX\n  34:\t\tselect NET_DEVLINK\n  35:\t\tselect PAGE_POOL\n  36:\t\tselect CRYPTO_LIB_AES if MACSEC\n  37:\t\tdepends on (64BIT \u0026\u0026 COMPILE_TEST) || ARM64\n  38:\t\tselect DIMLIB\n  39:\t\tdepends on PCI\n  40:\t\tdepends on PTP_1588_CLOCK_OPTIONAL\n  41:\t\tdepends on MACSEC || !MACSEC\n  42:\t\thelp\n  43:\t\t  This driver supports Marvell's OcteonTX2 NIC physical function.\n  44:\t\n  45:\tconfig OCTEONTX2_VF\n  46:\t\ttristate \"Marvell OcteonTX2 NIC Virtual Function driver\"\n  47:\t\tdepends on OCTEONTX2_PF\n  48:\t\thelp\n  49:\t\t  This driver supports Marvell's OcteonTX2 NIC virtual function.\n  50:\t\n  51:\tconfig RVU_ESWITCH\n  52:\t\ttristate \"Marvell RVU E-Switch support\"\n  53:\t\tdepends on OCTEONTX2_PF\n  54:\t\tdefault m\n  55:\t\thelp\n  56:\t\t  This driver supports Marvell's RVU E-Switch that\n  57:\t\t  provides internal SRIOV packet steering and switching.\n"
}

9/2 2026/09/29 05:18 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 16836
							output: 43
							thoughts: 152
						

Thoughts:
**Analyzing the OcteonTX2 RVU Network Driver Dependency**

Okay, so I'm looking at this code and immediately I see a dependency: `(64BIT && COMPILE_TEST) || ARM64`. This is the clue. This network driver is tied to the Marvell OcteonTX2 RVU – the Resource Virtualization Unit. My first thought is whether this hardware is emulated within standard QEMU. That's a crucial question.

The OcteonTX2 is a well-known Marvell processor, a CN9xxx / CN10xxx ARM64 SoC, essentially a SmartNIC or Octeon processor. But, my immediate recollection is that neither standard QEMU nor GCE (regardless of whether it's amd64/x86_64 or standard arm64) offers a direct emulation of the OcteonTX2 RVU PCIe card. They might have a generic ARM64 setup, but not this specific hardware.

So, the next logical step is to dive into the PCI device IDs used by the `rvu` and `otx2` components. Knowing those IDs will tell me which hardware the driver is designed for. Knowing the specific device IDs is key to my understanding.



10/2 2026/09/29 05:18 tool grepper
0m Args:
{
  "Expression": "PCI_DEVICE.*PCI_VENDOR_ID_CAVIUM",
  "PathPrefix": "drivers/net/ethernet/marvell/"
}

Results:
{
  "Output": "drivers/net/ethernet/marvell/octeon_ep/octep_main.c=25=static const struct pci_device_id octep_pci_id_tbl[] = {\ndrivers/net/ethernet/marvell/octeon_ep/octep_main.c:26:\t{PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, OCTEP_PCI_DEVICE_ID_CN98_PF)},\ndrivers/net/ethernet/marvell/octeon_ep/octep_main.c:27:\t{PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, OCTEP_PCI_DEVICE_ID_CN93_PF)},\ndrivers/net/ethernet/marvell/octeon_ep/octep_main.c:28:\t{PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, OCTEP_PCI_DEVICE_ID_CNF95N_PF)},\ndrivers/net/ethernet/marvell/octeon_ep/octep_main.c:29:\t{PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, OCTEP_PCI_DEVICE_ID_CN10KA_PF)},\ndrivers/net/ethernet/marvell/octeon_ep/octep_main.c:30:\t{PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, OCTEP_PCI_DEVICE_ID_CNF10KA_PF)},\ndrivers/net/ethernet/marvell/octeon_ep/octep_main.c:31:\t{PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, OCTEP_PCI_DEVICE_ID_CNF10KB_PF)},\ndrivers/net/ethernet/marvell/octeon_ep/octep_main.c:32:\t{PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, OCTEP_PCI_DEVICE_ID_CN10KB_PF)},\ndrivers/net/ethernet/marvell/octeon_ep/octep_main.c-33-\t{0, },\n--\ndrivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c=22=static const struct pci_device_id octep_vf_pci_id_tbl[] = {\ndrivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c:23:\t{PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, OCTEP_PCI_DEVICE_ID_CN93_VF)},\ndrivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c:24:\t{PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, OCTEP_PCI_DEVICE_ID_CNF95N_VF)},\ndrivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c:25:\t{PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, OCTEP_PCI_DEVICE_ID_CN98_VF)},\ndrivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c:26:\t{PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, OCTEP_PCI_DEVICE_ID_CN10KA_VF)},\ndrivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c:27:\t{PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, OCTEP_PCI_DEVICE_ID_CNF10KA_VF)},\ndrivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c:28:\t{PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, OCTEP_PCI_DEVICE_ID_CNF10KB_VF)},\ndrivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c:29:\t{PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, OCTEP_PCI_DEVICE_ID_CN10KB_VF)},\ndrivers/net/ethernet/marvell/octeon_ep_vf/octep_vf_main.c-30-\t{0, },\n--\ndrivers/net/ethernet/marvell/octeontx2/af/cgx.c=66=static const struct pci_device_id cgx_id_table[] = {\ndrivers/net/ethernet/marvell/octeontx2/af/cgx.c:67:\t{ PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_OCTEONTX2_CGX) },\ndrivers/net/ethernet/marvell/octeontx2/af/cgx.c:68:\t{ PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_CN10K_RPM,\ndrivers/net/ethernet/marvell/octeontx2/af/cgx.c-69-\t  PCI_ANY_ID, PCI_SUBSYS_DEVID_CN10K_A) },\ndrivers/net/ethernet/marvell/octeontx2/af/cgx.c:70:\t{ PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_CN10K_RPM,\ndrivers/net/ethernet/marvell/octeontx2/af/cgx.c-71-\t  PCI_ANY_ID, PCI_SUBSYS_DEVID_CNF10K_A) },\ndrivers/net/ethernet/marvell/octeontx2/af/cgx.c:72:\t{ PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_CN10K_RPM,\ndrivers/net/ethernet/marvell/octeontx2/af/cgx.c-73-\t  PCI_ANY_ID, PCI_SUBSYS_DEVID_CNF10K_B) },\ndrivers/net/ethernet/marvell/octeontx2/af/cgx.c:74:\t{ PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_CN10KB_RPM,\ndrivers/net/ethernet/marvell/octeontx2/af/cgx.c-75-\t  PCI_ANY_ID, PCI_SUBSYS_DEVID_CN10K_B) },\ndrivers/net/ethernet/marvell/octeontx2/af/cgx.c:76:\t{ PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_CN10KB_RPM,\ndrivers/net/ethernet/marvell/octeontx2/af/cgx.c-77-\t  PCI_ANY_ID, PCI_SUBSYS_DEVID_CN20KA) },\ndrivers/net/ethernet/marvell/octeontx2/af/cgx.c:78:\t{ PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_CN10KB_RPM,\ndrivers/net/ethernet/marvell/octeontx2/af/cgx.c-79-\t  PCI_ANY_ID, PCI_SUBSYS_DEVID_CNF20KA) },\n--\ndrivers/net/ethernet/marvell/octeontx2/af/mcs.c=20=static const struct pci_device_id mcs_id_table[] = {\ndrivers/net/ethernet/marvell/octeontx2/af/mcs.c:21:\t{ PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_CN10K_MCS) },\ndrivers/net/ethernet/marvell/octeontx2/af/mcs.c-22-\t{ 0, }  /* end of table */\n--\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c=589=static const struct pci_device_id ptp_id_table[] = {\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c:590:\t{ PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_OCTEONTX2_PTP,\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c-591-\t\t\t PCI_VENDOR_ID_CAVIUM,\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c-592-\t\t\t PCI_SUBSYS_DEVID_OCTX2_98xx_PTP) },\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c:593:\t{ PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_OCTEONTX2_PTP,\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c-594-\t\t\t PCI_VENDOR_ID_CAVIUM,\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c-595-\t\t\t PCI_SUBSYS_DEVID_OCTX2_96XX_PTP) },\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c:596:\t{ PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_OCTEONTX2_PTP,\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c-597-\t\t\t PCI_VENDOR_ID_CAVIUM,\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c-598-\t\t\t PCI_SUBSYS_DEVID_OCTX2_95XX_PTP) },\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c:599:\t{ PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_OCTEONTX2_PTP,\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c-600-\t\t\t PCI_VENDOR_ID_CAVIUM,\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c-601-\t\t\t PCI_SUBSYS_DEVID_OCTX2_95XXN_PTP) },\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c:602:\t{ PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_OCTEONTX2_PTP,\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c-603-\t\t\t PCI_VENDOR_ID_CAVIUM,\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c-604-\t\t\t PCI_SUBSYS_DEVID_OCTX2_95MM_PTP) },\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c:605:\t{ PCI_DEVICE_SUB(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_OCTEONTX2_PTP,\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c-606-\t\t\t PCI_VENDOR_ID_CAVIUM,\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c-607-\t\t\t PCI_SUBSYS_DEVID_OCTX2_95XXO_PTP) },\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c:608:\t{ PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_CN10K_PTP) },\ndrivers/net/ethernet/marvell/octeontx2/af/ptp.c-609-\t{ 0, }\n--\ndrivers/net/ethernet/marvell/octeontx2/af/rvu.c=44=static const struct pci_device_id rvu_id_table[] = {\ndrivers/net/ethernet/marvell/octeontx2/af/rvu.c:45:\t{ PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_OCTEONTX2_RVU_AF) },\ndrivers/net/ethernet/marvell/octeontx2/af/rvu.c-46-\t{ 0, }  /* end of table */\n--\ndrivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c=36=static const struct pci_device_id otx2_pf_id_table[] = {\ndrivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c:37:\t{ PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_OCTEONTX2_RVU_PF) },\ndrivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c-38-\t{ 0, }  /* end of table */\n--\ndrivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c=22=static const struct pci_device_id otx2_vf_id_table[] = {\ndrivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c:23:\t{ PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_OCTEONTX2_RVU_AFVF) },\ndrivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c:24:\t{ PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_OCTEONTX2_RVU_VF) },\ndrivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c:25:\t{ PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_OCTEONTX2_SDP_REP) },\ndrivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c-26-\t{ }\n--\ndrivers/net/ethernet/marvell/octeontx2/nic/rep.c=22=static const struct pci_device_id rvu_rep_id_table[] = {\ndrivers/net/ethernet/marvell/octeontx2/nic/rep.c:23:\t{ PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_RVU_REP) },\ndrivers/net/ethernet/marvell/octeontx2/nic/rep.c-24-\t{ }\n"
}

11/2 2026/09/29 05:18 llm patch-evaluator
0m Model:
gemini-3.8-flash

Args:
null

Results:
null

Tokens:
							input: 20967
							output: 119
							thoughts: 780
						

Thoughts:
**Analysis of the Marvell OcteonTX2 RVU Driver for Fuzzing Suitability**

Okay, here's the breakdown. I've examined the code changes and the target hardware. The vendor ID `PCI_VENDOR_ID_CAVIUM` (0x177d) instantly flags this as related to Marvell's (formerly Cavium) OcteonTX2 RVU architecture. These are physical SmartNICs and network SoCs – a specific class of hardware. The driver code specifically handles the AF, PF, VF, and REP functions within the OcteonTX2's Resource Virtualization Unit.

I've confirmed that these drivers operate on the silicon/hardware itself. They are not emulated in standard QEMU or GCE environments.

The modifications are strictly confined to `drivers/net/ethernet/marvell/octeontx2/`. This is a clear indicator. The files like `mbox.h`, `rvu.c`, `rvu_rep.c`, etc., are all part of that Marvell/OcteonTX2 ecosystem. They depend on the presence of the physical OcteonTX2 hardware, which means the drivers cannot probe, bind, or execute without the physical ASIC.

Now, the instructions are clear: This falls squarely into the "structurally unreachable hardware" category. The drivers are vendor-specific SmartNIC drivers that require physical PCIe cards not emulated in standard QEMU. That's a perfect match for the exclusion criteria outlined.

Just to be thorough, I verified that none of the modified code touches generic core subsystems or virtual drivers like virtio, USB gadget, or netlink. This confirms the isolation.

Therefore, because this driver targets a specific, non-emulated hardware, fuzzing it in a standard virtualized environment is pointless. The `WorthFuzzing` flag should be set to `false`. Consequently, the `FocusSymbols` and `EnableConfigs` arrays should be empty.

The reasoning is straightforward: vendor-specific Marvell OcteonTX2 SmartNIC / RVU network driver requiring physical ASIC/PCIe hardware that is not emulated in standard virtualized QEMU/GCE environments.

Time to call `set-results`.



12/2 2026/09/29 05:18 tool set-results
0m Args:
{
  "EnableConfigs": [],
  "FocusSymbols": [],
  "Reasoning": "The patch modifies the Marvell OcteonTX2 RVU (Resource Virtualization Unit) driver under drivers/net/ethernet/marvell/octeontx2/. This is vendor-specific SmartNIC / network processor hardware requiring physical PCIe devices (PCI_VENDOR_ID_CAVIUM) not emulated in standard QEMU or GCE virtualized environments, making the modified code structurally unreachable for fuzzing.",
  "WorthFuzzing": false
}

Results:
{
  "EnableConfigs": null,
  "FocusSymbols": [],
  "Reasoning": "The patch modifies the Marvell OcteonTX2 RVU (Resource Virtualization Unit) driver under drivers/net/ethernet/marvell/octeontx2/. This is vendor-specific SmartNIC / network processor hardware requiring physical PCIe devices (PCI_VENDOR_ID_CAVIUM) not emulated in standard QEMU or GCE virtualized environments, making the modified code structurally unreachable for fuzzing.",
  "WorthFuzzing": false
}

13/1 2026/09/29 05:18 action If
0m Args:
{
  "WorthFuzzing": false
}

Results:
null

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)