diff options
author | Alexander Duyck <alexander.h.duyck@intel.com> | 2009-10-27 11:50:08 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-10-28 04:20:18 -0400 |
commit | 7d95b7170eca3f95bad939fc9eb365b823c05e39 (patch) | |
tree | b9b56b1e8c0fed6f961fb48ff31242fa6ca42666 /drivers/net/igb/igb_main.c | |
parent | 094919a4b0c56d6afbfb5ea14567fbb2f8d47554 (diff) |
igb: increase minimum rx buffer size to 1K
This update increases the minimum rx buffer size to 1K. The reason for this
change is to support SR-IOV and avoid any conflicts with the rings being able
to set their own MTU sizes.
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/igb/igb_main.c')
-rw-r--r-- | drivers/net/igb/igb_main.c | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index e1d1c0c984b0..6146f5db9871 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -2233,18 +2233,8 @@ static void igb_setup_rctl(struct igb_adapter *adapter) | |||
2233 | rctl |= E1000_RCTL_LPE; | 2233 | rctl |= E1000_RCTL_LPE; |
2234 | 2234 | ||
2235 | /* Setup buffer sizes */ | 2235 | /* Setup buffer sizes */ |
2236 | switch (adapter->rx_buffer_len) { | 2236 | srrctl = ALIGN(adapter->rx_buffer_len, 1024) |
2237 | case IGB_RXBUFFER_256: | 2237 | >> E1000_SRRCTL_BSIZEPKT_SHIFT; |
2238 | rctl |= E1000_RCTL_SZ_256; | ||
2239 | break; | ||
2240 | case IGB_RXBUFFER_512: | ||
2241 | rctl |= E1000_RCTL_SZ_512; | ||
2242 | break; | ||
2243 | default: | ||
2244 | srrctl = ALIGN(adapter->rx_buffer_len, 1024) | ||
2245 | >> E1000_SRRCTL_BSIZEPKT_SHIFT; | ||
2246 | break; | ||
2247 | } | ||
2248 | 2238 | ||
2249 | /* 82575 and greater support packet-split where the protocol | 2239 | /* 82575 and greater support packet-split where the protocol |
2250 | * header is placed in skb->data and the packet data is | 2240 | * header is placed in skb->data and the packet data is |
@@ -3755,11 +3745,7 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu) | |||
3755 | * i.e. RXBUFFER_2048 --> size-4096 slab | 3745 | * i.e. RXBUFFER_2048 --> size-4096 slab |
3756 | */ | 3746 | */ |
3757 | 3747 | ||
3758 | if (max_frame <= IGB_RXBUFFER_256) | 3748 | if (max_frame <= IGB_RXBUFFER_1024) |
3759 | adapter->rx_buffer_len = IGB_RXBUFFER_256; | ||
3760 | else if (max_frame <= IGB_RXBUFFER_512) | ||
3761 | adapter->rx_buffer_len = IGB_RXBUFFER_512; | ||
3762 | else if (max_frame <= IGB_RXBUFFER_1024) | ||
3763 | adapter->rx_buffer_len = IGB_RXBUFFER_1024; | 3749 | adapter->rx_buffer_len = IGB_RXBUFFER_1024; |
3764 | else if (max_frame <= IGB_RXBUFFER_2048) | 3750 | else if (max_frame <= IGB_RXBUFFER_2048) |
3765 | adapter->rx_buffer_len = IGB_RXBUFFER_2048; | 3751 | adapter->rx_buffer_len = IGB_RXBUFFER_2048; |
@@ -3770,11 +3756,6 @@ static int igb_change_mtu(struct net_device *netdev, int new_mtu) | |||
3770 | adapter->rx_buffer_len = PAGE_SIZE / 2; | 3756 | adapter->rx_buffer_len = PAGE_SIZE / 2; |
3771 | #endif | 3757 | #endif |
3772 | 3758 | ||
3773 | /* if sr-iov is enabled we need to force buffer size to 1K or larger */ | ||
3774 | if (adapter->vfs_allocated_count && | ||
3775 | (adapter->rx_buffer_len < IGB_RXBUFFER_1024)) | ||
3776 | adapter->rx_buffer_len = IGB_RXBUFFER_1024; | ||
3777 | |||
3778 | /* adjust allocation if LPE protects us, and we aren't using SBP */ | 3759 | /* adjust allocation if LPE protects us, and we aren't using SBP */ |
3779 | if ((max_frame == ETH_FRAME_LEN + ETH_FCS_LEN) || | 3760 | if ((max_frame == ETH_FRAME_LEN + ETH_FCS_LEN) || |
3780 | (max_frame == MAXIMUM_ETHERNET_VLAN_SIZE)) | 3761 | (max_frame == MAXIMUM_ETHERNET_VLAN_SIZE)) |