Skip to content

Commit 4821d56

Browse files
michichanguy11
authored andcommitted
ixgbevf: add missing negotiate_features op to Hyper-V ops table
Commit a7075f5 ("ixgbevf: fix mailbox API compatibility by negotiating supported features") added the .negotiate_features callback to ixgbe_mac_operations and populated it in ixgbevf_mac_ops, but forgot to add it to ixgbevf_hv_mac_ops. This leaves the function pointer NULL on Hyper-V VMs. During probe, ixgbevf_negotiate_api() calls ixgbevf_set_features(), which unconditionally dereferences hw->mac.ops.negotiate_features(). On Hyper-V this results in a NULL pointer dereference: BUG: kernel NULL pointer dereference, address: 0000000000000000 [...] Hardware name: Microsoft Corporation Virtual Machine/Virtual Machine [...] Workqueue: events work_for_cpu_fn RIP: 0010:0x0 [...] Call Trace: ixgbevf_negotiate_api+0x66/0x160 [ixgbevf] ixgbevf_sw_init+0xe4/0x1f0 [ixgbevf] ixgbevf_probe+0x20f/0x4a0 [ixgbevf] local_pci_probe+0x50/0xa0 work_for_cpu_fn+0x1a/0x30 [...] Add ixgbevf_hv_negotiate_features_vf() that returns -EOPNOTSUPP and wire it into ixgbevf_hv_mac_ops. The caller already handles -EOPNOTSUPP gracefully. Fixes: a7075f5 ("ixgbevf: fix mailbox API compatibility by negotiating supported features") Reported-by: Xiaoqiang Xiong <xxiong@redhat.com> Closes: https://issues.redhat.com/browse/RHEL-155455 Assisted-by: Claude:claude-4.6-opus-high Cursor Tested-by: Xiaoqiang Xiong <xxiong@redhat.com> Signed-off-by: Michal Schmidt <mschmidt@redhat.com> Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent d8ae40d commit 4821d56

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

  • drivers/net/ethernet/intel/ixgbevf

drivers/net/ethernet/intel/ixgbevf/vf.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -709,6 +709,12 @@ static int ixgbevf_negotiate_features_vf(struct ixgbe_hw *hw, u32 *pf_features)
709709
return err;
710710
}
711711

712+
static int ixgbevf_hv_negotiate_features_vf(struct ixgbe_hw *hw,
713+
u32 *pf_features)
714+
{
715+
return -EOPNOTSUPP;
716+
}
717+
712718
/**
713719
* ixgbevf_set_vfta_vf - Set/Unset VLAN filter table address
714720
* @hw: pointer to the HW structure
@@ -1142,6 +1148,7 @@ static const struct ixgbe_mac_operations ixgbevf_hv_mac_ops = {
11421148
.setup_link = ixgbevf_setup_mac_link_vf,
11431149
.check_link = ixgbevf_hv_check_mac_link_vf,
11441150
.negotiate_api_version = ixgbevf_hv_negotiate_api_version_vf,
1151+
.negotiate_features = ixgbevf_hv_negotiate_features_vf,
11451152
.set_rar = ixgbevf_hv_set_rar_vf,
11461153
.update_mc_addr_list = ixgbevf_hv_update_mc_addr_list_vf,
11471154
.update_xcast_mode = ixgbevf_hv_update_xcast_mode,

0 commit comments

Comments
 (0)