aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb/igb_main.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2008-12-10 04:08:59 -0500
committerDavid S. Miller <davem@davemloft.net>2008-12-10 04:08:59 -0500
commitb4557be23dc959f38eed21d359ec7164e42bcbd6 (patch)
tree31fbd133f8df8ea7a187f0a6a36d61b04dac36fb /drivers/net/igb/igb_main.c
parente97fd7c6d51d8bf32ce981b853d987cfc6bdfb7f (diff)
igb: update handling of RCTL for smaller buffer sizes
As we begin to move into virtualization the use of a global value for buffer sizes becomes undesirable. This change makes it so only 256 and 512 byte buffers require use of the RCTL register. 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.c32
1 files changed, 14 insertions, 18 deletions
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c
index c49b8d8f80f2..dad742f8d23a 100644
--- a/drivers/net/igb/igb_main.c
+++ b/drivers/net/igb/igb_main.c
@@ -1801,25 +1801,21 @@ static void igb_setup_rctl(struct igb_adapter *adapter)
1801 */ 1801 */
1802 rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_LPE | E1000_RCTL_SZ_256); 1802 rctl &= ~(E1000_RCTL_SBP | E1000_RCTL_LPE | E1000_RCTL_SZ_256);
1803 1803
1804 if (adapter->netdev->mtu <= ETH_DATA_LEN) { 1804 if (adapter->netdev->mtu > ETH_DATA_LEN)
1805 /* Setup buffer sizes */
1806 switch (adapter->rx_buffer_len) {
1807 case IGB_RXBUFFER_256:
1808 rctl |= E1000_RCTL_SZ_256;
1809 break;
1810 case IGB_RXBUFFER_512:
1811 rctl |= E1000_RCTL_SZ_512;
1812 break;
1813 case IGB_RXBUFFER_1024:
1814 rctl |= E1000_RCTL_SZ_1024;
1815 break;
1816 default:
1817 rctl |= E1000_RCTL_SZ_2048;
1818 break;
1819 }
1820 } else {
1821 rctl |= E1000_RCTL_LPE; 1805 rctl |= E1000_RCTL_LPE;
1822 srrctl = adapter->rx_buffer_len >> E1000_SRRCTL_BSIZEPKT_SHIFT; 1806
1807 /* Setup buffer sizes */
1808 switch (adapter->rx_buffer_len) {
1809 case IGB_RXBUFFER_256:
1810 rctl |= E1000_RCTL_SZ_256;
1811 break;
1812 case IGB_RXBUFFER_512:
1813 rctl |= E1000_RCTL_SZ_512;
1814 break;
1815 default:
1816 srrctl = ALIGN(adapter->rx_buffer_len, 1024)
1817 >> E1000_SRRCTL_BSIZEPKT_SHIFT;
1818 break;
1823 } 1819 }
1824 1820
1825 /* 82575 and greater support packet-split where the protocol 1821 /* 82575 and greater support packet-split where the protocol