aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r--drivers/net/ixgbe/ixgbe.h3
-rw-r--r--drivers/net/ixgbe/ixgbe_82599.c128
-rw-r--r--drivers/net/ixgbe/ixgbe_dcb_nl.c2
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c63
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c40
-rw-r--r--drivers/net/ixgbe/ixgbe_type.h11
6 files changed, 196 insertions, 51 deletions
diff --git a/drivers/net/ixgbe/ixgbe.h b/drivers/net/ixgbe/ixgbe.h
index 385be6016667..2b854161c61b 100644
--- a/drivers/net/ixgbe/ixgbe.h
+++ b/drivers/net/ixgbe/ixgbe.h
@@ -340,7 +340,6 @@ struct ixgbe_adapter {
340 /* OS defined structs */ 340 /* OS defined structs */
341 struct net_device *netdev; 341 struct net_device *netdev;
342 struct pci_dev *pdev; 342 struct pci_dev *pdev;
343 struct net_device_stats net_stats;
344 343
345 u32 test_icr; 344 u32 test_icr;
346 struct ixgbe_ring test_tx_ring; 345 struct ixgbe_ring test_tx_ring;
@@ -397,7 +396,7 @@ enum ixgbe_boards {
397extern struct ixgbe_info ixgbe_82598_info; 396extern struct ixgbe_info ixgbe_82598_info;
398extern struct ixgbe_info ixgbe_82599_info; 397extern struct ixgbe_info ixgbe_82599_info;
399#ifdef CONFIG_IXGBE_DCB 398#ifdef CONFIG_IXGBE_DCB
400extern struct dcbnl_rtnl_ops dcbnl_ops; 399extern const struct dcbnl_rtnl_ops dcbnl_ops;
401extern int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *src_dcb_cfg, 400extern int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *src_dcb_cfg,
402 struct ixgbe_dcb_config *dst_dcb_cfg, 401 struct ixgbe_dcb_config *dst_dcb_cfg,
403 int tc_max); 402 int tc_max);
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index 34b04924c8a1..ae27c41222e3 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -42,6 +42,10 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,
42 ixgbe_link_speed speed, 42 ixgbe_link_speed speed,
43 bool autoneg, 43 bool autoneg,
44 bool autoneg_wait_to_complete); 44 bool autoneg_wait_to_complete);
45static s32 ixgbe_setup_mac_link_smartspeed(struct ixgbe_hw *hw,
46 ixgbe_link_speed speed,
47 bool autoneg,
48 bool autoneg_wait_to_complete);
45s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, 49s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw,
46 bool autoneg_wait_to_complete); 50 bool autoneg_wait_to_complete);
47s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw, 51s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw,
@@ -64,7 +68,13 @@ static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw)
64 /* Set up dual speed SFP+ support */ 68 /* Set up dual speed SFP+ support */
65 mac->ops.setup_link = &ixgbe_setup_mac_link_multispeed_fiber; 69 mac->ops.setup_link = &ixgbe_setup_mac_link_multispeed_fiber;
66 } else { 70 } else {
67 mac->ops.setup_link = &ixgbe_setup_mac_link_82599; 71 if ((mac->ops.get_media_type(hw) ==
72 ixgbe_media_type_backplane) &&
73 (hw->phy.smart_speed == ixgbe_smart_speed_auto ||
74 hw->phy.smart_speed == ixgbe_smart_speed_on))
75 mac->ops.setup_link = &ixgbe_setup_mac_link_smartspeed;
76 else
77 mac->ops.setup_link = &ixgbe_setup_mac_link_82599;
68 } 78 }
69} 79}
70 80
@@ -337,6 +347,7 @@ static enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw)
337 media_type = ixgbe_media_type_backplane; 347 media_type = ixgbe_media_type_backplane;
338 break; 348 break;
339 case IXGBE_DEV_ID_82599_SFP: 349 case IXGBE_DEV_ID_82599_SFP:
350 case IXGBE_DEV_ID_82599_SFP_EM:
340 media_type = ixgbe_media_type_fiber; 351 media_type = ixgbe_media_type_fiber;
341 break; 352 break;
342 case IXGBE_DEV_ID_82599_CX4: 353 case IXGBE_DEV_ID_82599_CX4:
@@ -479,7 +490,12 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,
479 hw->mac.autotry_restart = false; 490 hw->mac.autotry_restart = false;
480 } 491 }
481 492
482 /* The controller may take up to 500ms at 10g to acquire link */ 493 /*
494 * Wait for the controller to acquire link. Per IEEE 802.3ap,
495 * Section 73.10.2, we may have to wait up to 500ms if KR is
496 * attempted. 82599 uses the same timing for 10g SFI.
497 */
498
483 for (i = 0; i < 5; i++) { 499 for (i = 0; i < 5; i++) {
484 /* Wait for the link partner to also set speed */ 500 /* Wait for the link partner to also set speed */
485 msleep(100); 501 msleep(100);
@@ -567,6 +583,111 @@ out:
567} 583}
568 584
569/** 585/**
586 * ixgbe_setup_mac_link_smartspeed - Set MAC link speed using SmartSpeed
587 * @hw: pointer to hardware structure
588 * @speed: new link speed
589 * @autoneg: true if autonegotiation enabled
590 * @autoneg_wait_to_complete: true when waiting for completion is needed
591 *
592 * Implements the Intel SmartSpeed algorithm.
593 **/
594static s32 ixgbe_setup_mac_link_smartspeed(struct ixgbe_hw *hw,
595 ixgbe_link_speed speed, bool autoneg,
596 bool autoneg_wait_to_complete)
597{
598 s32 status = 0;
599 ixgbe_link_speed link_speed;
600 s32 i, j;
601 bool link_up = false;
602 u32 autoc_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC);
603
604 hw_dbg(hw, "ixgbe_setup_mac_link_smartspeed.\n");
605
606 /* Set autoneg_advertised value based on input link speed */
607 hw->phy.autoneg_advertised = 0;
608
609 if (speed & IXGBE_LINK_SPEED_10GB_FULL)
610 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_10GB_FULL;
611
612 if (speed & IXGBE_LINK_SPEED_1GB_FULL)
613 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_1GB_FULL;
614
615 if (speed & IXGBE_LINK_SPEED_100_FULL)
616 hw->phy.autoneg_advertised |= IXGBE_LINK_SPEED_100_FULL;
617
618 /*
619 * Implement Intel SmartSpeed algorithm. SmartSpeed will reduce the
620 * autoneg advertisement if link is unable to be established at the
621 * highest negotiated rate. This can sometimes happen due to integrity
622 * issues with the physical media connection.
623 */
624
625 /* First, try to get link with full advertisement */
626 hw->phy.smart_speed_active = false;
627 for (j = 0; j < IXGBE_SMARTSPEED_MAX_RETRIES; j++) {
628 status = ixgbe_setup_mac_link_82599(hw, speed, autoneg,
629 autoneg_wait_to_complete);
630 if (status)
631 goto out;
632
633 /*
634 * Wait for the controller to acquire link. Per IEEE 802.3ap,
635 * Section 73.10.2, we may have to wait up to 500ms if KR is
636 * attempted, or 200ms if KX/KX4/BX/BX4 is attempted, per
637 * Table 9 in the AN MAS.
638 */
639 for (i = 0; i < 5; i++) {
640 mdelay(100);
641
642 /* If we have link, just jump out */
643 hw->mac.ops.check_link(hw, &link_speed,
644 &link_up, false);
645 if (link_up)
646 goto out;
647 }
648 }
649
650 /*
651 * We didn't get link. If we advertised KR plus one of KX4/KX
652 * (or BX4/BX), then disable KR and try again.
653 */
654 if (((autoc_reg & IXGBE_AUTOC_KR_SUPP) == 0) ||
655 ((autoc_reg & IXGBE_AUTOC_KX4_KX_SUPP_MASK) == 0))
656 goto out;
657
658 /* Turn SmartSpeed on to disable KR support */
659 hw->phy.smart_speed_active = true;
660 status = ixgbe_setup_mac_link_82599(hw, speed, autoneg,
661 autoneg_wait_to_complete);
662 if (status)
663 goto out;
664
665 /*
666 * Wait for the controller to acquire link. 600ms will allow for
667 * the AN link_fail_inhibit_timer as well for multiple cycles of
668 * parallel detect, both 10g and 1g. This allows for the maximum
669 * connect attempts as defined in the AN MAS table 73-7.
670 */
671 for (i = 0; i < 6; i++) {
672 mdelay(100);
673
674 /* If we have link, just jump out */
675 hw->mac.ops.check_link(hw, &link_speed,
676 &link_up, false);
677 if (link_up)
678 goto out;
679 }
680
681 /* We didn't get link. Turn SmartSpeed back off. */
682 hw->phy.smart_speed_active = false;
683 status = ixgbe_setup_mac_link_82599(hw, speed, autoneg,
684 autoneg_wait_to_complete);
685
686out:
687 return status;
688}
689
690/**
570 * ixgbe_check_mac_link_82599 - Determine link and speed status 691 * ixgbe_check_mac_link_82599 - Determine link and speed status
571 * @hw: pointer to hardware structure 692 * @hw: pointer to hardware structure
572 * @speed: pointer to link speed 693 * @speed: pointer to link speed
@@ -669,7 +790,8 @@ s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw,
669 if (speed & IXGBE_LINK_SPEED_10GB_FULL) 790 if (speed & IXGBE_LINK_SPEED_10GB_FULL)
670 if (orig_autoc & IXGBE_AUTOC_KX4_SUPP) 791 if (orig_autoc & IXGBE_AUTOC_KX4_SUPP)
671 autoc |= IXGBE_AUTOC_KX4_SUPP; 792 autoc |= IXGBE_AUTOC_KX4_SUPP;
672 if (orig_autoc & IXGBE_AUTOC_KR_SUPP) 793 if ((orig_autoc & IXGBE_AUTOC_KR_SUPP) &&
794 (hw->phy.smart_speed_active == false))
673 autoc |= IXGBE_AUTOC_KR_SUPP; 795 autoc |= IXGBE_AUTOC_KR_SUPP;
674 if (speed & IXGBE_LINK_SPEED_1GB_FULL) 796 if (speed & IXGBE_LINK_SPEED_1GB_FULL)
675 autoc |= IXGBE_AUTOC_KX_SUPP; 797 autoc |= IXGBE_AUTOC_KX_SUPP;
diff --git a/drivers/net/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ixgbe/ixgbe_dcb_nl.c
index a6bc1ef28f92..3c7a79a7d7c6 100644
--- a/drivers/net/ixgbe/ixgbe_dcb_nl.c
+++ b/drivers/net/ixgbe/ixgbe_dcb_nl.c
@@ -563,7 +563,7 @@ static u8 ixgbe_dcbnl_setapp(struct net_device *netdev,
563 return rval; 563 return rval;
564} 564}
565 565
566struct dcbnl_rtnl_ops dcbnl_ops = { 566const struct dcbnl_rtnl_ops dcbnl_ops = {
567 .getstate = ixgbe_dcbnl_get_state, 567 .getstate = ixgbe_dcbnl_get_state,
568 .setstate = ixgbe_dcbnl_set_state, 568 .setstate = ixgbe_dcbnl_set_state,
569 .getpermhwaddr = ixgbe_dcbnl_get_perm_hw_addr, 569 .getpermhwaddr = ixgbe_dcbnl_get_perm_hw_addr,
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 856c18c207f3..9d2cc833691b 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -40,19 +40,27 @@
40 40
41#define IXGBE_ALL_RAR_ENTRIES 16 41#define IXGBE_ALL_RAR_ENTRIES 16
42 42
43enum {NETDEV_STATS, IXGBE_STATS};
44
43struct ixgbe_stats { 45struct ixgbe_stats {
44 char stat_string[ETH_GSTRING_LEN]; 46 char stat_string[ETH_GSTRING_LEN];
47 int type;
45 int sizeof_stat; 48 int sizeof_stat;
46 int stat_offset; 49 int stat_offset;
47}; 50};
48 51
49#define IXGBE_STAT(m) sizeof(((struct ixgbe_adapter *)0)->m), \ 52#define IXGBE_STAT(m) IXGBE_STATS, \
50 offsetof(struct ixgbe_adapter, m) 53 sizeof(((struct ixgbe_adapter *)0)->m), \
54 offsetof(struct ixgbe_adapter, m)
55#define IXGBE_NETDEV_STAT(m) NETDEV_STATS, \
56 sizeof(((struct net_device *)0)->m), \
57 offsetof(struct net_device, m)
58
51static struct ixgbe_stats ixgbe_gstrings_stats[] = { 59static struct ixgbe_stats ixgbe_gstrings_stats[] = {
52 {"rx_packets", IXGBE_STAT(net_stats.rx_packets)}, 60 {"rx_packets", IXGBE_NETDEV_STAT(stats.rx_packets)},
53 {"tx_packets", IXGBE_STAT(net_stats.tx_packets)}, 61 {"tx_packets", IXGBE_NETDEV_STAT(stats.tx_packets)},
54 {"rx_bytes", IXGBE_STAT(net_stats.rx_bytes)}, 62 {"rx_bytes", IXGBE_NETDEV_STAT(stats.rx_bytes)},
55 {"tx_bytes", IXGBE_STAT(net_stats.tx_bytes)}, 63 {"tx_bytes", IXGBE_NETDEV_STAT(stats.tx_bytes)},
56 {"rx_pkts_nic", IXGBE_STAT(stats.gprc)}, 64 {"rx_pkts_nic", IXGBE_STAT(stats.gprc)},
57 {"tx_pkts_nic", IXGBE_STAT(stats.gptc)}, 65 {"tx_pkts_nic", IXGBE_STAT(stats.gptc)},
58 {"rx_bytes_nic", IXGBE_STAT(stats.gorc)}, 66 {"rx_bytes_nic", IXGBE_STAT(stats.gorc)},
@@ -60,26 +68,26 @@ static struct ixgbe_stats ixgbe_gstrings_stats[] = {
60 {"lsc_int", IXGBE_STAT(lsc_int)}, 68 {"lsc_int", IXGBE_STAT(lsc_int)},
61 {"tx_busy", IXGBE_STAT(tx_busy)}, 69 {"tx_busy", IXGBE_STAT(tx_busy)},
62 {"non_eop_descs", IXGBE_STAT(non_eop_descs)}, 70 {"non_eop_descs", IXGBE_STAT(non_eop_descs)},
63 {"rx_errors", IXGBE_STAT(net_stats.rx_errors)}, 71 {"rx_errors", IXGBE_NETDEV_STAT(stats.rx_errors)},
64 {"tx_errors", IXGBE_STAT(net_stats.tx_errors)}, 72 {"tx_errors", IXGBE_NETDEV_STAT(stats.tx_errors)},
65 {"rx_dropped", IXGBE_STAT(net_stats.rx_dropped)}, 73 {"rx_dropped", IXGBE_NETDEV_STAT(stats.rx_dropped)},
66 {"tx_dropped", IXGBE_STAT(net_stats.tx_dropped)}, 74 {"tx_dropped", IXGBE_NETDEV_STAT(stats.tx_dropped)},
67 {"multicast", IXGBE_STAT(net_stats.multicast)}, 75 {"multicast", IXGBE_NETDEV_STAT(stats.multicast)},
68 {"broadcast", IXGBE_STAT(stats.bprc)}, 76 {"broadcast", IXGBE_STAT(stats.bprc)},
69 {"rx_no_buffer_count", IXGBE_STAT(stats.rnbc[0]) }, 77 {"rx_no_buffer_count", IXGBE_STAT(stats.rnbc[0]) },
70 {"collisions", IXGBE_STAT(net_stats.collisions)}, 78 {"collisions", IXGBE_NETDEV_STAT(stats.collisions)},
71 {"rx_over_errors", IXGBE_STAT(net_stats.rx_over_errors)}, 79 {"rx_over_errors", IXGBE_NETDEV_STAT(stats.rx_over_errors)},
72 {"rx_crc_errors", IXGBE_STAT(net_stats.rx_crc_errors)}, 80 {"rx_crc_errors", IXGBE_NETDEV_STAT(stats.rx_crc_errors)},
73 {"rx_frame_errors", IXGBE_STAT(net_stats.rx_frame_errors)}, 81 {"rx_frame_errors", IXGBE_NETDEV_STAT(stats.rx_frame_errors)},
74 {"hw_rsc_count", IXGBE_STAT(rsc_count)}, 82 {"hw_rsc_count", IXGBE_STAT(rsc_count)},
75 {"fdir_match", IXGBE_STAT(stats.fdirmatch)}, 83 {"fdir_match", IXGBE_STAT(stats.fdirmatch)},
76 {"fdir_miss", IXGBE_STAT(stats.fdirmiss)}, 84 {"fdir_miss", IXGBE_STAT(stats.fdirmiss)},
77 {"rx_fifo_errors", IXGBE_STAT(net_stats.rx_fifo_errors)}, 85 {"rx_fifo_errors", IXGBE_NETDEV_STAT(stats.rx_fifo_errors)},
78 {"rx_missed_errors", IXGBE_STAT(net_stats.rx_missed_errors)}, 86 {"rx_missed_errors", IXGBE_NETDEV_STAT(stats.rx_missed_errors)},
79 {"tx_aborted_errors", IXGBE_STAT(net_stats.tx_aborted_errors)}, 87 {"tx_aborted_errors", IXGBE_NETDEV_STAT(stats.tx_aborted_errors)},
80 {"tx_carrier_errors", IXGBE_STAT(net_stats.tx_carrier_errors)}, 88 {"tx_carrier_errors", IXGBE_NETDEV_STAT(stats.tx_carrier_errors)},
81 {"tx_fifo_errors", IXGBE_STAT(net_stats.tx_fifo_errors)}, 89 {"tx_fifo_errors", IXGBE_NETDEV_STAT(stats.tx_fifo_errors)},
82 {"tx_heartbeat_errors", IXGBE_STAT(net_stats.tx_heartbeat_errors)}, 90 {"tx_heartbeat_errors", IXGBE_NETDEV_STAT(stats.tx_heartbeat_errors)},
83 {"tx_timeout_count", IXGBE_STAT(tx_timeout_count)}, 91 {"tx_timeout_count", IXGBE_STAT(tx_timeout_count)},
84 {"tx_restart_queue", IXGBE_STAT(restart_queue)}, 92 {"tx_restart_queue", IXGBE_STAT(restart_queue)},
85 {"rx_long_length_errors", IXGBE_STAT(stats.roc)}, 93 {"rx_long_length_errors", IXGBE_STAT(stats.roc)},
@@ -933,10 +941,21 @@ static void ixgbe_get_ethtool_stats(struct net_device *netdev,
933 int stat_count = sizeof(struct ixgbe_queue_stats) / sizeof(u64); 941 int stat_count = sizeof(struct ixgbe_queue_stats) / sizeof(u64);
934 int j, k; 942 int j, k;
935 int i; 943 int i;
944 char *p = NULL;
936 945
937 ixgbe_update_stats(adapter); 946 ixgbe_update_stats(adapter);
938 for (i = 0; i < IXGBE_GLOBAL_STATS_LEN; i++) { 947 for (i = 0; i < IXGBE_GLOBAL_STATS_LEN; i++) {
939 char *p = (char *)adapter + ixgbe_gstrings_stats[i].stat_offset; 948 switch (ixgbe_gstrings_stats[i].type) {
949 case NETDEV_STATS:
950 p = (char *) netdev +
951 ixgbe_gstrings_stats[i].stat_offset;
952 break;
953 case IXGBE_STATS:
954 p = (char *) adapter +
955 ixgbe_gstrings_stats[i].stat_offset;
956 break;
957 }
958
940 data[i] = (ixgbe_gstrings_stats[i].sizeof_stat == 959 data[i] = (ixgbe_gstrings_stats[i].sizeof_stat ==
941 sizeof(u64)) ? *(u64 *)p : *(u32 *)p; 960 sizeof(u64)) ? *(u64 *)p : *(u32 *)p;
942 } 961 }
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index cbb143ca1eb8..4c8a44919705 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -97,6 +97,8 @@ static struct pci_device_id ixgbe_pci_tbl[] = {
97 board_82599 }, 97 board_82599 },
98 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP), 98 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP),
99 board_82599 }, 99 board_82599 },
100 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP_EM),
101 board_82599 },
100 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_KX4_MEZZ), 102 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_KX4_MEZZ),
101 board_82599 }, 103 board_82599 },
102 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_CX4), 104 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_CX4),
@@ -372,8 +374,8 @@ static bool ixgbe_clean_tx_irq(struct ixgbe_q_vector *q_vector,
372 tx_ring->total_packets += total_packets; 374 tx_ring->total_packets += total_packets;
373 tx_ring->stats.packets += total_packets; 375 tx_ring->stats.packets += total_packets;
374 tx_ring->stats.bytes += total_bytes; 376 tx_ring->stats.bytes += total_bytes;
375 adapter->net_stats.tx_bytes += total_bytes; 377 netdev->stats.tx_bytes += total_bytes;
376 adapter->net_stats.tx_packets += total_packets; 378 netdev->stats.tx_packets += total_packets;
377 return (count < tx_ring->work_limit); 379 return (count < tx_ring->work_limit);
378} 380}
379 381
@@ -614,22 +616,14 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter,
614 616
615 if (!bi->skb) { 617 if (!bi->skb) {
616 struct sk_buff *skb; 618 struct sk_buff *skb;
617 skb = netdev_alloc_skb(adapter->netdev, 619 skb = netdev_alloc_skb_ip_align(adapter->netdev,
618 (rx_ring->rx_buf_len + 620 rx_ring->rx_buf_len);
619 NET_IP_ALIGN));
620 621
621 if (!skb) { 622 if (!skb) {
622 adapter->alloc_rx_buff_failed++; 623 adapter->alloc_rx_buff_failed++;
623 goto no_buffers; 624 goto no_buffers;
624 } 625 }
625 626
626 /*
627 * Make buffer alignment 2 beyond a 16 byte boundary
628 * this will result in a 16 byte aligned IP header after
629 * the 14 byte MAC header is removed
630 */
631 skb_reserve(skb, NET_IP_ALIGN);
632
633 bi->skb = skb; 627 bi->skb = skb;
634 bi->dma = pci_map_single(pdev, skb->data, 628 bi->dma = pci_map_single(pdev, skb->data,
635 rx_ring->rx_buf_len, 629 rx_ring->rx_buf_len,
@@ -709,6 +703,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
709 int *work_done, int work_to_do) 703 int *work_done, int work_to_do)
710{ 704{
711 struct ixgbe_adapter *adapter = q_vector->adapter; 705 struct ixgbe_adapter *adapter = q_vector->adapter;
706 struct net_device *netdev = adapter->netdev;
712 struct pci_dev *pdev = adapter->pdev; 707 struct pci_dev *pdev = adapter->pdev;
713 union ixgbe_adv_rx_desc *rx_desc, *next_rxd; 708 union ixgbe_adv_rx_desc *rx_desc, *next_rxd;
714 struct ixgbe_rx_buffer *rx_buffer_info, *next_buffer; 709 struct ixgbe_rx_buffer *rx_buffer_info, *next_buffer;
@@ -880,8 +875,8 @@ next_desc:
880 875
881 rx_ring->total_packets += total_rx_packets; 876 rx_ring->total_packets += total_rx_packets;
882 rx_ring->total_bytes += total_rx_bytes; 877 rx_ring->total_bytes += total_rx_bytes;
883 adapter->net_stats.rx_bytes += total_rx_bytes; 878 netdev->stats.rx_bytes += total_rx_bytes;
884 adapter->net_stats.rx_packets += total_rx_packets; 879 netdev->stats.rx_packets += total_rx_packets;
885 880
886 return cleaned; 881 return cleaned;
887} 882}
@@ -4403,6 +4398,7 @@ static void ixgbe_shutdown(struct pci_dev *pdev)
4403 **/ 4398 **/
4404void ixgbe_update_stats(struct ixgbe_adapter *adapter) 4399void ixgbe_update_stats(struct ixgbe_adapter *adapter)
4405{ 4400{
4401 struct net_device *netdev = adapter->netdev;
4406 struct ixgbe_hw *hw = &adapter->hw; 4402 struct ixgbe_hw *hw = &adapter->hw;
4407 u64 total_mpc = 0; 4403 u64 total_mpc = 0;
4408 u32 i, missed_rx = 0, mpc, bprc, lxon, lxoff, xon_off_tot; 4404 u32 i, missed_rx = 0, mpc, bprc, lxon, lxoff, xon_off_tot;
@@ -4522,15 +4518,15 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
4522 adapter->stats.bptc += IXGBE_READ_REG(hw, IXGBE_BPTC); 4518 adapter->stats.bptc += IXGBE_READ_REG(hw, IXGBE_BPTC);
4523 4519
4524 /* Fill out the OS statistics structure */ 4520 /* Fill out the OS statistics structure */
4525 adapter->net_stats.multicast = adapter->stats.mprc; 4521 netdev->stats.multicast = adapter->stats.mprc;
4526 4522
4527 /* Rx Errors */ 4523 /* Rx Errors */
4528 adapter->net_stats.rx_errors = adapter->stats.crcerrs + 4524 netdev->stats.rx_errors = adapter->stats.crcerrs +
4529 adapter->stats.rlec; 4525 adapter->stats.rlec;
4530 adapter->net_stats.rx_dropped = 0; 4526 netdev->stats.rx_dropped = 0;
4531 adapter->net_stats.rx_length_errors = adapter->stats.rlec; 4527 netdev->stats.rx_length_errors = adapter->stats.rlec;
4532 adapter->net_stats.rx_crc_errors = adapter->stats.crcerrs; 4528 netdev->stats.rx_crc_errors = adapter->stats.crcerrs;
4533 adapter->net_stats.rx_missed_errors = total_mpc; 4529 netdev->stats.rx_missed_errors = total_mpc;
4534} 4530}
4535 4531
4536/** 4532/**
@@ -5300,10 +5296,8 @@ static netdev_tx_t ixgbe_xmit_frame(struct sk_buff *skb,
5300 **/ 5296 **/
5301static struct net_device_stats *ixgbe_get_stats(struct net_device *netdev) 5297static struct net_device_stats *ixgbe_get_stats(struct net_device *netdev)
5302{ 5298{
5303 struct ixgbe_adapter *adapter = netdev_priv(netdev);
5304
5305 /* only return the current stats */ 5299 /* only return the current stats */
5306 return &adapter->net_stats; 5300 return &netdev->stats;
5307} 5301}
5308 5302
5309/** 5303/**
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
index ef4bdd58e016..1cab53eb22f3 100644
--- a/drivers/net/ixgbe/ixgbe_type.h
+++ b/drivers/net/ixgbe/ixgbe_type.h
@@ -52,6 +52,7 @@
52#define IXGBE_DEV_ID_82599_KX4_MEZZ 0x1514 52#define IXGBE_DEV_ID_82599_KX4_MEZZ 0x1514
53#define IXGBE_DEV_ID_82599_CX4 0x10F9 53#define IXGBE_DEV_ID_82599_CX4 0x10F9
54#define IXGBE_DEV_ID_82599_SFP 0x10FB 54#define IXGBE_DEV_ID_82599_SFP 0x10FB
55#define IXGBE_DEV_ID_82599_SFP_EM 0x1507
55#define IXGBE_DEV_ID_82599_XAUI_LOM 0x10FC 56#define IXGBE_DEV_ID_82599_XAUI_LOM 0x10FC
56#define IXGBE_DEV_ID_82599_COMBO_BACKPLANE 0x10F8 57#define IXGBE_DEV_ID_82599_COMBO_BACKPLANE 0x10F8
57 58
@@ -2171,6 +2172,14 @@ enum ixgbe_fc_mode {
2171 ixgbe_fc_default 2172 ixgbe_fc_default
2172}; 2173};
2173 2174
2175/* Smart Speed Settings */
2176#define IXGBE_SMARTSPEED_MAX_RETRIES 3
2177enum ixgbe_smart_speed {
2178 ixgbe_smart_speed_auto = 0,
2179 ixgbe_smart_speed_on,
2180 ixgbe_smart_speed_off
2181};
2182
2174/* PCI bus types */ 2183/* PCI bus types */
2175enum ixgbe_bus_type { 2184enum ixgbe_bus_type {
2176 ixgbe_bus_type_unknown = 0, 2185 ixgbe_bus_type_unknown = 0,
@@ -2431,6 +2440,8 @@ struct ixgbe_phy_info {
2431 enum ixgbe_media_type media_type; 2440 enum ixgbe_media_type media_type;
2432 bool reset_disable; 2441 bool reset_disable;
2433 ixgbe_autoneg_advertised autoneg_advertised; 2442 ixgbe_autoneg_advertised autoneg_advertised;
2443 enum ixgbe_smart_speed smart_speed;
2444 bool smart_speed_active;
2434 bool multispeed_fiber; 2445 bool multispeed_fiber;
2435}; 2446};
2436 2447