diff options
author | Greg Rose <gregory.v.rose@intel.com> | 2012-11-08 06:41:35 +0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2012-11-28 16:46:11 +0400 |
commit | 9b735984fba6d704fdf798b5831010980c1b8950 (patch) | |
tree | 1ac30cc4204584fe746d7626b53445fd1e1d8f8a /drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |
parent | 2afaa00d2fa2ae1fa806ebd229bc3f56df8449d5 (diff) | |
download | linux-9b735984fba6d704fdf798b5831010980c1b8950.tar.xz |
ixgbe: Make the bridge mode setting sticky
The internal bridge mode setting needs to be sticky so that it can be
configured correctly after a device reset. This change is required now
that the driver supports setting the bridge mode to VEB or VEPA.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Acked-by: John Fastabend <john.r.fastabend@intel.com>
Tested-by: Phil Schmitt <phillip.j.schmitt@intel.com>
Tested-by: Sibai Li <Sibai.li@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/ixgbe/ixgbe_main.c')
-rw-r--r-- | drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index fc8cfad4ac9b..fee0f8c78041 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c @@ -3247,6 +3247,8 @@ static void ixgbe_configure_virtualization(struct ixgbe_adapter *adapter) IXGBE_WRITE_REG(hw, IXGBE_VFRE(reg_offset ^ 1), reg_offset - 1); IXGBE_WRITE_REG(hw, IXGBE_VFTE(reg_offset), (~0) << vf_shift); IXGBE_WRITE_REG(hw, IXGBE_VFTE(reg_offset ^ 1), reg_offset - 1); + if (adapter->flags2 & IXGBE_FLAG2_BRIDGE_MODE_VEB) + IXGBE_WRITE_REG(hw, IXGBE_PFDTXGSWC, IXGBE_PFDTXGSWC_VT_LBEN); /* Map PF MAC address in RAR Entry 0 to first pool following VFs */ hw->mac.ops.set_vmdq(hw, 0, VMDQ_P(0)); @@ -7039,11 +7041,13 @@ static int ixgbe_ndo_bridge_setlink(struct net_device *dev, continue; mode = nla_get_u16(attr); - if (mode == BRIDGE_MODE_VEPA) + if (mode == BRIDGE_MODE_VEPA) { reg = 0; - else if (mode == BRIDGE_MODE_VEB) + adapter->flags2 &= ~IXGBE_FLAG2_BRIDGE_MODE_VEB; + } else if (mode == BRIDGE_MODE_VEB) { reg = IXGBE_PFDTXGSWC_VT_LBEN; - else + adapter->flags2 |= IXGBE_FLAG2_BRIDGE_MODE_VEB; + } else return -EINVAL; IXGBE_WRITE_REG(&adapter->hw, IXGBE_PFDTXGSWC, reg); @@ -7064,7 +7068,7 @@ static int ixgbe_ndo_bridge_getlink(struct sk_buff *skb, u32 pid, u32 seq, if (!(adapter->flags & IXGBE_FLAG_SRIOV_ENABLED)) return 0; - if (IXGBE_READ_REG(&adapter->hw, IXGBE_PFDTXGSWC) & 1) + if (adapter->flags2 & IXGBE_FLAG2_BRIDGE_MODE_VEB) mode = BRIDGE_MODE_VEB; else mode = BRIDGE_MODE_VEPA; |