提交 5907cf6c 编写于 作者: P Patryk Małek 提交者: Jeff Kirsher

i40e: Prevent deleting MAC address from VF when set by PF

To prevent VF from deleting MAC address that was assigned by the
PF we need to check for that scenario when we try to delete a MAC
address from a VF.
Signed-off-by: NPatryk Małek <patryk.malek@intel.com>
Tested-by: NAndrew Bowers <andrewx.bowers@intel.com>
Signed-off-by: NJeff Kirsher <jeffrey.t.kirsher@intel.com>
上级 babbcc60
......@@ -2569,6 +2569,16 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen)
ret = I40E_ERR_INVALID_MAC_ADDR;
goto error_param;
}
if (vf->pf_set_mac &&
ether_addr_equal(al->list[i].addr,
vf->default_lan_addr.addr)) {
dev_err(&pf->pdev->dev,
"MAC addr %pM has been set by PF, cannot delete it for VF %d, reset VF to change MAC addr\n",
vf->default_lan_addr.addr, vf->vf_id);
ret = I40E_ERR_PARAM;
goto error_param;
}
}
vsi = pf->vsi[vf->lan_vsi_idx];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册