aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/ixgb/ixgb_main.c35
1 files changed, 7 insertions, 28 deletions
diff --git a/drivers/net/ixgb/ixgb_main.c b/drivers/net/ixgb/ixgb_main.c
index 5561ab6e9d36..b8258509f9f9 100644
--- a/drivers/net/ixgb/ixgb_main.c
+++ b/drivers/net/ixgb/ixgb_main.c
@@ -576,9 +576,8 @@ ixgb_sw_init(struct ixgb_adapter *adapter)
576 hw->subsystem_vendor_id = pdev->subsystem_vendor; 576 hw->subsystem_vendor_id = pdev->subsystem_vendor;
577 hw->subsystem_id = pdev->subsystem_device; 577 hw->subsystem_id = pdev->subsystem_device;
578 578
579 adapter->rx_buffer_len = IXGB_RXBUFFER_2048;
580
581 hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH; 579 hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ENET_FCS_LENGTH;
580 adapter->rx_buffer_len = hw->max_frame_size;
582 581
583 if((hw->device_id == IXGB_DEVICE_ID_82597EX) 582 if((hw->device_id == IXGB_DEVICE_ID_82597EX)
584 || (hw->device_id == IXGB_DEVICE_ID_82597EX_CX4) 583 || (hw->device_id == IXGB_DEVICE_ID_82597EX_CX4)
@@ -822,21 +821,14 @@ ixgb_setup_rctl(struct ixgb_adapter *adapter)
822 821
823 rctl |= IXGB_RCTL_SECRC; 822 rctl |= IXGB_RCTL_SECRC;
824 823
825 switch (adapter->rx_buffer_len) { 824 if (adapter->rx_buffer_len <= IXGB_RXBUFFER_2048)
826 case IXGB_RXBUFFER_2048:
827 default:
828 rctl |= IXGB_RCTL_BSIZE_2048; 825 rctl |= IXGB_RCTL_BSIZE_2048;
829 break; 826 else if (adapter->rx_buffer_len <= IXGB_RXBUFFER_4096)
830 case IXGB_RXBUFFER_4096:
831 rctl |= IXGB_RCTL_BSIZE_4096; 827 rctl |= IXGB_RCTL_BSIZE_4096;
832 break; 828 else if (adapter->rx_buffer_len <= IXGB_RXBUFFER_8192)
833 case IXGB_RXBUFFER_8192:
834 rctl |= IXGB_RCTL_BSIZE_8192; 829 rctl |= IXGB_RCTL_BSIZE_8192;
835 break; 830 else if (adapter->rx_buffer_len <= IXGB_RXBUFFER_16384)
836 case IXGB_RXBUFFER_16384:
837 rctl |= IXGB_RCTL_BSIZE_16384; 831 rctl |= IXGB_RCTL_BSIZE_16384;
838 break;
839 }
840 832
841 IXGB_WRITE_REG(&adapter->hw, RCTL, rctl); 833 IXGB_WRITE_REG(&adapter->hw, RCTL, rctl);
842} 834}
@@ -1546,24 +1538,11 @@ ixgb_change_mtu(struct net_device *netdev, int new_mtu)
1546 return -EINVAL; 1538 return -EINVAL;
1547 } 1539 }
1548 1540
1549 if((max_frame <= IXGB_MAX_ENET_FRAME_SIZE_WITHOUT_FCS + ENET_FCS_LENGTH) 1541 adapter->rx_buffer_len = max_frame;
1550 || (max_frame <= IXGB_RXBUFFER_2048)) {
1551 adapter->rx_buffer_len = IXGB_RXBUFFER_2048;
1552
1553 } else if(max_frame <= IXGB_RXBUFFER_4096) {
1554 adapter->rx_buffer_len = IXGB_RXBUFFER_4096;
1555
1556 } else if(max_frame <= IXGB_RXBUFFER_8192) {
1557 adapter->rx_buffer_len = IXGB_RXBUFFER_8192;
1558
1559 } else {
1560 adapter->rx_buffer_len = IXGB_RXBUFFER_16384;
1561 }
1562 1542
1563 netdev->mtu = new_mtu; 1543 netdev->mtu = new_mtu;
1564 1544
1565 if(old_max_frame != max_frame && netif_running(netdev)) { 1545 if ((old_max_frame != max_frame) && netif_running(netdev)) {
1566
1567 ixgb_down(adapter, TRUE); 1546 ixgb_down(adapter, TRUE);
1568 ixgb_up(adapter); 1547 ixgb_up(adapter);
1569 } 1548 }