Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ixgbevf: Enable jumbo frame support for X540 VF

The X540 controller allows jumbo frame setup on a per VF basis. Enable
use of jumbo frames when the VF device belongs to the X540 controller.

Signed-off-by: Greg Rose <gregory.v.rose@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>

authored by

Greg Rose and committed by
Jeff Kirsher
69bfbec4 e9f98072

+19 -2
+2
drivers/net/ixgbevf/defines.h
··· 65 65 #define IXGBE_RXCTRL_DMBYPS 0x00000002 /* Descriptor Monitor Bypass */ 66 66 #define IXGBE_RXDCTL_ENABLE 0x02000000 /* Enable specific Rx Queue */ 67 67 #define IXGBE_RXDCTL_VME 0x40000000 /* VLAN mode enable */ 68 + #define IXGBE_RXDCTL_RLPMLMASK 0x00003FFF /* Only supported on the X540 */ 69 + #define IXGBE_RXDCTL_RLPML_EN 0x00008000 68 70 69 71 /* DCA Control */ 70 72 #define IXGBE_DCA_TXCTRL_TX_WB_RO_EN (1 << 11) /* Tx Desc writeback RO bit */
+17 -2
drivers/net/ixgbevf/ixgbevf_main.c
··· 51 51 static const char ixgbevf_driver_string[] = 52 52 "Intel(R) 82599 Virtual Function"; 53 53 54 - #define DRV_VERSION "1.0.19-k0" 54 + #define DRV_VERSION "1.1.0-k0" 55 55 const char ixgbevf_driver_version[] = DRV_VERSION; 56 56 static char ixgbevf_copyright[] = 57 57 "Copyright (c) 2009 - 2010 Intel Corporation."; ··· 1665 1665 j = adapter->rx_ring[i].reg_idx; 1666 1666 rxdctl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(j)); 1667 1667 rxdctl |= IXGBE_RXDCTL_ENABLE; 1668 + if (hw->mac.type == ixgbe_mac_X540_vf) { 1669 + rxdctl &= ~IXGBE_RXDCTL_RLPMLMASK; 1670 + rxdctl |= ((netdev->mtu + ETH_HLEN + ETH_FCS_LEN) | 1671 + IXGBE_RXDCTL_RLPML_EN); 1672 + } 1668 1673 IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(j), rxdctl); 1669 1674 ixgbevf_rx_desc_queue_enable(adapter, i); 1670 1675 } ··· 3222 3217 static int ixgbevf_change_mtu(struct net_device *netdev, int new_mtu) 3223 3218 { 3224 3219 struct ixgbevf_adapter *adapter = netdev_priv(netdev); 3220 + struct ixgbe_hw *hw = &adapter->hw; 3225 3221 int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN; 3222 + int max_possible_frame = MAXIMUM_ETHERNET_VLAN_SIZE; 3223 + u32 msg[2]; 3224 + 3225 + if (adapter->hw.mac.type == ixgbe_mac_X540_vf) 3226 + max_possible_frame = IXGBE_MAX_JUMBO_FRAME_SIZE; 3226 3227 3227 3228 /* MTU < 68 is an error and causes problems on some kernels */ 3228 - if ((new_mtu < 68) || (max_frame > MAXIMUM_ETHERNET_VLAN_SIZE)) 3229 + if ((new_mtu < 68) || (max_frame > max_possible_frame)) 3229 3230 return -EINVAL; 3230 3231 3231 3232 hw_dbg(&adapter->hw, "changing MTU from %d to %d\n", 3232 3233 netdev->mtu, new_mtu); 3233 3234 /* must set new MTU before calling down or up */ 3234 3235 netdev->mtu = new_mtu; 3236 + 3237 + msg[0] = IXGBE_VF_SET_LPE; 3238 + msg[1] = max_frame; 3239 + hw->mbx.ops.write_posted(hw, msg, 2); 3235 3240 3236 3241 if (netif_running(netdev)) 3237 3242 ixgbevf_reinit_locked(adapter);