@@ -1310,20 +1310,25 @@ static void idpf_set_msglevel(struct net_device *netdev, u32 data)
static int idpf_get_link_ksettings(struct net_device *netdev,
struct ethtool_link_ksettings *cmd)
{
+ struct idpf_adapter *adapter = idpf_netdev_to_adapter(netdev);
struct idpf_vport *vport;
- idpf_vport_ctrl_lock(netdev);
- vport = idpf_netdev_to_vport(netdev);
-
ethtool_link_ksettings_zero_link_mode(cmd, supported);
cmd->base.autoneg = AUTONEG_DISABLE;
cmd->base.port = PORT_NONE;
+ cmd->base.duplex = DUPLEX_UNKNOWN;
+ cmd->base.speed = SPEED_UNKNOWN;
+
+ if (idpf_is_reset_in_prog(adapter) ||
+ test_bit(IDPF_REMOVE_IN_PROG, adapter->flags))
+ return 0;
+
+ idpf_vport_ctrl_lock(netdev);
+ vport = idpf_netdev_to_vport(netdev);
+
if (vport->link_up) {
cmd->base.duplex = DUPLEX_FULL;
cmd->base.speed = vport->link_speed_mbps;
- } else {
- cmd->base.duplex = DUPLEX_UNKNOWN;
- cmd->base.speed = SPEED_UNKNOWN;
}
idpf_vport_ctrl_unlock(netdev);