aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbevf
diff options
context:
space:
mode:
authorGreg Rose <gregory.v.rose@intel.com>2011-01-25 20:06:12 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-02-24 05:37:18 -0500
commit69bfbec47d1c120f66f2f24d5f2cb13a72fc88df (patch)
tree5e3d442ebd0c9b3c95bfb4f498f0f9e74be8dfd7 /drivers/net/ixgbevf
parente9f9807262083a663829d0154b3da10bafb713bb (diff)
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>
Diffstat (limited to 'drivers/net/ixgbevf')
-rw-r--r--drivers/net/ixgbevf/defines.h2
-rw-r--r--drivers/net/ixgbevf/ixgbevf_main.c19
2 files changed, 19 insertions, 2 deletions
diff --git a/drivers/net/ixgbevf/defines.h b/drivers/net/ixgbevf/defines.h
index de643eb2ada6..78abb6f1a866 100644
--- a/drivers/net/ixgbevf/defines.h
+++ b/drivers/net/ixgbevf/defines.h
@@ -65,6 +65,8 @@ typedef u32 ixgbe_link_speed;
65#define IXGBE_RXCTRL_DMBYPS 0x00000002 /* Descriptor Monitor Bypass */ 65#define IXGBE_RXCTRL_DMBYPS 0x00000002 /* Descriptor Monitor Bypass */
66#define IXGBE_RXDCTL_ENABLE 0x02000000 /* Enable specific Rx Queue */ 66#define IXGBE_RXDCTL_ENABLE 0x02000000 /* Enable specific Rx Queue */
67#define IXGBE_RXDCTL_VME 0x40000000 /* VLAN mode enable */ 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/* DCA Control */ 71/* DCA Control */
70#define IXGBE_DCA_TXCTRL_TX_WB_RO_EN (1 << 11) /* Tx Desc writeback RO bit */ 72#define IXGBE_DCA_TXCTRL_TX_WB_RO_EN (1 << 11) /* Tx Desc writeback RO bit */
diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c
index 464e6c9d3fc2..1f36f8fb41fc 100644
--- a/drivers/net/ixgbevf/ixgbevf_main.c
+++ b/drivers/net/ixgbevf/ixgbevf_main.c
@@ -51,7 +51,7 @@ char ixgbevf_driver_name[] = "ixgbevf";
51static const char ixgbevf_driver_string[] = 51static const char ixgbevf_driver_string[] =
52 "Intel(R) 82599 Virtual Function"; 52 "Intel(R) 82599 Virtual Function";
53 53
54#define DRV_VERSION "1.0.19-k0" 54#define DRV_VERSION "1.1.0-k0"
55const char ixgbevf_driver_version[] = DRV_VERSION; 55const char ixgbevf_driver_version[] = DRV_VERSION;
56static char ixgbevf_copyright[] = 56static char ixgbevf_copyright[] =
57 "Copyright (c) 2009 - 2010 Intel Corporation."; 57 "Copyright (c) 2009 - 2010 Intel Corporation.";
@@ -1665,6 +1665,11 @@ static int ixgbevf_up_complete(struct ixgbevf_adapter *adapter)
1665 j = adapter->rx_ring[i].reg_idx; 1665 j = adapter->rx_ring[i].reg_idx;
1666 rxdctl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(j)); 1666 rxdctl = IXGBE_READ_REG(hw, IXGBE_VFRXDCTL(j));
1667 rxdctl |= IXGBE_RXDCTL_ENABLE; 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 IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(j), rxdctl); 1673 IXGBE_WRITE_REG(hw, IXGBE_VFRXDCTL(j), rxdctl);
1669 ixgbevf_rx_desc_queue_enable(adapter, i); 1674 ixgbevf_rx_desc_queue_enable(adapter, i);
1670 } 1675 }
@@ -3217,10 +3222,16 @@ static int ixgbevf_set_mac(struct net_device *netdev, void *p)
3217static int ixgbevf_change_mtu(struct net_device *netdev, int new_mtu) 3222static int ixgbevf_change_mtu(struct net_device *netdev, int new_mtu)
3218{ 3223{
3219 struct ixgbevf_adapter *adapter = netdev_priv(netdev); 3224 struct ixgbevf_adapter *adapter = netdev_priv(netdev);
3225 struct ixgbe_hw *hw = &adapter->hw;
3220 int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN; 3226 int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN;
3227 int max_possible_frame = MAXIMUM_ETHERNET_VLAN_SIZE;
3228 u32 msg[2];
3229
3230 if (adapter->hw.mac.type == ixgbe_mac_X540_vf)
3231 max_possible_frame = IXGBE_MAX_JUMBO_FRAME_SIZE;
3221 3232
3222 /* MTU < 68 is an error and causes problems on some kernels */ 3233 /* MTU < 68 is an error and causes problems on some kernels */
3223 if ((new_mtu < 68) || (max_frame > MAXIMUM_ETHERNET_VLAN_SIZE)) 3234 if ((new_mtu < 68) || (max_frame > max_possible_frame))
3224 return -EINVAL; 3235 return -EINVAL;
3225 3236
3226 hw_dbg(&adapter->hw, "changing MTU from %d to %d\n", 3237 hw_dbg(&adapter->hw, "changing MTU from %d to %d\n",
@@ -3228,6 +3239,10 @@ static int ixgbevf_change_mtu(struct net_device *netdev, int new_mtu)
3228 /* must set new MTU before calling down or up */ 3239 /* must set new MTU before calling down or up */
3229 netdev->mtu = new_mtu; 3240 netdev->mtu = new_mtu;
3230 3241
3242 msg[0] = IXGBE_VF_SET_LPE;
3243 msg[1] = max_frame;
3244 hw->mbx.ops.write_posted(hw, msg, 2);
3245
3231 if (netif_running(netdev)) 3246 if (netif_running(netdev))
3232 ixgbevf_reinit_locked(adapter); 3247 ixgbevf_reinit_locked(adapter);
3233 3248