Commit 8fa7e0f7 authored by Greg Rose's avatar Greg Rose Committed by Jeff Kirsher

igb: Fix overwrite of the VF's flags

The vf flags were being overwritten causing the flag that indicates
that the PF has set the VF MAC address to get cleared.  This would
allow the VF to override the MAC address assigned by the Host VMM
using the ip link set command.
Signed-off-by: default avatarGreg Rose <gregory.v.rose@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent b1cdfead
...@@ -1654,7 +1654,7 @@ void igb_reset(struct igb_adapter *adapter) ...@@ -1654,7 +1654,7 @@ void igb_reset(struct igb_adapter *adapter)
if (adapter->vfs_allocated_count) { if (adapter->vfs_allocated_count) {
int i; int i;
for (i = 0 ; i < adapter->vfs_allocated_count; i++) for (i = 0 ; i < adapter->vfs_allocated_count; i++)
adapter->vf_data[i].flags = 0; adapter->vf_data[i].flags &= IGB_VF_FLAG_PF_SET_MAC;
/* ping all the active vfs to let them know we are going down */ /* ping all the active vfs to let them know we are going down */
igb_ping_all_vfs(adapter); igb_ping_all_vfs(adapter);
...@@ -4971,8 +4971,8 @@ static int igb_set_vf_vlan(struct igb_adapter *adapter, u32 *msgbuf, u32 vf) ...@@ -4971,8 +4971,8 @@ static int igb_set_vf_vlan(struct igb_adapter *adapter, u32 *msgbuf, u32 vf)
static inline void igb_vf_reset(struct igb_adapter *adapter, u32 vf) static inline void igb_vf_reset(struct igb_adapter *adapter, u32 vf)
{ {
/* clear flags */ /* clear flags - except flag that indicates PF has set the MAC */
adapter->vf_data[vf].flags &= ~(IGB_VF_FLAG_PF_SET_MAC); adapter->vf_data[vf].flags &= IGB_VF_FLAG_PF_SET_MAC;
adapter->vf_data[vf].last_nack = jiffies; adapter->vf_data[vf].last_nack = jiffies;
/* reset offloads to defaults */ /* reset offloads to defaults */
...@@ -5026,7 +5026,7 @@ static void igb_vf_reset_msg(struct igb_adapter *adapter, u32 vf) ...@@ -5026,7 +5026,7 @@ static void igb_vf_reset_msg(struct igb_adapter *adapter, u32 vf)
reg = rd32(E1000_VFRE); reg = rd32(E1000_VFRE);
wr32(E1000_VFRE, reg | (1 << vf)); wr32(E1000_VFRE, reg | (1 << vf));
adapter->vf_data[vf].flags = IGB_VF_FLAG_CTS; adapter->vf_data[vf].flags |= IGB_VF_FLAG_CTS;
/* reply to reset with ack and vf mac address */ /* reply to reset with ack and vf mac address */
msgbuf[0] = E1000_VF_RESET | E1000_VT_MSGTYPE_ACK; msgbuf[0] = E1000_VF_RESET | E1000_VT_MSGTYPE_ACK;
......
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