]> www.infradead.org Git - users/jedix/linux-maple.git/commit
idpf: avoid vport access in idpf_get_link_ksettings
authorPavan Kumar Linga <pavan.kumar.linga@intel.com>
Fri, 25 Oct 2024 18:38:42 +0000 (11:38 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Mon, 4 Nov 2024 21:09:33 +0000 (13:09 -0800)
commit81d2fb4c7c18a3b36ba3e00b9d5b753107472d75
treeebcbf34cac6b0ccd0bf9547040a29ba3967c144c
parent64502dac974a5d9951d16015fa2e16a14e5f2bb2
idpf: avoid vport access in idpf_get_link_ksettings

When the device control plane is removed or the platform
running device control plane is rebooted, a reset is detected
on the driver. On driver reset, it releases the resources and
waits for the reset to complete. If the reset fails, it takes
the error path and releases the vport lock. At this time if the
monitoring tools tries to access link settings, it call traces
for accessing released vport pointer.

To avoid it, move link_speed_mbps to netdev_priv structure
which removes the dependency on vport pointer and the vport lock
in idpf_get_link_ksettings. Also use netif_carrier_ok()
to check the link status and adjust the offsetof to use link_up
instead of link_speed_mbps.

Fixes: 02cbfba1add5 ("idpf: add ethtool callbacks")
Cc: stable@vger.kernel.org # 6.7+
Reviewed-by: Tarun K Singh <tarun.k.singh@intel.com>
Signed-off-by: Pavan Kumar Linga <pavan.kumar.linga@intel.com>
Tested-by: Krishneil Singh <krishneil.k.singh@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/idpf/idpf.h
drivers/net/ethernet/intel/idpf/idpf_ethtool.c
drivers/net/ethernet/intel/idpf/idpf_lib.c
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c