Skip to content

Commit 0ecff05

Browse files
orospanguy11
authored andcommitted
Revert "ice: Fix ice VF reset during iavf initialization"
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>
1 parent 10083ae commit 0ecff05

4 files changed

Lines changed: 4 additions & 25 deletions

File tree

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

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

1134-
ret = ice_check_vf_ready_for_reset(vf);
1134+
ret = ice_check_vf_ready_for_cfg(vf);
11351135
if (ret)
11361136
goto out_put_vf;
11371137

@@ -1246,7 +1246,7 @@ int ice_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
12461246
goto out_put_vf;
12471247
}
12481248

1249-
ret = ice_check_vf_ready_for_reset(vf);
1249+
ret = ice_check_vf_ready_for_cfg(vf);
12501250
if (ret)
12511251
goto out_put_vf;
12521252

@@ -1300,7 +1300,7 @@ int ice_set_vf_trust(struct net_device *netdev, int vf_id, bool trusted)
13001300
return -EOPNOTSUPP;
13011301
}
13021302

1303-
ret = ice_check_vf_ready_for_reset(vf);
1303+
ret = ice_check_vf_ready_for_cfg(vf);
13041304
if (ret)
13051305
goto out_put_vf;
13061306

@@ -1613,7 +1613,7 @@ ice_set_vf_port_vlan(struct net_device *netdev, int vf_id, u16 vlan_id, u8 qos,
16131613
if (!vf)
16141614
return -EINVAL;
16151615

1616-
ret = ice_check_vf_ready_for_reset(vf);
1616+
ret = ice_check_vf_ready_for_cfg(vf);
16171617
if (ret)
16181618
goto out_put_vf;
16191619

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
@@ -215,7 +215,6 @@ u16 ice_get_num_vfs(struct ice_pf *pf);
215215
struct ice_vsi *ice_get_vf_vsi(struct ice_vf *vf);
216216
bool ice_is_vf_disabled(struct ice_vf *vf);
217217
int ice_check_vf_ready_for_cfg(struct ice_vf *vf);
218-
int ice_check_vf_ready_for_reset(struct ice_vf *vf);
219218
void ice_set_vf_state_dis(struct ice_vf *vf);
220219
bool ice_is_any_vf_in_unicast_promisc(struct ice_pf *pf);
221220
void

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3947,7 +3947,6 @@ void ice_vc_process_vf_msg(struct ice_pf *pf, struct ice_rq_event_info *event,
39473947
ice_vc_notify_vf_link_state(vf);
39483948
break;
39493949
case VIRTCHNL_OP_RESET_VF:
3950-
clear_bit(ICE_VF_STATE_ACTIVE, vf->vf_states);
39513950
ops->reset_vf(vf);
39523951
break;
39533952
case VIRTCHNL_OP_ADD_ETH_ADDR:

0 commit comments

Comments
 (0)