Commit 0ecff05e authored by Petr Oros's avatar Petr Oros Committed by Tony Nguyen

Revert "ice: Fix ice VF reset during iavf initialization"

This reverts commit 7255355a.

After this commit we are not able to attach VF to VM:
virsh attach-interface v0 hostdev --managed 0000:41:01.0 --mac 52:52:52:52:52:52
error: Failed to attach interface
error: Cannot set interface MAC to 52:52:52:52:52:52 for ifname enp65s0f0np0 vf 0: Resource temporarily unavailable

ice_check_vf_ready_for_cfg() already contain waiting for reset.
New condition in ice_check_vf_ready_for_reset() causing only problems.

Fixes: 7255355a ("ice: Fix ice VF reset during iavf initialization")
Signed-off-by: default avatarPetr Oros <poros@redhat.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Reviewed-by: default avatarPrzemek Kitszel <przemyslaw.kitszel@intel.com>
Reviewed-by: default avatarJacob Keller <jacob.e.keller@intel.com>
Tested-by: default avatarRafal Romanowski <rafal.romanowski@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 10083aef
...@@ -1131,7 +1131,7 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena) ...@@ -1131,7 +1131,7 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena)
if (!vf) if (!vf)
return -EINVAL; return -EINVAL;
ret = ice_check_vf_ready_for_reset(vf); ret = ice_check_vf_ready_for_cfg(vf);
if (ret) if (ret)
goto out_put_vf; goto out_put_vf;
...@@ -1246,7 +1246,7 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac) ...@@ -1246,7 +1246,7 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
goto out_put_vf; goto out_put_vf;
} }
ret = ice_check_vf_ready_for_reset(vf); ret = ice_check_vf_ready_for_cfg(vf);
if (ret) if (ret)
goto out_put_vf; goto out_put_vf;
...@@ -1300,7 +1300,7 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted) ...@@ -1300,7 +1300,7 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted)
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
ret = ice_check_vf_ready_for_reset(vf); ret = ice_check_vf_ready_for_cfg(vf);
if (ret) if (ret)
goto out_put_vf; goto out_put_vf;
...@@ -1613,7 +1613,7 @@ ice_set_vf_port_vlan(struct net_device *netdev, int vf_id, u16 vlan_id, u8 qos, ...@@ -1613,7 +1613,7 @@ ice_set_vf_port_vlan(struct net_device *netdev, int vf_id, u16 vlan_id, u8 qos,
if (!vf) if (!vf)
return -EINVAL; return -EINVAL;
ret = ice_check_vf_ready_for_reset(vf); ret = ice_check_vf_ready_for_cfg(vf);
if (ret) if (ret)
goto out_put_vf; goto out_put_vf;
......
...@@ -185,25 +185,6 @@ int ice_check_vf_ready_for_cfg(struct ice_vf *vf) ...@@ -185,25 +185,6 @@ int ice_check_vf_ready_for_cfg(struct ice_vf *vf)
return 0; return 0;
} }
/**
* ice_check_vf_ready_for_reset - check if VF is ready to be reset
* @vf: VF to check if it's ready to be reset
*
* The purpose of this function is to ensure that the VF is not in reset,
* disabled, and is both initialized and active, thus enabling us to safely
* initialize another reset.
*/
int ice_check_vf_ready_for_reset(struct ice_vf *vf)
{
int ret;
ret = ice_check_vf_ready_for_cfg(vf);
if (!ret && !test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states))
ret = -EAGAIN;
return ret;
}
/** /**
* ice_trigger_vf_reset - Reset a VF on HW * ice_trigger_vf_reset - Reset a VF on HW
* @vf: pointer to the VF structure * @vf: pointer to the VF structure
......
...@@ -215,7 +215,6 @@ u16 ice_get_num_vfs(struct ice_pf *pf); ...@@ -215,7 +215,6 @@ u16 ice_get_num_vfs(struct ice_pf *pf);
struct ice_vsi *ice_get_vf_vsi(struct ice_vf *vf); struct ice_vsi *ice_get_vf_vsi(struct ice_vf *vf);
bool ice_is_vf_disabled(struct ice_vf *vf); bool ice_is_vf_disabled(struct ice_vf *vf);
int ice_check_vf_ready_for_cfg(struct ice_vf *vf); int ice_check_vf_ready_for_cfg(struct ice_vf *vf);
int ice_check_vf_ready_for_reset(struct ice_vf *vf);
void ice_set_vf_state_dis(struct ice_vf *vf); void ice_set_vf_state_dis(struct ice_vf *vf);
bool ice_is_any_vf_in_unicast_promisc(struct ice_pf *pf); bool ice_is_any_vf_in_unicast_promisc(struct ice_pf *pf);
void void
......
...@@ -3947,7 +3947,6 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event, ...@@ -3947,7 +3947,6 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event,
ice_vc_notify_vf_link_state(vf); ice_vc_notify_vf_link_state(vf);
break; break;
case VIRTCHNL_OP_RESET_VF: case VIRTCHNL_OP_RESET_VF:
clear_bit(ICE_VF_STATE_ACTIVE, vf->vf_states);
ops->reset_vf(vf); ops->reset_vf(vf);
break; break;
case VIRTCHNL_OP_ADD_ETH_ADDR: case VIRTCHNL_OP_ADD_ETH_ADDR:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment