diff options
author | Greg Rose <gregory.v.rose@intel.com> | 2011-01-25 20:06:07 -0500 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2011-02-24 05:36:34 -0500 |
commit | e9f9807262083a663829d0154b3da10bafb713bb (patch) | |
tree | 91a8403be54716972ad23fb3a4d11013ffeb5c3a /drivers/net/ixgbe/ixgbe_sriov.c | |
parent | 55ae22d08fc9b531bc8a88b7306004e7053bb425 (diff) |
ixgbe: Enable Jumbo Frames on the X540 10Gigabit Controller
The X540 controller supports jumbo frames in SR-IOV mode. Allow
configuration of jumbo frames either in the PF driver or on behalf of
a VF.
Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_sriov.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_sriov.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/drivers/net/ixgbe/ixgbe_sriov.c b/drivers/net/ixgbe/ixgbe_sriov.c index 187b3a16ec1f..fb4868d0a32d 100644 --- a/drivers/net/ixgbe/ixgbe_sriov.c +++ b/drivers/net/ixgbe/ixgbe_sriov.c | |||
@@ -110,6 +110,33 @@ static int ixgbe_set_vf_vlan(struct ixgbe_adapter *adapter, int add, int vid, | |||
110 | return adapter->hw.mac.ops.set_vfta(&adapter->hw, vid, vf, (bool)add); | 110 | return adapter->hw.mac.ops.set_vfta(&adapter->hw, vid, vf, (bool)add); |
111 | } | 111 | } |
112 | 112 | ||
113 | void ixgbe_set_vf_lpe(struct ixgbe_adapter *adapter, u32 *msgbuf) | ||
114 | { | ||
115 | struct ixgbe_hw *hw = &adapter->hw; | ||
116 | int new_mtu = msgbuf[1]; | ||
117 | u32 max_frs; | ||
118 | int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN; | ||
119 | |||
120 | /* Only X540 supports jumbo frames in IOV mode */ | ||
121 | if (adapter->hw.mac.type != ixgbe_mac_X540) | ||
122 | return; | ||
123 | |||
124 | /* MTU < 68 is an error and causes problems on some kernels */ | ||
125 | if ((new_mtu < 68) || (max_frame > IXGBE_MAX_JUMBO_FRAME_SIZE)) { | ||
126 | e_err(drv, "VF mtu %d out of range\n", new_mtu); | ||
127 | return; | ||
128 | } | ||
129 | |||
130 | max_frs = (IXGBE_READ_REG(hw, IXGBE_MAXFRS) & | ||
131 | IXGBE_MHADD_MFS_MASK) >> IXGBE_MHADD_MFS_SHIFT; | ||
132 | if (max_frs < new_mtu) { | ||
133 | max_frs = new_mtu << IXGBE_MHADD_MFS_SHIFT; | ||
134 | IXGBE_WRITE_REG(hw, IXGBE_MAXFRS, max_frs); | ||
135 | } | ||
136 | |||
137 | e_info(hw, "VF requests change max MTU to %d\n", new_mtu); | ||
138 | } | ||
139 | |||
113 | static void ixgbe_set_vmolr(struct ixgbe_hw *hw, u32 vf, bool aupe) | 140 | static void ixgbe_set_vmolr(struct ixgbe_hw *hw, u32 vf, bool aupe) |
114 | { | 141 | { |
115 | u32 vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf)); | 142 | u32 vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf)); |
@@ -302,7 +329,7 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf) | |||
302 | hash_list, vf); | 329 | hash_list, vf); |
303 | break; | 330 | break; |
304 | case IXGBE_VF_SET_LPE: | 331 | case IXGBE_VF_SET_LPE: |
305 | WARN_ON((msgbuf[0] & 0xFFFF) == IXGBE_VF_SET_LPE); | 332 | ixgbe_set_vf_lpe(adapter, msgbuf); |
306 | break; | 333 | break; |
307 | case IXGBE_VF_SET_VLAN: | 334 | case IXGBE_VF_SET_VLAN: |
308 | add = (msgbuf[0] & IXGBE_VT_MSGINFO_MASK) | 335 | add = (msgbuf[0] & IXGBE_VT_MSGINFO_MASK) |