Skip to content

Commit ddad310

Browse files
orospsmb49
authored andcommitted
Revert "ice: Fix ice VF reset during iavf initialization"
BugLink: https://bugs.launchpad.net/bugs/2039742 [ Upstream commit 0ecff05 ] This reverts commit 7255355. 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: 7255355 ("ice: Fix ice VF reset during iavf initialization") Signed-off-by: Petr Oros <poros@redhat.com> Reviewed-by: Simon Horman <horms@kernel.org> Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com> Tested-by: Rafal Romanowski <rafal.romanowski@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Kamal Mostafa <kamal@canonical.com> Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
1 parent 5d52fe5 commit ddad310

File tree

4 files changed

+4
-25
lines changed

4 files changed

+4
-25
lines changed

drivers/net/ethernet/intel/ice/ice_sriov.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@ int ice_set_vf_spoofchk(struct net_device *netdev, int vf_id, bool ena)
12401240
if (!vf)
12411241
return -EINVAL;
12421242

1243-
ret = ice_check_vf_ready_for_reset(vf);
1243+
ret = ice_check_vf_ready_for_cfg(vf);
12441244
if (ret)
12451245
goto out_put_vf;
12461246

@@ -1355,7 +1355,7 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
13551355
goto out_put_vf;
13561356
}
13571357

1358-
ret = ice_check_vf_ready_for_reset(vf);
1358+
ret = ice_check_vf_ready_for_cfg(vf);
13591359
if (ret)
13601360
goto out_put_vf;
13611361

@@ -1409,7 +1409,7 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted)
14091409
return -EOPNOTSUPP;
14101410
}
14111411

1412-
ret = ice_check_vf_ready_for_reset(vf);
1412+
ret = ice_check_vf_ready_for_cfg(vf);
14131413
if (ret)
14141414
goto out_put_vf;
14151415

@@ -1722,7 +1722,7 @@ ice_set_vf_port_vlan(struct net_device *netdev, int vf_id, u16 vlan_id, u8 qos,
17221722
if (!vf)
17231723
return -EINVAL;
17241724

1725-
ret = ice_check_vf_ready_for_reset(vf);
1725+
ret = ice_check_vf_ready_for_cfg(vf);
17261726
if (ret)
17271727
goto out_put_vf;
17281728

drivers/net/ethernet/intel/ice/ice_vf_lib.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -185,25 +185,6 @@ int ice_check_vf_ready_for_cfg(struct ice_vf *vf)
185185
return 0;
186186
}
187187

188-
/**
189-
* ice_check_vf_ready_for_reset - check if VF is ready to be reset
190-
* @vf: VF to check if it's ready to be reset
191-
*
192-
* The purpose of this function is to ensure that the VF is not in reset,
193-
* disabled, and is both initialized and active, thus enabling us to safely
194-
* initialize another reset.
195-
*/
196-
int ice_check_vf_ready_for_reset(struct ice_vf *vf)
197-
{
198-
int ret;
199-
200-
ret = ice_check_vf_ready_for_cfg(vf);
201-
if (!ret && !test_bit(ICE_VF_STATE_ACTIVE, vf->vf_states))
202-
ret = -EAGAIN;
203-
204-
return ret;
205-
}
206-
207188
/**
208189
* ice_trigger_vf_reset - Reset a VF on HW
209190
* @vf: pointer to the VF structure

drivers/net/ethernet/intel/ice/ice_vf_lib.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ u16 ice_get_num_vfs(struct ice_pf *pf);
214214
struct ice_vsi *ice_get_vf_vsi(struct ice_vf *vf);
215215
bool ice_is_vf_disabled(struct ice_vf *vf);
216216
int ice_check_vf_ready_for_cfg(struct ice_vf *vf);
217-
int ice_check_vf_ready_for_reset(struct ice_vf *vf);
218217
void ice_set_vf_state_dis(struct ice_vf *vf);
219218
bool ice_is_any_vf_in_unicast_promisc(struct ice_pf *pf);
220219
void

drivers/net/ethernet/intel/ice/ice_virtchnl.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3908,7 +3908,6 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event)
39083908
ice_vc_notify_vf_link_state(vf);
39093909
break;
39103910
case VIRTCHNL_OP_RESET_VF:
3911-
clear_bit(ICE_VF_STATE_ACTIVE, vf->vf_states);
39123911
ops->reset_vf(vf);
39133912
break;
39143913
case VIRTCHNL_OP_ADD_ETH_ADDR:

0 commit comments

Comments
 (0)