aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-06-20 18:09:47 -0400
committerDavid S. Miller <davem@davemloft.net>2012-06-20 18:09:47 -0400
commit1c11a0a100377159b53e08e2644185a51da2a47e (patch)
tree72ed74400a5055c100d233bfb3e25d52b1730637 /drivers
parentda55737467c1c3bc02271039c088171d82e0796f (diff)
parentdb01896398ae6beba41fc14f1a90d55fd21e6738 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/ethernet/intel/e1000/e1000_main.c12
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_regs.h1
-rw-r--r--drivers/net/ethernet/intel/igb/igb.h25
-rw-r--r--drivers/net/ethernet/intel/igb/igb_ethtool.c52
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c156
-rw-r--r--drivers/net/ethernet/intel/igb/igb_ptp.c12
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c4
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c147
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c23
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_type.h2
10 files changed, 291 insertions, 143 deletions
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
index 7483ca0a6282..183a4a3224ba 100644
--- a/drivers/net/ethernet/intel/e1000/e1000_main.c
+++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
@@ -1078,18 +1078,18 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
1078 netdev->priv_flags |= IFF_SUPP_NOFCS; 1078 netdev->priv_flags |= IFF_SUPP_NOFCS;
1079 1079
1080 netdev->features |= netdev->hw_features; 1080 netdev->features |= netdev->hw_features;
1081 netdev->hw_features |= NETIF_F_RXCSUM; 1081 netdev->hw_features |= (NETIF_F_RXCSUM |
1082 netdev->hw_features |= NETIF_F_RXALL; 1082 NETIF_F_RXALL |
1083 netdev->hw_features |= NETIF_F_RXFCS; 1083 NETIF_F_RXFCS);
1084 1084
1085 if (pci_using_dac) { 1085 if (pci_using_dac) {
1086 netdev->features |= NETIF_F_HIGHDMA; 1086 netdev->features |= NETIF_F_HIGHDMA;
1087 netdev->vlan_features |= NETIF_F_HIGHDMA; 1087 netdev->vlan_features |= NETIF_F_HIGHDMA;
1088 } 1088 }
1089 1089
1090 netdev->vlan_features |= NETIF_F_TSO; 1090 netdev->vlan_features |= (NETIF_F_TSO |
1091 netdev->vlan_features |= NETIF_F_HW_CSUM; 1091 NETIF_F_HW_CSUM |
1092 netdev->vlan_features |= NETIF_F_SG; 1092 NETIF_F_SG);
1093 1093
1094 netdev->priv_flags |= IFF_UNICAST_FLT; 1094 netdev->priv_flags |= IFF_UNICAST_FLT;
1095 1095
diff --git a/drivers/net/ethernet/intel/igb/e1000_regs.h b/drivers/net/ethernet/intel/igb/e1000_regs.h
index 35d1e4f2c92c..10efcd88dca0 100644
--- a/drivers/net/ethernet/intel/igb/e1000_regs.h
+++ b/drivers/net/ethernet/intel/igb/e1000_regs.h
@@ -117,6 +117,7 @@
117 117
118/* TX Rate Limit Registers */ 118/* TX Rate Limit Registers */
119#define E1000_RTTDQSEL 0x3604 /* Tx Desc Plane Queue Select - WO */ 119#define E1000_RTTDQSEL 0x3604 /* Tx Desc Plane Queue Select - WO */
120#define E1000_RTTBCNRM 0x3690 /* Tx BCN Rate-scheduler MMW */
120#define E1000_RTTBCNRC 0x36B0 /* Tx BCN Rate-Scheduler Config - WO */ 121#define E1000_RTTBCNRC 0x36B0 /* Tx BCN Rate-Scheduler Config - WO */
121 122
122/* Split and Replication RX Control - RW */ 123/* Split and Replication RX Control - RW */
diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h
index ae6d3f393a54..9e572dd29ab2 100644
--- a/drivers/net/ethernet/intel/igb/igb.h
+++ b/drivers/net/ethernet/intel/igb/igb.h
@@ -65,19 +65,30 @@ struct igb_adapter;
65#define MAX_Q_VECTORS 8 65#define MAX_Q_VECTORS 8
66 66
67/* Transmit and receive queues */ 67/* Transmit and receive queues */
68#define IGB_MAX_RX_QUEUES ((adapter->vfs_allocated_count ? 2 : \ 68#define IGB_MAX_RX_QUEUES 8
69 (hw->mac.type > e1000_82575 ? 8 : 4))) 69#define IGB_MAX_RX_QUEUES_82575 4
70#define IGB_MAX_RX_QUEUES_I210 4
71#define IGB_MAX_RX_QUEUES_I211 2 70#define IGB_MAX_RX_QUEUES_I211 2
72#define IGB_MAX_TX_QUEUES 16 71#define IGB_MAX_TX_QUEUES 8
73#define IGB_MAX_TX_QUEUES_I210 4
74#define IGB_MAX_TX_QUEUES_I211 2
75#define IGB_MAX_VF_MC_ENTRIES 30 72#define IGB_MAX_VF_MC_ENTRIES 30
76#define IGB_MAX_VF_FUNCTIONS 8 73#define IGB_MAX_VF_FUNCTIONS 8
77#define IGB_MAX_VFTA_ENTRIES 128 74#define IGB_MAX_VFTA_ENTRIES 128
78#define IGB_82576_VF_DEV_ID 0x10CA 75#define IGB_82576_VF_DEV_ID 0x10CA
79#define IGB_I350_VF_DEV_ID 0x1520 76#define IGB_I350_VF_DEV_ID 0x1520
80 77
78/* NVM version defines */
79#define IGB_MAJOR_MASK 0xF000
80#define IGB_MINOR_MASK 0x0FF0
81#define IGB_BUILD_MASK 0x000F
82#define IGB_COMB_VER_MASK 0x00FF
83#define IGB_MAJOR_SHIFT 12
84#define IGB_MINOR_SHIFT 4
85#define IGB_COMB_VER_SHFT 8
86#define IGB_NVM_VER_INVALID 0xFFFF
87#define IGB_ETRACK_SHIFT 16
88#define NVM_ETRACK_WORD 0x0042
89#define NVM_COMB_VER_OFF 0x0083
90#define NVM_COMB_VER_PTR 0x003d
91
81struct vf_data_storage { 92struct vf_data_storage {
82 unsigned char vf_mac_addresses[ETH_ALEN]; 93 unsigned char vf_mac_addresses[ETH_ALEN];
83 u16 vf_mc_hashes[IGB_MAX_VF_MC_ENTRIES]; 94 u16 vf_mc_hashes[IGB_MAX_VF_MC_ENTRIES];
@@ -371,6 +382,7 @@ struct igb_adapter {
371 spinlock_t tmreg_lock; 382 spinlock_t tmreg_lock;
372 struct cyclecounter cc; 383 struct cyclecounter cc;
373 struct timecounter tc; 384 struct timecounter tc;
385 char fw_version[32];
374}; 386};
375 387
376#define IGB_FLAG_HAS_MSI (1 << 0) 388#define IGB_FLAG_HAS_MSI (1 << 0)
@@ -420,6 +432,7 @@ extern void igb_update_stats(struct igb_adapter *, struct rtnl_link_stats64 *);
420extern bool igb_has_link(struct igb_adapter *adapter); 432extern bool igb_has_link(struct igb_adapter *adapter);
421extern void igb_set_ethtool_ops(struct net_device *); 433extern void igb_set_ethtool_ops(struct net_device *);
422extern void igb_power_up_link(struct igb_adapter *); 434extern void igb_power_up_link(struct igb_adapter *);
435extern void igb_set_fw_version(struct igb_adapter *);
423#ifdef CONFIG_IGB_PTP 436#ifdef CONFIG_IGB_PTP
424extern void igb_ptp_init(struct igb_adapter *adapter); 437extern void igb_ptp_init(struct igb_adapter *adapter);
425extern void igb_ptp_remove(struct igb_adapter *adapter); 438extern void igb_ptp_remove(struct igb_adapter *adapter);
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index 812d4f963bd1..a19c84cad0e9 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -710,6 +710,7 @@ static int igb_set_eeprom(struct net_device *netdev,
710 if ((ret_val == 0) && ((first_word <= NVM_CHECKSUM_REG))) 710 if ((ret_val == 0) && ((first_word <= NVM_CHECKSUM_REG)))
711 hw->nvm.ops.update(hw); 711 hw->nvm.ops.update(hw);
712 712
713 igb_set_fw_version(adapter);
713 kfree(eeprom_buff); 714 kfree(eeprom_buff);
714 return ret_val; 715 return ret_val;
715} 716}
@@ -718,20 +719,16 @@ static void igb_get_drvinfo(struct net_device *netdev,
718 struct ethtool_drvinfo *drvinfo) 719 struct ethtool_drvinfo *drvinfo)
719{ 720{
720 struct igb_adapter *adapter = netdev_priv(netdev); 721 struct igb_adapter *adapter = netdev_priv(netdev);
721 u16 eeprom_data;
722 722
723 strlcpy(drvinfo->driver, igb_driver_name, sizeof(drvinfo->driver)); 723 strlcpy(drvinfo->driver, igb_driver_name, sizeof(drvinfo->driver));
724 strlcpy(drvinfo->version, igb_driver_version, sizeof(drvinfo->version)); 724 strlcpy(drvinfo->version, igb_driver_version, sizeof(drvinfo->version));
725 725
726 /* EEPROM image version # is reported as firmware version # for 726 /*
727 * 82575 controllers */ 727 * EEPROM image version # is reported as firmware version # for
728 adapter->hw.nvm.ops.read(&adapter->hw, 5, 1, &eeprom_data); 728 * 82575 controllers
729 snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), 729 */
730 "%d.%d-%d", 730 strlcpy(drvinfo->fw_version, adapter->fw_version,
731 (eeprom_data & 0xF000) >> 12, 731 sizeof(drvinfo->fw_version));
732 (eeprom_data & 0x0FF0) >> 4,
733 eeprom_data & 0x000F);
734
735 strlcpy(drvinfo->bus_info, pci_name(adapter->pdev), 732 strlcpy(drvinfo->bus_info, pci_name(adapter->pdev),
736 sizeof(drvinfo->bus_info)); 733 sizeof(drvinfo->bus_info));
737 drvinfo->n_stats = IGB_STATS_LEN; 734 drvinfo->n_stats = IGB_STATS_LEN;
@@ -2271,6 +2268,38 @@ static void igb_ethtool_complete(struct net_device *netdev)
2271 pm_runtime_put(&adapter->pdev->dev); 2268 pm_runtime_put(&adapter->pdev->dev);
2272} 2269}
2273 2270
2271#ifdef CONFIG_IGB_PTP
2272static int igb_ethtool_get_ts_info(struct net_device *dev,
2273 struct ethtool_ts_info *info)
2274{
2275 struct igb_adapter *adapter = netdev_priv(dev);
2276
2277 info->so_timestamping =
2278 SOF_TIMESTAMPING_TX_HARDWARE |
2279 SOF_TIMESTAMPING_RX_HARDWARE |
2280 SOF_TIMESTAMPING_RAW_HARDWARE;
2281
2282 if (adapter->ptp_clock)
2283 info->phc_index = ptp_clock_index(adapter->ptp_clock);
2284 else
2285 info->phc_index = -1;
2286
2287 info->tx_types =
2288 (1 << HWTSTAMP_TX_OFF) |
2289 (1 << HWTSTAMP_TX_ON);
2290
2291 info->rx_filters =
2292 (1 << HWTSTAMP_FILTER_NONE) |
2293 (1 << HWTSTAMP_FILTER_ALL) |
2294 (1 << HWTSTAMP_FILTER_SOME) |
2295 (1 << HWTSTAMP_FILTER_PTP_V1_L4_SYNC) |
2296 (1 << HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ) |
2297 (1 << HWTSTAMP_FILTER_PTP_V2_EVENT);
2298
2299 return 0;
2300}
2301
2302#endif
2274static const struct ethtool_ops igb_ethtool_ops = { 2303static const struct ethtool_ops igb_ethtool_ops = {
2275 .get_settings = igb_get_settings, 2304 .get_settings = igb_get_settings,
2276 .set_settings = igb_set_settings, 2305 .set_settings = igb_set_settings,
@@ -2299,6 +2328,9 @@ static const struct ethtool_ops igb_ethtool_ops = {
2299 .set_coalesce = igb_set_coalesce, 2328 .set_coalesce = igb_set_coalesce,
2300 .begin = igb_ethtool_begin, 2329 .begin = igb_ethtool_begin,
2301 .complete = igb_ethtool_complete, 2330 .complete = igb_ethtool_complete,
2331#ifdef CONFIG_IGB_PTP
2332 .get_ts_info = igb_ethtool_get_ts_info,
2333#endif
2302}; 2334};
2303 2335
2304void igb_set_ethtool_ops(struct net_device *netdev) 2336void igb_set_ethtool_ops(struct net_device *netdev)
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index dd3bfe8cd36c..01ced68d3aac 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -59,9 +59,9 @@
59#endif 59#endif
60#include "igb.h" 60#include "igb.h"
61 61
62#define MAJ 3 62#define MAJ 4
63#define MIN 4 63#define MIN 0
64#define BUILD 7 64#define BUILD 1
65#define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \ 65#define DRV_VERSION __stringify(MAJ) "." __stringify(MIN) "." \
66__stringify(BUILD) "-k" 66__stringify(BUILD) "-k"
67char igb_driver_name[] = "igb"; 67char igb_driver_name[] = "igb";
@@ -1048,11 +1048,6 @@ static int igb_set_interrupt_capability(struct igb_adapter *adapter)
1048 if (!(adapter->flags & IGB_FLAG_QUEUE_PAIRS)) 1048 if (!(adapter->flags & IGB_FLAG_QUEUE_PAIRS))
1049 numvecs += adapter->num_tx_queues; 1049 numvecs += adapter->num_tx_queues;
1050 1050
1051 /* i210 and i211 can only have 4 MSIX vectors for rx/tx queues. */
1052 if ((adapter->hw.mac.type == e1000_i210)
1053 || (adapter->hw.mac.type == e1000_i211))
1054 numvecs = 4;
1055
1056 /* store the number of vectors reserved for queues */ 1051 /* store the number of vectors reserved for queues */
1057 adapter->num_q_vectors = numvecs; 1052 adapter->num_q_vectors = numvecs;
1058 1053
@@ -1821,6 +1816,69 @@ static const struct net_device_ops igb_netdev_ops = {
1821}; 1816};
1822 1817
1823/** 1818/**
1819 * igb_set_fw_version - Configure version string for ethtool
1820 * @adapter: adapter struct
1821 *
1822 **/
1823void igb_set_fw_version(struct igb_adapter *adapter)
1824{
1825 struct e1000_hw *hw = &adapter->hw;
1826 u16 eeprom_verh, eeprom_verl, comb_verh, comb_verl, comb_offset;
1827 u16 major, build, patch, fw_version;
1828 u32 etrack_id;
1829
1830 hw->nvm.ops.read(hw, 5, 1, &fw_version);
1831 if (adapter->hw.mac.type != e1000_i211) {
1832 hw->nvm.ops.read(hw, NVM_ETRACK_WORD, 1, &eeprom_verh);
1833 hw->nvm.ops.read(hw, (NVM_ETRACK_WORD + 1), 1, &eeprom_verl);
1834 etrack_id = (eeprom_verh << IGB_ETRACK_SHIFT) | eeprom_verl;
1835
1836 /* combo image version needs to be found */
1837 hw->nvm.ops.read(hw, NVM_COMB_VER_PTR, 1, &comb_offset);
1838 if ((comb_offset != 0x0) &&
1839 (comb_offset != IGB_NVM_VER_INVALID)) {
1840 hw->nvm.ops.read(hw, (NVM_COMB_VER_OFF + comb_offset
1841 + 1), 1, &comb_verh);
1842 hw->nvm.ops.read(hw, (NVM_COMB_VER_OFF + comb_offset),
1843 1, &comb_verl);
1844
1845 /* Only display Option Rom if it exists and is valid */
1846 if ((comb_verh && comb_verl) &&
1847 ((comb_verh != IGB_NVM_VER_INVALID) &&
1848 (comb_verl != IGB_NVM_VER_INVALID))) {
1849 major = comb_verl >> IGB_COMB_VER_SHFT;
1850 build = (comb_verl << IGB_COMB_VER_SHFT) |
1851 (comb_verh >> IGB_COMB_VER_SHFT);
1852 patch = comb_verh & IGB_COMB_VER_MASK;
1853 snprintf(adapter->fw_version,
1854 sizeof(adapter->fw_version),
1855 "%d.%d%d, 0x%08x, %d.%d.%d",
1856 (fw_version & IGB_MAJOR_MASK) >>
1857 IGB_MAJOR_SHIFT,
1858 (fw_version & IGB_MINOR_MASK) >>
1859 IGB_MINOR_SHIFT,
1860 (fw_version & IGB_BUILD_MASK),
1861 etrack_id, major, build, patch);
1862 goto out;
1863 }
1864 }
1865 snprintf(adapter->fw_version, sizeof(adapter->fw_version),
1866 "%d.%d%d, 0x%08x",
1867 (fw_version & IGB_MAJOR_MASK) >> IGB_MAJOR_SHIFT,
1868 (fw_version & IGB_MINOR_MASK) >> IGB_MINOR_SHIFT,
1869 (fw_version & IGB_BUILD_MASK), etrack_id);
1870 } else {
1871 snprintf(adapter->fw_version, sizeof(adapter->fw_version),
1872 "%d.%d%d",
1873 (fw_version & IGB_MAJOR_MASK) >> IGB_MAJOR_SHIFT,
1874 (fw_version & IGB_MINOR_MASK) >> IGB_MINOR_SHIFT,
1875 (fw_version & IGB_BUILD_MASK));
1876 }
1877out:
1878 return;
1879}
1880
1881/**
1824 * igb_probe - Device Initialization Routine 1882 * igb_probe - Device Initialization Routine
1825 * @pdev: PCI device information struct 1883 * @pdev: PCI device information struct
1826 * @ent: entry in igb_pci_tbl 1884 * @ent: entry in igb_pci_tbl
@@ -2030,6 +2088,9 @@ static int __devinit igb_probe(struct pci_dev *pdev,
2030 goto err_eeprom; 2088 goto err_eeprom;
2031 } 2089 }
2032 2090
2091 /* get firmware version for ethtool -i */
2092 igb_set_fw_version(adapter);
2093
2033 setup_timer(&adapter->watchdog_timer, igb_watchdog, 2094 setup_timer(&adapter->watchdog_timer, igb_watchdog,
2034 (unsigned long) adapter); 2095 (unsigned long) adapter);
2035 setup_timer(&adapter->phy_info_timer, igb_update_phy_info, 2096 setup_timer(&adapter->phy_info_timer, igb_update_phy_info,
@@ -2338,6 +2399,7 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
2338 struct e1000_hw *hw = &adapter->hw; 2399 struct e1000_hw *hw = &adapter->hw;
2339 struct net_device *netdev = adapter->netdev; 2400 struct net_device *netdev = adapter->netdev;
2340 struct pci_dev *pdev = adapter->pdev; 2401 struct pci_dev *pdev = adapter->pdev;
2402 u32 max_rss_queues;
2341 2403
2342 pci_read_config_word(pdev, PCI_COMMAND, &hw->bus.pci_cmd_word); 2404 pci_read_config_word(pdev, PCI_COMMAND, &hw->bus.pci_cmd_word);
2343 2405
@@ -2370,40 +2432,69 @@ static int __devinit igb_sw_init(struct igb_adapter *adapter)
2370 } else 2432 } else
2371 adapter->vfs_allocated_count = max_vfs; 2433 adapter->vfs_allocated_count = max_vfs;
2372 break; 2434 break;
2373 case e1000_i210:
2374 case e1000_i211:
2375 adapter->vfs_allocated_count = 0;
2376 break;
2377 default: 2435 default:
2378 break; 2436 break;
2379 } 2437 }
2380#endif /* CONFIG_PCI_IOV */ 2438#endif /* CONFIG_PCI_IOV */
2439
2440 /* Determine the maximum number of RSS queues supported. */
2381 switch (hw->mac.type) { 2441 switch (hw->mac.type) {
2442 case e1000_i211:
2443 max_rss_queues = IGB_MAX_RX_QUEUES_I211;
2444 break;
2445 case e1000_82575:
2382 case e1000_i210: 2446 case e1000_i210:
2383 adapter->rss_queues = min_t(u32, IGB_MAX_RX_QUEUES_I210, 2447 max_rss_queues = IGB_MAX_RX_QUEUES_82575;
2384 num_online_cpus()); 2448 break;
2449 case e1000_i350:
2450 /* I350 cannot do RSS and SR-IOV at the same time */
2451 if (!!adapter->vfs_allocated_count) {
2452 max_rss_queues = 1;
2453 break;
2454 }
2455 /* fall through */
2456 case e1000_82576:
2457 if (!!adapter->vfs_allocated_count) {
2458 max_rss_queues = 2;
2459 break;
2460 }
2461 /* fall through */
2462 case e1000_82580:
2463 default:
2464 max_rss_queues = IGB_MAX_RX_QUEUES;
2385 break; 2465 break;
2466 }
2467
2468 adapter->rss_queues = min_t(u32, max_rss_queues, num_online_cpus());
2469
2470 /* Determine if we need to pair queues. */
2471 switch (hw->mac.type) {
2472 case e1000_82575:
2386 case e1000_i211: 2473 case e1000_i211:
2387 adapter->rss_queues = min_t(u32, IGB_MAX_RX_QUEUES_I211, 2474 /* Device supports enough interrupts without queue pairing. */
2388 num_online_cpus());
2389 break; 2475 break;
2476 case e1000_82576:
2477 /*
2478 * If VFs are going to be allocated with RSS queues then we
2479 * should pair the queues in order to conserve interrupts due
2480 * to limited supply.
2481 */
2482 if ((adapter->rss_queues > 1) &&
2483 (adapter->vfs_allocated_count > 6))
2484 adapter->flags |= IGB_FLAG_QUEUE_PAIRS;
2485 /* fall through */
2486 case e1000_82580:
2487 case e1000_i350:
2488 case e1000_i210:
2390 default: 2489 default:
2391 adapter->rss_queues = min_t(u32, IGB_MAX_RX_QUEUES, 2490 /*
2392 num_online_cpus()); 2491 * If rss_queues > half of max_rss_queues, pair the queues in
2492 * order to conserve interrupts due to limited supply.
2493 */
2494 if (adapter->rss_queues > (max_rss_queues / 2))
2495 adapter->flags |= IGB_FLAG_QUEUE_PAIRS;
2393 break; 2496 break;
2394 } 2497 }
2395 /* i350 cannot do RSS and SR-IOV at the same time */
2396 if (hw->mac.type == e1000_i350 && adapter->vfs_allocated_count)
2397 adapter->rss_queues = 1;
2398
2399 /*
2400 * if rss_queues > 4 or vfs are going to be allocated with rss_queues
2401 * then we should combine the queues into a queue pair in order to
2402 * conserve interrupts due to limited supply
2403 */
2404 if ((adapter->rss_queues > 4) ||
2405 ((adapter->rss_queues > 1) && (adapter->vfs_allocated_count > 6)))
2406 adapter->flags |= IGB_FLAG_QUEUE_PAIRS;
2407 2498
2408 /* Setup and initialize a copy of the hw vlan table array */ 2499 /* Setup and initialize a copy of the hw vlan table array */
2409 adapter->shadow_vfta = kzalloc(sizeof(u32) * 2500 adapter->shadow_vfta = kzalloc(sizeof(u32) *
@@ -6997,6 +7088,11 @@ static void igb_set_vf_rate_limit(struct e1000_hw *hw, int vf, int tx_rate,
6997 } 7088 }
6998 7089
6999 wr32(E1000_RTTDQSEL, vf); /* vf X uses queue X */ 7090 wr32(E1000_RTTDQSEL, vf); /* vf X uses queue X */
7091 /*
7092 * Set global transmit compensation time to the MMW_SIZE in RTTBCNRM
7093 * register. MMW_SIZE=0x014 if 9728-byte jumbo is supported.
7094 */
7095 wr32(E1000_RTTBCNRM, 0x14);
7000 wr32(E1000_RTTBCNRC, bcnrc_val); 7096 wr32(E1000_RTTBCNRC, bcnrc_val);
7001} 7097}
7002 7098
diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
index d5ee7fa50723..c846ea9131a3 100644
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
@@ -330,7 +330,17 @@ void igb_ptp_init(struct igb_adapter *adapter)
330 330
331void igb_ptp_remove(struct igb_adapter *adapter) 331void igb_ptp_remove(struct igb_adapter *adapter)
332{ 332{
333 cancel_delayed_work_sync(&adapter->overflow_work); 333 switch (adapter->hw.mac.type) {
334 case e1000_i211:
335 case e1000_i210:
336 case e1000_i350:
337 case e1000_82580:
338 case e1000_82576:
339 cancel_delayed_work_sync(&adapter->overflow_work);
340 break;
341 default:
342 return;
343 }
334 344
335 if (adapter->ptp_clock) { 345 if (adapter->ptp_clock) {
336 ptp_clock_unregister(adapter->ptp_clock); 346 ptp_clock_unregister(adapter->ptp_clock);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
index dee64d2703f0..e7dddfd97cb9 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
@@ -241,7 +241,9 @@ static s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
241 241
242 /* Determine 1G link capabilities off of SFP+ type */ 242 /* Determine 1G link capabilities off of SFP+ type */
243 if (hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 || 243 if (hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 ||
244 hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1) { 244 hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 ||
245 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
246 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1) {
245 *speed = IXGBE_LINK_SPEED_1GB_FULL; 247 *speed = IXGBE_LINK_SPEED_1GB_FULL;
246 *negotiation = true; 248 *negotiation = true;
247 goto out; 249 goto out;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
index 3178f1ec3711..bbc7da5cdb4d 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
@@ -154,100 +154,60 @@ static int ixgbe_get_settings(struct net_device *netdev,
154{ 154{
155 struct ixgbe_adapter *adapter = netdev_priv(netdev); 155 struct ixgbe_adapter *adapter = netdev_priv(netdev);
156 struct ixgbe_hw *hw = &adapter->hw; 156 struct ixgbe_hw *hw = &adapter->hw;
157 ixgbe_link_speed supported_link;
157 u32 link_speed = 0; 158 u32 link_speed = 0;
159 bool autoneg;
158 bool link_up; 160 bool link_up;
159 161
160 ecmd->supported = SUPPORTED_10000baseT_Full; 162 hw->mac.ops.get_link_capabilities(hw, &supported_link, &autoneg);
161 ecmd->autoneg = AUTONEG_ENABLE; 163
162 ecmd->transceiver = XCVR_EXTERNAL; 164 /* set the supported link speeds */
163 if ((hw->phy.media_type == ixgbe_media_type_copper) || 165 if (supported_link & IXGBE_LINK_SPEED_10GB_FULL)
164 (hw->phy.multispeed_fiber)) { 166 ecmd->supported |= SUPPORTED_10000baseT_Full;
165 ecmd->supported |= (SUPPORTED_1000baseT_Full | 167 if (supported_link & IXGBE_LINK_SPEED_1GB_FULL)
166 SUPPORTED_Autoneg); 168 ecmd->supported |= SUPPORTED_1000baseT_Full;
167 169 if (supported_link & IXGBE_LINK_SPEED_100_FULL)
168 switch (hw->mac.type) { 170 ecmd->supported |= SUPPORTED_100baseT_Full;
169 case ixgbe_mac_X540: 171
170 ecmd->supported |= SUPPORTED_100baseT_Full; 172 /* set the advertised speeds */
171 break; 173 if (hw->phy.autoneg_advertised) {
172 default: 174 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_100_FULL)
173 break; 175 ecmd->advertising |= ADVERTISED_100baseT_Full;
174 } 176 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_10GB_FULL)
175 177 ecmd->advertising |= ADVERTISED_10000baseT_Full;
176 ecmd->advertising = ADVERTISED_Autoneg; 178 if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_1GB_FULL)
177 if (hw->phy.autoneg_advertised) { 179 ecmd->advertising |= ADVERTISED_1000baseT_Full;
178 if (hw->phy.autoneg_advertised &
179 IXGBE_LINK_SPEED_100_FULL)
180 ecmd->advertising |= ADVERTISED_100baseT_Full;
181 if (hw->phy.autoneg_advertised &
182 IXGBE_LINK_SPEED_10GB_FULL)
183 ecmd->advertising |= ADVERTISED_10000baseT_Full;
184 if (hw->phy.autoneg_advertised &
185 IXGBE_LINK_SPEED_1GB_FULL)
186 ecmd->advertising |= ADVERTISED_1000baseT_Full;
187 } else {
188 /*
189 * Default advertised modes in case
190 * phy.autoneg_advertised isn't set.
191 */
192 ecmd->advertising |= (ADVERTISED_10000baseT_Full |
193 ADVERTISED_1000baseT_Full);
194 if (hw->mac.type == ixgbe_mac_X540)
195 ecmd->advertising |= ADVERTISED_100baseT_Full;
196 }
197
198 if (hw->phy.media_type == ixgbe_media_type_copper) {
199 ecmd->supported |= SUPPORTED_TP;
200 ecmd->advertising |= ADVERTISED_TP;
201 ecmd->port = PORT_TP;
202 } else {
203 ecmd->supported |= SUPPORTED_FIBRE;
204 ecmd->advertising |= ADVERTISED_FIBRE;
205 ecmd->port = PORT_FIBRE;
206 }
207 } else if (hw->phy.media_type == ixgbe_media_type_backplane) {
208 /* Set as FIBRE until SERDES defined in kernel */
209 if (hw->device_id == IXGBE_DEV_ID_82598_BX) {
210 ecmd->supported = (SUPPORTED_1000baseT_Full |
211 SUPPORTED_FIBRE);
212 ecmd->advertising = (ADVERTISED_1000baseT_Full |
213 ADVERTISED_FIBRE);
214 ecmd->port = PORT_FIBRE;
215 ecmd->autoneg = AUTONEG_DISABLE;
216 } else if ((hw->device_id == IXGBE_DEV_ID_82599_COMBO_BACKPLANE) ||
217 (hw->device_id == IXGBE_DEV_ID_82599_KX4_MEZZ)) {
218 ecmd->supported |= (SUPPORTED_1000baseT_Full |
219 SUPPORTED_Autoneg |
220 SUPPORTED_FIBRE);
221 ecmd->advertising = (ADVERTISED_10000baseT_Full |
222 ADVERTISED_1000baseT_Full |
223 ADVERTISED_Autoneg |
224 ADVERTISED_FIBRE);
225 ecmd->port = PORT_FIBRE;
226 } else {
227 ecmd->supported |= (SUPPORTED_1000baseT_Full |
228 SUPPORTED_FIBRE);
229 ecmd->advertising = (ADVERTISED_10000baseT_Full |
230 ADVERTISED_1000baseT_Full |
231 ADVERTISED_FIBRE);
232 ecmd->port = PORT_FIBRE;
233 }
234 } else { 180 } else {
235 ecmd->supported |= SUPPORTED_FIBRE; 181 /* default modes in case phy.autoneg_advertised isn't set */
236 ecmd->advertising = (ADVERTISED_10000baseT_Full | 182 if (supported_link & IXGBE_LINK_SPEED_10GB_FULL)
237 ADVERTISED_FIBRE); 183 ecmd->advertising |= ADVERTISED_10000baseT_Full;
238 ecmd->port = PORT_FIBRE; 184 if (supported_link & IXGBE_LINK_SPEED_1GB_FULL)
239 ecmd->autoneg = AUTONEG_DISABLE; 185 ecmd->advertising |= ADVERTISED_1000baseT_Full;
186 if (supported_link & IXGBE_LINK_SPEED_100_FULL)
187 ecmd->advertising |= ADVERTISED_100baseT_Full;
240 } 188 }
241 189
242 /* Get PHY type */ 190 if (autoneg) {
191 ecmd->supported |= SUPPORTED_Autoneg;
192 ecmd->advertising |= ADVERTISED_Autoneg;
193 ecmd->autoneg = AUTONEG_ENABLE;
194 } else
195 ecmd->autoneg = AUTONEG_DISABLE;
196
197 ecmd->transceiver = XCVR_EXTERNAL;
198
199 /* Determine the remaining settings based on the PHY type. */
243 switch (adapter->hw.phy.type) { 200 switch (adapter->hw.phy.type) {
244 case ixgbe_phy_tn: 201 case ixgbe_phy_tn:
245 case ixgbe_phy_aq: 202 case ixgbe_phy_aq:
246 case ixgbe_phy_cu_unknown: 203 case ixgbe_phy_cu_unknown:
247 /* Copper 10G-BASET */ 204 ecmd->supported |= SUPPORTED_TP;
205 ecmd->advertising |= ADVERTISED_TP;
248 ecmd->port = PORT_TP; 206 ecmd->port = PORT_TP;
249 break; 207 break;
250 case ixgbe_phy_qt: 208 case ixgbe_phy_qt:
209 ecmd->supported |= SUPPORTED_FIBRE;
210 ecmd->advertising |= ADVERTISED_FIBRE;
251 ecmd->port = PORT_FIBRE; 211 ecmd->port = PORT_FIBRE;
252 break; 212 break;
253 case ixgbe_phy_nl: 213 case ixgbe_phy_nl:
@@ -257,42 +217,59 @@ static int ixgbe_get_settings(struct net_device *netdev,
257 case ixgbe_phy_sfp_avago: 217 case ixgbe_phy_sfp_avago:
258 case ixgbe_phy_sfp_intel: 218 case ixgbe_phy_sfp_intel:
259 case ixgbe_phy_sfp_unknown: 219 case ixgbe_phy_sfp_unknown:
260 switch (adapter->hw.phy.sfp_type) {
261 /* SFP+ devices, further checking needed */ 220 /* SFP+ devices, further checking needed */
221 switch (adapter->hw.phy.sfp_type) {
262 case ixgbe_sfp_type_da_cu: 222 case ixgbe_sfp_type_da_cu:
263 case ixgbe_sfp_type_da_cu_core0: 223 case ixgbe_sfp_type_da_cu_core0:
264 case ixgbe_sfp_type_da_cu_core1: 224 case ixgbe_sfp_type_da_cu_core1:
225 ecmd->supported |= SUPPORTED_FIBRE;
226 ecmd->advertising |= ADVERTISED_FIBRE;
265 ecmd->port = PORT_DA; 227 ecmd->port = PORT_DA;
266 break; 228 break;
267 case ixgbe_sfp_type_sr: 229 case ixgbe_sfp_type_sr:
268 case ixgbe_sfp_type_lr: 230 case ixgbe_sfp_type_lr:
269 case ixgbe_sfp_type_srlr_core0: 231 case ixgbe_sfp_type_srlr_core0:
270 case ixgbe_sfp_type_srlr_core1: 232 case ixgbe_sfp_type_srlr_core1:
233 ecmd->supported |= SUPPORTED_FIBRE;
234 ecmd->advertising |= ADVERTISED_FIBRE;
271 ecmd->port = PORT_FIBRE; 235 ecmd->port = PORT_FIBRE;
272 break; 236 break;
273 case ixgbe_sfp_type_not_present: 237 case ixgbe_sfp_type_not_present:
238 ecmd->supported |= SUPPORTED_FIBRE;
239 ecmd->advertising |= ADVERTISED_FIBRE;
274 ecmd->port = PORT_NONE; 240 ecmd->port = PORT_NONE;
275 break; 241 break;
276 case ixgbe_sfp_type_1g_cu_core0: 242 case ixgbe_sfp_type_1g_cu_core0:
277 case ixgbe_sfp_type_1g_cu_core1: 243 case ixgbe_sfp_type_1g_cu_core1:
244 ecmd->supported |= SUPPORTED_TP;
245 ecmd->advertising |= ADVERTISED_TP;
278 ecmd->port = PORT_TP; 246 ecmd->port = PORT_TP;
279 ecmd->supported = SUPPORTED_TP; 247 break;
280 ecmd->advertising = (ADVERTISED_1000baseT_Full | 248 case ixgbe_sfp_type_1g_sx_core0:
281 ADVERTISED_TP); 249 case ixgbe_sfp_type_1g_sx_core1:
250 ecmd->supported |= SUPPORTED_FIBRE;
251 ecmd->advertising |= ADVERTISED_FIBRE;
252 ecmd->port = PORT_FIBRE;
282 break; 253 break;
283 case ixgbe_sfp_type_unknown: 254 case ixgbe_sfp_type_unknown:
284 default: 255 default:
256 ecmd->supported |= SUPPORTED_FIBRE;
257 ecmd->advertising |= ADVERTISED_FIBRE;
285 ecmd->port = PORT_OTHER; 258 ecmd->port = PORT_OTHER;
286 break; 259 break;
287 } 260 }
288 break; 261 break;
289 case ixgbe_phy_xaui: 262 case ixgbe_phy_xaui:
263 ecmd->supported |= SUPPORTED_FIBRE;
264 ecmd->advertising |= ADVERTISED_FIBRE;
290 ecmd->port = PORT_NONE; 265 ecmd->port = PORT_NONE;
291 break; 266 break;
292 case ixgbe_phy_unknown: 267 case ixgbe_phy_unknown:
293 case ixgbe_phy_generic: 268 case ixgbe_phy_generic:
294 case ixgbe_phy_sfp_unsupported: 269 case ixgbe_phy_sfp_unsupported:
295 default: 270 default:
271 ecmd->supported |= SUPPORTED_FIBRE;
272 ecmd->advertising |= ADVERTISED_FIBRE;
296 ecmd->port = PORT_OTHER; 273 ecmd->port = PORT_OTHER;
297 break; 274 break;
298 } 275 }
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
index 24117709d6a2..71659edf81aa 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c
@@ -907,6 +907,8 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
907 * 8 SFP_act_lmt_DA_CORE1 - 82599-specific 907 * 8 SFP_act_lmt_DA_CORE1 - 82599-specific
908 * 9 SFP_1g_cu_CORE0 - 82599-specific 908 * 9 SFP_1g_cu_CORE0 - 82599-specific
909 * 10 SFP_1g_cu_CORE1 - 82599-specific 909 * 10 SFP_1g_cu_CORE1 - 82599-specific
910 * 11 SFP_1g_sx_CORE0 - 82599-specific
911 * 12 SFP_1g_sx_CORE1 - 82599-specific
910 */ 912 */
911 if (hw->mac.type == ixgbe_mac_82598EB) { 913 if (hw->mac.type == ixgbe_mac_82598EB) {
912 if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE) 914 if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
@@ -957,6 +959,13 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
957 else 959 else
958 hw->phy.sfp_type = 960 hw->phy.sfp_type =
959 ixgbe_sfp_type_1g_cu_core1; 961 ixgbe_sfp_type_1g_cu_core1;
962 } else if (comp_codes_1g & IXGBE_SFF_1GBASESX_CAPABLE) {
963 if (hw->bus.lan_id == 0)
964 hw->phy.sfp_type =
965 ixgbe_sfp_type_1g_sx_core0;
966 else
967 hw->phy.sfp_type =
968 ixgbe_sfp_type_1g_sx_core1;
960 } else { 969 } else {
961 hw->phy.sfp_type = ixgbe_sfp_type_unknown; 970 hw->phy.sfp_type = ixgbe_sfp_type_unknown;
962 } 971 }
@@ -1049,7 +1058,9 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
1049 /* Verify supported 1G SFP modules */ 1058 /* Verify supported 1G SFP modules */
1050 if (comp_codes_10g == 0 && 1059 if (comp_codes_10g == 0 &&
1051 !(hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 || 1060 !(hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1 ||
1052 hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0)) { 1061 hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0 ||
1062 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0 ||
1063 hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1)) {
1053 hw->phy.type = ixgbe_phy_sfp_unsupported; 1064 hw->phy.type = ixgbe_phy_sfp_unsupported;
1054 status = IXGBE_ERR_SFP_NOT_SUPPORTED; 1065 status = IXGBE_ERR_SFP_NOT_SUPPORTED;
1055 goto out; 1066 goto out;
@@ -1064,7 +1075,9 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
1064 hw->mac.ops.get_device_caps(hw, &enforce_sfp); 1075 hw->mac.ops.get_device_caps(hw, &enforce_sfp);
1065 if (!(enforce_sfp & IXGBE_DEVICE_CAPS_ALLOW_ANY_SFP) && 1076 if (!(enforce_sfp & IXGBE_DEVICE_CAPS_ALLOW_ANY_SFP) &&
1066 !((hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0) || 1077 !((hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core0) ||
1067 (hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1))) { 1078 (hw->phy.sfp_type == ixgbe_sfp_type_1g_cu_core1) ||
1079 (hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core0) ||
1080 (hw->phy.sfp_type == ixgbe_sfp_type_1g_sx_core1))) {
1068 /* Make sure we're a supported PHY type */ 1081 /* Make sure we're a supported PHY type */
1069 if (hw->phy.type == ixgbe_phy_sfp_intel) { 1082 if (hw->phy.type == ixgbe_phy_sfp_intel) {
1070 status = 0; 1083 status = 0;
@@ -1128,10 +1141,12 @@ s32 ixgbe_get_sfp_init_sequence_offsets(struct ixgbe_hw *hw,
1128 * SR modules 1141 * SR modules
1129 */ 1142 */
1130 if (sfp_type == ixgbe_sfp_type_da_act_lmt_core0 || 1143 if (sfp_type == ixgbe_sfp_type_da_act_lmt_core0 ||
1131 sfp_type == ixgbe_sfp_type_1g_cu_core0) 1144 sfp_type == ixgbe_sfp_type_1g_cu_core0 ||
1145 sfp_type == ixgbe_sfp_type_1g_sx_core0)
1132 sfp_type = ixgbe_sfp_type_srlr_core0; 1146 sfp_type = ixgbe_sfp_type_srlr_core0;
1133 else if (sfp_type == ixgbe_sfp_type_da_act_lmt_core1 || 1147 else if (sfp_type == ixgbe_sfp_type_da_act_lmt_core1 ||
1134 sfp_type == ixgbe_sfp_type_1g_cu_core1) 1148 sfp_type == ixgbe_sfp_type_1g_cu_core1 ||
1149 sfp_type == ixgbe_sfp_type_1g_sx_core1)
1135 sfp_type = ixgbe_sfp_type_srlr_core1; 1150 sfp_type = ixgbe_sfp_type_srlr_core1;
1136 1151
1137 /* Read offset to PHY init contents */ 1152 /* Read offset to PHY init contents */
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
index 1085c0739a3c..7416d22ec227 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
@@ -2604,6 +2604,8 @@ enum ixgbe_sfp_type {
2604 ixgbe_sfp_type_da_act_lmt_core1 = 8, 2604 ixgbe_sfp_type_da_act_lmt_core1 = 8,
2605 ixgbe_sfp_type_1g_cu_core0 = 9, 2605 ixgbe_sfp_type_1g_cu_core0 = 9,
2606 ixgbe_sfp_type_1g_cu_core1 = 10, 2606 ixgbe_sfp_type_1g_cu_core1 = 10,
2607 ixgbe_sfp_type_1g_sx_core0 = 11,
2608 ixgbe_sfp_type_1g_sx_core1 = 12,
2607 ixgbe_sfp_type_not_present = 0xFFFE, 2609 ixgbe_sfp_type_not_present = 0xFFFE,
2608 ixgbe_sfp_type_unknown = 0xFFFF 2610 ixgbe_sfp_type_unknown = 0xFFFF
2609}; 2611};