aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/igb
diff options
context:
space:
mode:
authorAlexander Duyck <aduyck@mirantis.com>2016-01-07 02:10:47 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2016-02-15 19:30:33 -0500
commitd3836f8e2517fb04328c673989fd780030926694 (patch)
treefcada2032cce4607bd38c1c2671c31d8b29f04e6 /drivers/net/ethernet/intel/igb
parent45693bcb00cbd379c373ab22ccd9a9d4755cc7ed (diff)
igb: Do not factor VLANs into RLPML calculation
The RLPML registers already take the size of VLAN headers into account when determining the maximum packet length. This is called out in EAS documents for several parts including the 82576 and the i350. As such we can drop the addition of size to the value programmed into the RLPML registers. Signed-off-by: Alexander Duyck <aduyck@mirantis.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igb')
-rw-r--r--drivers/net/ethernet/intel/igb/igb.h1
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c43
2 files changed, 2 insertions, 42 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h
index e3cb93bdb21a..d135261f8602 100644
--- a/drivers/net/ethernet/intel/igb/igb.h
+++ b/drivers/net/ethernet/intel/igb/igb.h
@@ -95,7 +95,6 @@ struct vf_data_storage {
95 unsigned char vf_mac_addresses[ETH_ALEN]; 95 unsigned char vf_mac_addresses[ETH_ALEN];
96 u16 vf_mc_hashes[IGB_MAX_VF_MC_ENTRIES]; 96 u16 vf_mc_hashes[IGB_MAX_VF_MC_ENTRIES];
97 u16 num_vf_mc_hashes; 97 u16 num_vf_mc_hashes;
98 u16 vlans_enabled;
99 u32 flags; 98 u32 flags;
100 unsigned long last_nack; 99 unsigned long last_nack;
101 u16 pf_vlan; /* When set, guest VLAN config not allowed. */ 100 u16 pf_vlan; /* When set, guest VLAN config not allowed. */
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index b6768812aa01..9461480e4eff 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -3531,12 +3531,8 @@ static inline int igb_set_vf_rlpml(struct igb_adapter *adapter, int size,
3531 struct e1000_hw *hw = &adapter->hw; 3531 struct e1000_hw *hw = &adapter->hw;
3532 u32 vmolr; 3532 u32 vmolr;
3533 3533
3534 /* if it isn't the PF check to see if VFs are enabled and 3534 if (size > MAX_JUMBO_FRAME_SIZE)
3535 * increase the size to support vlan tags 3535 size = MAX_JUMBO_FRAME_SIZE;
3536 */
3537 if (vfn < adapter->vfs_allocated_count &&
3538 adapter->vf_data[vfn].vlans_enabled)
3539 size += VLAN_TAG_SIZE;
3540 3536
3541 vmolr = rd32(E1000_VMOLR(vfn)); 3537 vmolr = rd32(E1000_VMOLR(vfn));
3542 vmolr &= ~E1000_VMOLR_RLPML_MASK; 3538 vmolr &= ~E1000_VMOLR_RLPML_MASK;
@@ -5787,8 +5783,6 @@ static void igb_clear_vf_vfta(struct igb_adapter *adapter, u32 vf)
5787 5783
5788 wr32(E1000_VLVF(i), reg); 5784 wr32(E1000_VLVF(i), reg);
5789 } 5785 }
5790
5791 adapter->vf_data[vf].vlans_enabled = 0;
5792} 5786}
5793 5787
5794static s32 igb_vlvf_set(struct igb_adapter *adapter, u32 vid, bool add, u32 vf) 5788static s32 igb_vlvf_set(struct igb_adapter *adapter, u32 vid, bool add, u32 vf)
@@ -5837,23 +5831,6 @@ static s32 igb_vlvf_set(struct igb_adapter *adapter, u32 vid, bool add, u32 vf)
5837 reg &= ~E1000_VLVF_VLANID_MASK; 5831 reg &= ~E1000_VLVF_VLANID_MASK;
5838 reg |= vid; 5832 reg |= vid;
5839 wr32(E1000_VLVF(i), reg); 5833 wr32(E1000_VLVF(i), reg);
5840
5841 /* do not modify RLPML for PF devices */
5842 if (vf >= adapter->vfs_allocated_count)
5843 return 0;
5844
5845 if (!adapter->vf_data[vf].vlans_enabled) {
5846 u32 size;
5847
5848 reg = rd32(E1000_VMOLR(vf));
5849 size = reg & E1000_VMOLR_RLPML_MASK;
5850 size += 4;
5851 reg &= ~E1000_VMOLR_RLPML_MASK;
5852 reg |= size;
5853 wr32(E1000_VMOLR(vf), reg);
5854 }
5855
5856 adapter->vf_data[vf].vlans_enabled++;
5857 } 5834 }
5858 } else { 5835 } else {
5859 if (i < E1000_VLVF_ARRAY_SIZE) { 5836 if (i < E1000_VLVF_ARRAY_SIZE) {
@@ -5865,22 +5842,6 @@ static s32 igb_vlvf_set(struct igb_adapter *adapter, u32 vid, bool add, u32 vf)
5865 igb_vfta_set(hw, vid, false); 5842 igb_vfta_set(hw, vid, false);
5866 } 5843 }
5867 wr32(E1000_VLVF(i), reg); 5844 wr32(E1000_VLVF(i), reg);
5868
5869 /* do not modify RLPML for PF devices */
5870 if (vf >= adapter->vfs_allocated_count)
5871 return 0;
5872
5873 adapter->vf_data[vf].vlans_enabled--;
5874 if (!adapter->vf_data[vf].vlans_enabled) {
5875 u32 size;
5876
5877 reg = rd32(E1000_VMOLR(vf));
5878 size = reg & E1000_VMOLR_RLPML_MASK;
5879 size -= 4;
5880 reg &= ~E1000_VMOLR_RLPML_MASK;
5881 reg |= size;
5882 wr32(E1000_VMOLR(vf), reg);
5883 }
5884 } 5845 }
5885 } 5846 }
5886 return 0; 5847 return 0;