|
@@ -3741,6 +3741,7 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
|
|
|
int ret = 0;
|
|
|
struct hlist_node *h;
|
|
|
int bkt;
|
|
|
+ u8 i;
|
|
|
|
|
|
/* validate the request */
|
|
|
if (vf_id >= pf->num_alloc_vfs) {
|
|
@@ -3752,6 +3753,16 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)
|
|
|
|
|
|
vf = &(pf->vf[vf_id]);
|
|
|
vsi = pf->vsi[vf->lan_vsi_idx];
|
|
|
+
|
|
|
+ /* When the VF is resetting wait until it is done.
|
|
|
+ * It can take up to 200 milliseconds,
|
|
|
+ * but wait for up to 300 milliseconds to be safe.
|
|
|
+ */
|
|
|
+ for (i = 0; i < 15; i++) {
|
|
|
+ if (test_bit(I40E_VF_STATE_INIT, &vf->vf_states))
|
|
|
+ break;
|
|
|
+ msleep(20);
|
|
|
+ }
|
|
|
if (!test_bit(I40E_VF_STATE_INIT, &vf->vf_states)) {
|
|
|
dev_err(&pf->pdev->dev, "VF %d still in reset. Try again.\n",
|
|
|
vf_id);
|