diff options
-rw-r--r-- | drivers/net/igb/e1000_defines.h | 7 | ||||
-rw-r--r-- | drivers/net/igb/e1000_regs.h | 4 | ||||
-rw-r--r-- | drivers/net/igb/igb.h | 2 | ||||
-rw-r--r-- | drivers/net/igb/igb_main.c | 92 | ||||
-rw-r--r-- | drivers/net/igbvf/igbvf.h | 3 | ||||
-rw-r--r-- | drivers/net/igbvf/netdev.c | 60 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_main.c | 18 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_sriov.c | 29 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_type.h | 2 | ||||
-rw-r--r-- | drivers/net/ixgbevf/defines.h | 2 | ||||
-rw-r--r-- | drivers/net/ixgbevf/ixgbevf_main.c | 35 |
11 files changed, 174 insertions, 80 deletions
diff --git a/drivers/net/igb/e1000_defines.h b/drivers/net/igb/e1000_defines.h index 6319ed902bc0..ff46c91520af 100644 --- a/drivers/net/igb/e1000_defines.h +++ b/drivers/net/igb/e1000_defines.h | |||
@@ -770,4 +770,11 @@ | |||
770 | #define E1000_PCIEMISC_LX_DECISION 0x00000080 /* Lx power decision based | 770 | #define E1000_PCIEMISC_LX_DECISION 0x00000080 /* Lx power decision based |
771 | on DMA coal */ | 771 | on DMA coal */ |
772 | 772 | ||
773 | /* Tx Rate-Scheduler Config fields */ | ||
774 | #define E1000_RTTBCNRC_RS_ENA 0x80000000 | ||
775 | #define E1000_RTTBCNRC_RF_DEC_MASK 0x00003FFF | ||
776 | #define E1000_RTTBCNRC_RF_INT_SHIFT 14 | ||
777 | #define E1000_RTTBCNRC_RF_INT_MASK \ | ||
778 | (E1000_RTTBCNRC_RF_DEC_MASK << E1000_RTTBCNRC_RF_INT_SHIFT) | ||
779 | |||
773 | #endif | 780 | #endif |
diff --git a/drivers/net/igb/e1000_regs.h b/drivers/net/igb/e1000_regs.h index 8ac83c5190d5..3a6f8471aea2 100644 --- a/drivers/net/igb/e1000_regs.h +++ b/drivers/net/igb/e1000_regs.h | |||
@@ -106,6 +106,10 @@ | |||
106 | 106 | ||
107 | #define E1000_RQDPC(_n) (0x0C030 + ((_n) * 0x40)) | 107 | #define E1000_RQDPC(_n) (0x0C030 + ((_n) * 0x40)) |
108 | 108 | ||
109 | /* TX Rate Limit Registers */ | ||
110 | #define E1000_RTTDQSEL 0x3604 /* Tx Desc Plane Queue Select - WO */ | ||
111 | #define E1000_RTTBCNRC 0x36B0 /* Tx BCN Rate-Scheduler Config - WO */ | ||
112 | |||
109 | /* Split and Replication RX Control - RW */ | 113 | /* Split and Replication RX Control - RW */ |
110 | #define E1000_RXPBS 0x02404 /* Rx Packet Buffer Size - RW */ | 114 | #define E1000_RXPBS 0x02404 /* Rx Packet Buffer Size - RW */ |
111 | /* | 115 | /* |
diff --git a/drivers/net/igb/igb.h b/drivers/net/igb/igb.h index 92a4ef09e55c..bbc5ebfe254a 100644 --- a/drivers/net/igb/igb.h +++ b/drivers/net/igb/igb.h | |||
@@ -77,6 +77,7 @@ struct vf_data_storage { | |||
77 | unsigned long last_nack; | 77 | unsigned long last_nack; |
78 | u16 pf_vlan; /* When set, guest VLAN config not allowed. */ | 78 | u16 pf_vlan; /* When set, guest VLAN config not allowed. */ |
79 | u16 pf_qos; | 79 | u16 pf_qos; |
80 | u16 tx_rate; | ||
80 | }; | 81 | }; |
81 | 82 | ||
82 | #define IGB_VF_FLAG_CTS 0x00000001 /* VF is clear to send data */ | 83 | #define IGB_VF_FLAG_CTS 0x00000001 /* VF is clear to send data */ |
@@ -323,6 +324,7 @@ struct igb_adapter { | |||
323 | u16 rx_ring_count; | 324 | u16 rx_ring_count; |
324 | unsigned int vfs_allocated_count; | 325 | unsigned int vfs_allocated_count; |
325 | struct vf_data_storage *vf_data; | 326 | struct vf_data_storage *vf_data; |
327 | int vf_rate_link_speed; | ||
326 | u32 rss_queues; | 328 | u32 rss_queues; |
327 | u32 wvbr; | 329 | u32 wvbr; |
328 | }; | 330 | }; |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index cb6bf7b815ae..579dbba5f9e4 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -50,12 +50,12 @@ | |||
50 | #endif | 50 | #endif |
51 | #include "igb.h" | 51 | #include "igb.h" |
52 | 52 | ||
53 | #define DRV_VERSION "2.1.0-k2" | 53 | #define DRV_VERSION "2.4.13-k2" |
54 | char igb_driver_name[] = "igb"; | 54 | char igb_driver_name[] = "igb"; |
55 | char igb_driver_version[] = DRV_VERSION; | 55 | char igb_driver_version[] = DRV_VERSION; |
56 | static const char igb_driver_string[] = | 56 | static const char igb_driver_string[] = |
57 | "Intel(R) Gigabit Ethernet Network Driver"; | 57 | "Intel(R) Gigabit Ethernet Network Driver"; |
58 | static const char igb_copyright[] = "Copyright (c) 2007-2009 Intel Corporation."; | 58 | static const char igb_copyright[] = "Copyright (c) 2007-2011 Intel Corporation."; |
59 | 59 | ||
60 | static const struct e1000_info *igb_info_tbl[] = { | 60 | static const struct e1000_info *igb_info_tbl[] = { |
61 | [board_82575] = &e1000_82575_info, | 61 | [board_82575] = &e1000_82575_info, |
@@ -150,6 +150,7 @@ static int igb_ndo_set_vf_vlan(struct net_device *netdev, | |||
150 | static int igb_ndo_set_vf_bw(struct net_device *netdev, int vf, int tx_rate); | 150 | static int igb_ndo_set_vf_bw(struct net_device *netdev, int vf, int tx_rate); |
151 | static int igb_ndo_get_vf_config(struct net_device *netdev, int vf, | 151 | static int igb_ndo_get_vf_config(struct net_device *netdev, int vf, |
152 | struct ifla_vf_info *ivi); | 152 | struct ifla_vf_info *ivi); |
153 | static void igb_check_vf_rate_limit(struct igb_adapter *); | ||
153 | 154 | ||
154 | #ifdef CONFIG_PM | 155 | #ifdef CONFIG_PM |
155 | static int igb_suspend(struct pci_dev *, pm_message_t); | 156 | static int igb_suspend(struct pci_dev *, pm_message_t); |
@@ -3511,6 +3512,7 @@ static void igb_watchdog_task(struct work_struct *work) | |||
3511 | netif_carrier_on(netdev); | 3512 | netif_carrier_on(netdev); |
3512 | 3513 | ||
3513 | igb_ping_all_vfs(adapter); | 3514 | igb_ping_all_vfs(adapter); |
3515 | igb_check_vf_rate_limit(adapter); | ||
3514 | 3516 | ||
3515 | /* link state has changed, schedule phy info update */ | 3517 | /* link state has changed, schedule phy info update */ |
3516 | if (!test_bit(__IGB_DOWN, &adapter->state)) | 3518 | if (!test_bit(__IGB_DOWN, &adapter->state)) |
@@ -6599,9 +6601,91 @@ static int igb_ndo_set_vf_mac(struct net_device *netdev, int vf, u8 *mac) | |||
6599 | return igb_set_vf_mac(adapter, vf, mac); | 6601 | return igb_set_vf_mac(adapter, vf, mac); |
6600 | } | 6602 | } |
6601 | 6603 | ||
6604 | static int igb_link_mbps(int internal_link_speed) | ||
6605 | { | ||
6606 | switch (internal_link_speed) { | ||
6607 | case SPEED_100: | ||
6608 | return 100; | ||
6609 | case SPEED_1000: | ||
6610 | return 1000; | ||
6611 | default: | ||
6612 | return 0; | ||
6613 | } | ||
6614 | } | ||
6615 | |||
6616 | static void igb_set_vf_rate_limit(struct e1000_hw *hw, int vf, int tx_rate, | ||
6617 | int link_speed) | ||
6618 | { | ||
6619 | int rf_dec, rf_int; | ||
6620 | u32 bcnrc_val; | ||
6621 | |||
6622 | if (tx_rate != 0) { | ||
6623 | /* Calculate the rate factor values to set */ | ||
6624 | rf_int = link_speed / tx_rate; | ||
6625 | rf_dec = (link_speed - (rf_int * tx_rate)); | ||
6626 | rf_dec = (rf_dec * (1<<E1000_RTTBCNRC_RF_INT_SHIFT)) / tx_rate; | ||
6627 | |||
6628 | bcnrc_val = E1000_RTTBCNRC_RS_ENA; | ||
6629 | bcnrc_val |= ((rf_int<<E1000_RTTBCNRC_RF_INT_SHIFT) & | ||
6630 | E1000_RTTBCNRC_RF_INT_MASK); | ||
6631 | bcnrc_val |= (rf_dec & E1000_RTTBCNRC_RF_DEC_MASK); | ||
6632 | } else { | ||
6633 | bcnrc_val = 0; | ||
6634 | } | ||
6635 | |||
6636 | wr32(E1000_RTTDQSEL, vf); /* vf X uses queue X */ | ||
6637 | wr32(E1000_RTTBCNRC, bcnrc_val); | ||
6638 | } | ||
6639 | |||
6640 | static void igb_check_vf_rate_limit(struct igb_adapter *adapter) | ||
6641 | { | ||
6642 | int actual_link_speed, i; | ||
6643 | bool reset_rate = false; | ||
6644 | |||
6645 | /* VF TX rate limit was not set or not supported */ | ||
6646 | if ((adapter->vf_rate_link_speed == 0) || | ||
6647 | (adapter->hw.mac.type != e1000_82576)) | ||
6648 | return; | ||
6649 | |||
6650 | actual_link_speed = igb_link_mbps(adapter->link_speed); | ||
6651 | if (actual_link_speed != adapter->vf_rate_link_speed) { | ||
6652 | reset_rate = true; | ||
6653 | adapter->vf_rate_link_speed = 0; | ||
6654 | dev_info(&adapter->pdev->dev, | ||
6655 | "Link speed has been changed. VF Transmit " | ||
6656 | "rate is disabled\n"); | ||
6657 | } | ||
6658 | |||
6659 | for (i = 0; i < adapter->vfs_allocated_count; i++) { | ||
6660 | if (reset_rate) | ||
6661 | adapter->vf_data[i].tx_rate = 0; | ||
6662 | |||
6663 | igb_set_vf_rate_limit(&adapter->hw, i, | ||
6664 | adapter->vf_data[i].tx_rate, | ||
6665 | actual_link_speed); | ||
6666 | } | ||
6667 | } | ||
6668 | |||
6602 | static int igb_ndo_set_vf_bw(struct net_device *netdev, int vf, int tx_rate) | 6669 | static int igb_ndo_set_vf_bw(struct net_device *netdev, int vf, int tx_rate) |
6603 | { | 6670 | { |
6604 | return -EOPNOTSUPP; | 6671 | struct igb_adapter *adapter = netdev_priv(netdev); |
6672 | struct e1000_hw *hw = &adapter->hw; | ||
6673 | int actual_link_speed; | ||
6674 | |||
6675 | if (hw->mac.type != e1000_82576) | ||
6676 | return -EOPNOTSUPP; | ||
6677 | |||
6678 | actual_link_speed = igb_link_mbps(adapter->link_speed); | ||
6679 | if ((vf >= adapter->vfs_allocated_count) || | ||
6680 | (!(rd32(E1000_STATUS) & E1000_STATUS_LU)) || | ||
6681 | (tx_rate < 0) || (tx_rate > actual_link_speed)) | ||
6682 | return -EINVAL; | ||
6683 | |||
6684 | adapter->vf_rate_link_speed = actual_link_speed; | ||
6685 | adapter->vf_data[vf].tx_rate = (u16)tx_rate; | ||
6686 | igb_set_vf_rate_limit(hw, vf, tx_rate, actual_link_speed); | ||
6687 | |||
6688 | return 0; | ||
6605 | } | 6689 | } |
6606 | 6690 | ||
6607 | static int igb_ndo_get_vf_config(struct net_device *netdev, | 6691 | static int igb_ndo_get_vf_config(struct net_device *netdev, |
@@ -6612,7 +6696,7 @@ static int igb_ndo_get_vf_config(struct net_device *netdev, | |||
6612 | return -EINVAL; | 6696 | return -EINVAL; |
6613 | ivi->vf = vf; | 6697 | ivi->vf = vf; |
6614 | memcpy(&ivi->mac, adapter->vf_data[vf].vf_mac_addresses, ETH_ALEN); | 6698 | memcpy(&ivi->mac, adapter->vf_data[vf].vf_mac_addresses, ETH_ALEN); |
6615 | ivi->tx_rate = 0; | 6699 | ivi->tx_rate = adapter->vf_data[vf].tx_rate; |
6616 | ivi->vlan = adapter->vf_data[vf].pf_vlan; | 6700 | ivi->vlan = adapter->vf_data[vf].pf_vlan; |
6617 | ivi->qos = adapter->vf_data[vf].pf_qos; | 6701 | ivi->qos = adapter->vf_data[vf].pf_qos; |
6618 | return 0; | 6702 | return 0; |
diff --git a/drivers/net/igbvf/igbvf.h b/drivers/net/igbvf/igbvf.h index 990c329e6c3b..d5dad5d607d6 100644 --- a/drivers/net/igbvf/igbvf.h +++ b/drivers/net/igbvf/igbvf.h | |||
@@ -201,9 +201,6 @@ struct igbvf_adapter { | |||
201 | unsigned int restart_queue; | 201 | unsigned int restart_queue; |
202 | u32 txd_cmd; | 202 | u32 txd_cmd; |
203 | 203 | ||
204 | bool detect_tx_hung; | ||
205 | u8 tx_timeout_factor; | ||
206 | |||
207 | u32 tx_int_delay; | 204 | u32 tx_int_delay; |
208 | u32 tx_abs_int_delay; | 205 | u32 tx_abs_int_delay; |
209 | 206 | ||
diff --git a/drivers/net/igbvf/netdev.c b/drivers/net/igbvf/netdev.c index 6352c8158e6d..42fdf5977be9 100644 --- a/drivers/net/igbvf/netdev.c +++ b/drivers/net/igbvf/netdev.c | |||
@@ -396,35 +396,6 @@ static void igbvf_put_txbuf(struct igbvf_adapter *adapter, | |||
396 | buffer_info->time_stamp = 0; | 396 | buffer_info->time_stamp = 0; |
397 | } | 397 | } |
398 | 398 | ||
399 | static void igbvf_print_tx_hang(struct igbvf_adapter *adapter) | ||
400 | { | ||
401 | struct igbvf_ring *tx_ring = adapter->tx_ring; | ||
402 | unsigned int i = tx_ring->next_to_clean; | ||
403 | unsigned int eop = tx_ring->buffer_info[i].next_to_watch; | ||
404 | union e1000_adv_tx_desc *eop_desc = IGBVF_TX_DESC_ADV(*tx_ring, eop); | ||
405 | |||
406 | /* detected Tx unit hang */ | ||
407 | dev_err(&adapter->pdev->dev, | ||
408 | "Detected Tx Unit Hang:\n" | ||
409 | " TDH <%x>\n" | ||
410 | " TDT <%x>\n" | ||
411 | " next_to_use <%x>\n" | ||
412 | " next_to_clean <%x>\n" | ||
413 | "buffer_info[next_to_clean]:\n" | ||
414 | " time_stamp <%lx>\n" | ||
415 | " next_to_watch <%x>\n" | ||
416 | " jiffies <%lx>\n" | ||
417 | " next_to_watch.status <%x>\n", | ||
418 | readl(adapter->hw.hw_addr + tx_ring->head), | ||
419 | readl(adapter->hw.hw_addr + tx_ring->tail), | ||
420 | tx_ring->next_to_use, | ||
421 | tx_ring->next_to_clean, | ||
422 | tx_ring->buffer_info[eop].time_stamp, | ||
423 | eop, | ||
424 | jiffies, | ||
425 | eop_desc->wb.status); | ||
426 | } | ||
427 | |||
428 | /** | 399 | /** |
429 | * igbvf_setup_tx_resources - allocate Tx resources (Descriptors) | 400 | * igbvf_setup_tx_resources - allocate Tx resources (Descriptors) |
430 | * @adapter: board private structure | 401 | * @adapter: board private structure |
@@ -771,7 +742,6 @@ static void igbvf_set_itr(struct igbvf_adapter *adapter) | |||
771 | static bool igbvf_clean_tx_irq(struct igbvf_ring *tx_ring) | 742 | static bool igbvf_clean_tx_irq(struct igbvf_ring *tx_ring) |
772 | { | 743 | { |
773 | struct igbvf_adapter *adapter = tx_ring->adapter; | 744 | struct igbvf_adapter *adapter = tx_ring->adapter; |
774 | struct e1000_hw *hw = &adapter->hw; | ||
775 | struct net_device *netdev = adapter->netdev; | 745 | struct net_device *netdev = adapter->netdev; |
776 | struct igbvf_buffer *buffer_info; | 746 | struct igbvf_buffer *buffer_info; |
777 | struct sk_buff *skb; | 747 | struct sk_buff *skb; |
@@ -832,22 +802,6 @@ static bool igbvf_clean_tx_irq(struct igbvf_ring *tx_ring) | |||
832 | } | 802 | } |
833 | } | 803 | } |
834 | 804 | ||
835 | if (adapter->detect_tx_hung) { | ||
836 | /* Detect a transmit hang in hardware, this serializes the | ||
837 | * check with the clearing of time_stamp and movement of i */ | ||
838 | adapter->detect_tx_hung = false; | ||
839 | if (tx_ring->buffer_info[i].time_stamp && | ||
840 | time_after(jiffies, tx_ring->buffer_info[i].time_stamp + | ||
841 | (adapter->tx_timeout_factor * HZ)) && | ||
842 | !(er32(STATUS) & E1000_STATUS_TXOFF)) { | ||
843 | |||
844 | tx_desc = IGBVF_TX_DESC_ADV(*tx_ring, i); | ||
845 | /* detected Tx unit hang */ | ||
846 | igbvf_print_tx_hang(adapter); | ||
847 | |||
848 | netif_stop_queue(netdev); | ||
849 | } | ||
850 | } | ||
851 | adapter->net_stats.tx_bytes += total_bytes; | 805 | adapter->net_stats.tx_bytes += total_bytes; |
852 | adapter->net_stats.tx_packets += total_packets; | 806 | adapter->net_stats.tx_packets += total_packets; |
853 | return count < tx_ring->count; | 807 | return count < tx_ring->count; |
@@ -1863,17 +1817,6 @@ static void igbvf_watchdog_task(struct work_struct *work) | |||
1863 | &adapter->link_duplex); | 1817 | &adapter->link_duplex); |
1864 | igbvf_print_link_info(adapter); | 1818 | igbvf_print_link_info(adapter); |
1865 | 1819 | ||
1866 | /* adjust timeout factor according to speed/duplex */ | ||
1867 | adapter->tx_timeout_factor = 1; | ||
1868 | switch (adapter->link_speed) { | ||
1869 | case SPEED_10: | ||
1870 | adapter->tx_timeout_factor = 16; | ||
1871 | break; | ||
1872 | case SPEED_100: | ||
1873 | /* maybe add some timeout factor ? */ | ||
1874 | break; | ||
1875 | } | ||
1876 | |||
1877 | netif_carrier_on(netdev); | 1820 | netif_carrier_on(netdev); |
1878 | netif_wake_queue(netdev); | 1821 | netif_wake_queue(netdev); |
1879 | } | 1822 | } |
@@ -1907,9 +1850,6 @@ static void igbvf_watchdog_task(struct work_struct *work) | |||
1907 | /* Cause software interrupt to ensure Rx ring is cleaned */ | 1850 | /* Cause software interrupt to ensure Rx ring is cleaned */ |
1908 | ew32(EICS, adapter->rx_ring->eims_value); | 1851 | ew32(EICS, adapter->rx_ring->eims_value); |
1909 | 1852 | ||
1910 | /* Force detection of hung controller every watchdog period */ | ||
1911 | adapter->detect_tx_hung = 1; | ||
1912 | |||
1913 | /* Reset the timer */ | 1853 | /* Reset the timer */ |
1914 | if (!test_bit(__IGBVF_DOWN, &adapter->state)) | 1854 | if (!test_bit(__IGBVF_DOWN, &adapter->state)) |
1915 | mod_timer(&adapter->watchdog_timer, | 1855 | mod_timer(&adapter->watchdog_timer, |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index eca762d954c6..f0d0c5aad2b4 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -3077,6 +3077,14 @@ void ixgbe_configure_rx_ring(struct ixgbe_adapter *adapter, | |||
3077 | ixgbe_configure_srrctl(adapter, ring); | 3077 | ixgbe_configure_srrctl(adapter, ring); |
3078 | ixgbe_configure_rscctl(adapter, ring); | 3078 | ixgbe_configure_rscctl(adapter, ring); |
3079 | 3079 | ||
3080 | /* If operating in IOV mode set RLPML for X540 */ | ||
3081 | if ((adapter->flags & IXGBE_FLAG_SRIOV_ENABLED) && | ||
3082 | hw->mac.type == ixgbe_mac_X540) { | ||
3083 | rxdctl &= ~IXGBE_RXDCTL_RLPMLMASK; | ||
3084 | rxdctl |= ((ring->netdev->mtu + ETH_HLEN + | ||
3085 | ETH_FCS_LEN + VLAN_HLEN) | IXGBE_RXDCTL_RLPML_EN); | ||
3086 | } | ||
3087 | |||
3080 | if (hw->mac.type == ixgbe_mac_82598EB) { | 3088 | if (hw->mac.type == ixgbe_mac_82598EB) { |
3081 | /* | 3089 | /* |
3082 | * enable cache line friendly hardware writes: | 3090 | * enable cache line friendly hardware writes: |
@@ -5441,8 +5449,14 @@ static int ixgbe_change_mtu(struct net_device *netdev, int new_mtu) | |||
5441 | int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN; | 5449 | int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN; |
5442 | 5450 | ||
5443 | /* MTU < 68 is an error and causes problems on some kernels */ | 5451 | /* MTU < 68 is an error and causes problems on some kernels */ |
5444 | if ((new_mtu < 68) || (max_frame > IXGBE_MAX_JUMBO_FRAME_SIZE)) | 5452 | if (adapter->flags & IXGBE_FLAG_SRIOV_ENABLED && |
5445 | return -EINVAL; | 5453 | hw->mac.type != ixgbe_mac_X540) { |
5454 | if ((new_mtu < 68) || (max_frame > MAXIMUM_ETHERNET_VLAN_SIZE)) | ||
5455 | return -EINVAL; | ||
5456 | } else { | ||
5457 | if ((new_mtu < 68) || (max_frame > IXGBE_MAX_JUMBO_FRAME_SIZE)) | ||
5458 | return -EINVAL; | ||
5459 | } | ||
5446 | 5460 | ||
5447 | e_info(probe, "changing MTU from %d to %d\n", netdev->mtu, new_mtu); | 5461 | e_info(probe, "changing MTU from %d to %d\n", netdev->mtu, new_mtu); |
5448 | /* must set new MTU before calling down or up */ | 5462 | /* must set new MTU before calling down or up */ |
diff --git a/drivers/net/ixgbe/ixgbe_sriov.c b/drivers/net/ixgbe/ixgbe_sriov.c index 187b3a16ec1f..fb4868d0a32d 100644 --- a/drivers/net/ixgbe/ixgbe_sriov.c +++ b/drivers/net/ixgbe/ixgbe_sriov.c | |||
@@ -110,6 +110,33 @@ static int ixgbe_set_vf_vlan(struct ixgbe_adapter *adapter, int add, int vid, | |||
110 | return adapter->hw.mac.ops.set_vfta(&adapter->hw, vid, vf, (bool)add); | 110 | return adapter->hw.mac.ops.set_vfta(&adapter->hw, vid, vf, (bool)add); |
111 | } | 111 | } |
112 | 112 | ||
113 | void ixgbe_set_vf_lpe(struct ixgbe_adapter *adapter, u32 *msgbuf) | ||
114 | { | ||
115 | struct ixgbe_hw *hw = &adapter->hw; | ||
116 | int new_mtu = msgbuf[1]; | ||
117 | u32 max_frs; | ||
118 | int max_frame = new_mtu + ETH_HLEN + ETH_FCS_LEN; | ||
119 | |||
120 | /* Only X540 supports jumbo frames in IOV mode */ | ||
121 | if (adapter->hw.mac.type != ixgbe_mac_X540) | ||
122 | return; | ||
123 | |||
124 | /* MTU < 68 is an error and causes problems on some kernels */ | ||
125 | if ((new_mtu < 68) || (max_frame > IXGBE_MAX_JUMBO_FRAME_SIZE)) { | ||
126 | e_err(drv, "VF mtu %d out of range\n", new_mtu); | ||
127 | return; | ||
128 | } | ||
129 | |||
130 | max_frs = (IXGBE_READ_REG(hw, IXGBE_MAXFRS) & | ||
131 | IXGBE_MHADD_MFS_MASK) >> IXGBE_MHADD_MFS_SHIFT; | ||
132 | if (max_frs < new_mtu) { | ||
133 | max_frs = new_mtu << IXGBE_MHADD_MFS_SHIFT; | ||
134 | IXGBE_WRITE_REG(hw, IXGBE_MAXFRS, max_frs); | ||
135 | } | ||
136 | |||
137 | e_info(hw, "VF requests change max MTU to %d\n", new_mtu); | ||
138 | } | ||
139 | |||
113 | static void ixgbe_set_vmolr(struct ixgbe_hw *hw, u32 vf, bool aupe) | 140 | static void ixgbe_set_vmolr(struct ixgbe_hw *hw, u32 vf, bool aupe) |
114 | { | 141 | { |
115 | u32 vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf)); | 142 | u32 vmolr = IXGBE_READ_REG(hw, IXGBE_VMOLR(vf)); |
@@ -302,7 +329,7 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf) | |||
302 | hash_list, vf); | 329 | hash_list, vf); |
303 | break; | 330 | break; |
304 | case IXGBE_VF_SET_LPE: | 331 | case IXGBE_VF_SET_LPE: |
305 | WARN_ON((msgbuf[0] & 0xFFFF) == IXGBE_VF_SET_LPE); | 332 | ixgbe_set_vf_lpe(adapter, msgbuf); |
306 | break; | 333 | break; |
307 | case IXGBE_VF_SET_VLAN: | 334 | case IXGBE_VF_SET_VLAN: |
308 | add = (msgbuf[0] & IXGBE_VT_MSGINFO_MASK) | 335 | add = (msgbuf[0] & IXGBE_VT_MSGINFO_MASK) |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index fd3358f54139..ab65d13969fd 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -1680,6 +1680,8 @@ | |||
1680 | #define IXGBE_RXCTRL_DMBYPS 0x00000002 /* Descriptor Monitor Bypass */ | 1680 | #define IXGBE_RXCTRL_DMBYPS 0x00000002 /* Descriptor Monitor Bypass */ |
1681 | #define IXGBE_RXDCTL_ENABLE 0x02000000 /* Enable specific Rx Queue */ | 1681 | #define IXGBE_RXDCTL_ENABLE 0x02000000 /* Enable specific Rx Queue */ |
1682 | #define IXGBE_RXDCTL_VME 0x40000000 /* VLAN mode enable */ | 1682 | #define IXGBE_RXDCTL_VME 0x40000000 /* VLAN mode enable */ |
1683 | #define IXGBE_RXDCTL_RLPMLMASK 0x00003FFF /* Only supported on the X540 */ | ||
1684 | #define IXGBE_RXDCTL_RLPML_EN 0x00008000 | ||
1683 | 1685 | ||
1684 | #define IXGBE_FCTRL_SBP 0x00000002 /* Store Bad Packet */ | 1686 | #define IXGBE_FCTRL_SBP 0x00000002 /* Store Bad Packet */ |
1685 | #define IXGBE_FCTRL_MPE 0x00000100 /* Multicast Promiscuous Ena*/ | 1687 | #define IXGBE_FCTRL_MPE 0x00000100 /* Multicast Promiscuous Ena*/ |
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..43af761cdb16 100644 --- a/drivers/net/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ixgbevf/ixgbevf_main.c | |||
@@ -51,7 +51,7 @@ char ixgbevf_driver_name[] = "ixgbevf"; | |||
51 | static const char ixgbevf_driver_string[] = | 51 | static 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" |
55 | const char ixgbevf_driver_version[] = DRV_VERSION; | 55 | const char ixgbevf_driver_version[] = DRV_VERSION; |
56 | static char ixgbevf_copyright[] = | 56 | static char ixgbevf_copyright[] = |
57 | "Copyright (c) 2009 - 2010 Intel Corporation."; | 57 | "Copyright (c) 2009 - 2010 Intel Corporation."; |
@@ -107,7 +107,7 @@ static inline void ixgbevf_release_rx_desc(struct ixgbe_hw *hw, | |||
107 | } | 107 | } |
108 | 108 | ||
109 | /* | 109 | /* |
110 | * ixgbe_set_ivar - set the IVAR registers, mapping interrupt causes to vectors | 110 | * ixgbevf_set_ivar - set IVAR registers - maps interrupt causes to vectors |
111 | * @adapter: pointer to adapter struct | 111 | * @adapter: pointer to adapter struct |
112 | * @direction: 0 for Rx, 1 for Tx, -1 for other causes | 112 | * @direction: 0 for Rx, 1 for Tx, -1 for other causes |
113 | * @queue: queue to map the corresponding interrupt to | 113 | * @queue: queue to map the corresponding interrupt to |
@@ -1017,7 +1017,7 @@ static irqreturn_t ixgbevf_msix_clean_tx(int irq, void *data) | |||
1017 | } | 1017 | } |
1018 | 1018 | ||
1019 | /** | 1019 | /** |
1020 | * ixgbe_msix_clean_rx - single unshared vector rx clean (all queues) | 1020 | * ixgbevf_msix_clean_rx - single unshared vector rx clean (all queues) |
1021 | * @irq: unused | 1021 | * @irq: unused |
1022 | * @data: pointer to our q_vector struct for this interrupt vector | 1022 | * @data: pointer to our q_vector struct for this interrupt vector |
1023 | **/ | 1023 | **/ |
@@ -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 | } |
@@ -1967,7 +1972,7 @@ static void ixgbevf_acquire_msix_vectors(struct ixgbevf_adapter *adapter, | |||
1967 | } | 1972 | } |
1968 | 1973 | ||
1969 | /* | 1974 | /* |
1970 | * ixgbe_set_num_queues: Allocate queues for device, feature dependant | 1975 | * ixgbevf_set_num_queues: Allocate queues for device, feature dependant |
1971 | * @adapter: board private structure to initialize | 1976 | * @adapter: board private structure to initialize |
1972 | * | 1977 | * |
1973 | * This is the top level queue allocation routine. The order here is very | 1978 | * This is the top level queue allocation routine. The order here is very |
@@ -3217,10 +3222,16 @@ static int ixgbevf_set_mac(struct net_device *netdev, void *p) | |||
3217 | static int ixgbevf_change_mtu(struct net_device *netdev, int new_mtu) | 3222 | static 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 | ||
@@ -3519,9 +3534,9 @@ static struct pci_driver ixgbevf_driver = { | |||
3519 | }; | 3534 | }; |
3520 | 3535 | ||
3521 | /** | 3536 | /** |
3522 | * ixgbe_init_module - Driver Registration Routine | 3537 | * ixgbevf_init_module - Driver Registration Routine |
3523 | * | 3538 | * |
3524 | * ixgbe_init_module is the first routine called when the driver is | 3539 | * ixgbevf_init_module is the first routine called when the driver is |
3525 | * loaded. All it does is register with the PCI subsystem. | 3540 | * loaded. All it does is register with the PCI subsystem. |
3526 | **/ | 3541 | **/ |
3527 | static int __init ixgbevf_init_module(void) | 3542 | static int __init ixgbevf_init_module(void) |
@@ -3539,9 +3554,9 @@ static int __init ixgbevf_init_module(void) | |||
3539 | module_init(ixgbevf_init_module); | 3554 | module_init(ixgbevf_init_module); |
3540 | 3555 | ||
3541 | /** | 3556 | /** |
3542 | * ixgbe_exit_module - Driver Exit Cleanup Routine | 3557 | * ixgbevf_exit_module - Driver Exit Cleanup Routine |
3543 | * | 3558 | * |
3544 | * ixgbe_exit_module is called just before the driver is removed | 3559 | * ixgbevf_exit_module is called just before the driver is removed |
3545 | * from memory. | 3560 | * from memory. |
3546 | **/ | 3561 | **/ |
3547 | static void __exit ixgbevf_exit_module(void) | 3562 | static void __exit ixgbevf_exit_module(void) |
@@ -3551,7 +3566,7 @@ static void __exit ixgbevf_exit_module(void) | |||
3551 | 3566 | ||
3552 | #ifdef DEBUG | 3567 | #ifdef DEBUG |
3553 | /** | 3568 | /** |
3554 | * ixgbe_get_hw_dev_name - return device name string | 3569 | * ixgbevf_get_hw_dev_name - return device name string |
3555 | * used by hardware layer to print debugging information | 3570 | * used by hardware layer to print debugging information |
3556 | **/ | 3571 | **/ |
3557 | char *ixgbevf_get_hw_dev_name(struct ixgbe_hw *hw) | 3572 | char *ixgbevf_get_hw_dev_name(struct ixgbe_hw *hw) |