aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe/ixgbe_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_main.c')
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c167
1 files changed, 82 insertions, 85 deletions
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index e3442f47f932..77b0381a2b5c 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -34,6 +34,7 @@
34#include <linux/in.h> 34#include <linux/in.h>
35#include <linux/ip.h> 35#include <linux/ip.h>
36#include <linux/tcp.h> 36#include <linux/tcp.h>
37#include <linux/pkt_sched.h>
37#include <linux/ipv6.h> 38#include <linux/ipv6.h>
38#include <net/checksum.h> 39#include <net/checksum.h>
39#include <net/ip6_checksum.h> 40#include <net/ip6_checksum.h>
@@ -491,12 +492,12 @@ static void ixgbe_receive_skb(struct ixgbe_q_vector *q_vector,
491 492
492 skb_record_rx_queue(skb, ring->queue_index); 493 skb_record_rx_queue(skb, ring->queue_index);
493 if (!(adapter->flags & IXGBE_FLAG_IN_NETPOLL)) { 494 if (!(adapter->flags & IXGBE_FLAG_IN_NETPOLL)) {
494 if (adapter->vlgrp && is_vlan && (tag != 0)) 495 if (adapter->vlgrp && is_vlan && (tag & VLAN_VID_MASK))
495 vlan_gro_receive(napi, adapter->vlgrp, tag, skb); 496 vlan_gro_receive(napi, adapter->vlgrp, tag, skb);
496 else 497 else
497 napi_gro_receive(napi, skb); 498 napi_gro_receive(napi, skb);
498 } else { 499 } else {
499 if (adapter->vlgrp && is_vlan && (tag != 0)) 500 if (adapter->vlgrp && is_vlan && (tag & VLAN_VID_MASK))
500 vlan_hwaccel_rx(skb, adapter->vlgrp, tag); 501 vlan_hwaccel_rx(skb, adapter->vlgrp, tag);
501 else 502 else
502 netif_rx(skb); 503 netif_rx(skb);
@@ -510,8 +511,11 @@ static void ixgbe_receive_skb(struct ixgbe_q_vector *q_vector,
510 * @skb: skb currently being received and modified 511 * @skb: skb currently being received and modified
511 **/ 512 **/
512static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter, 513static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter,
513 u32 status_err, struct sk_buff *skb) 514 union ixgbe_adv_rx_desc *rx_desc,
515 struct sk_buff *skb)
514{ 516{
517 u32 status_err = le32_to_cpu(rx_desc->wb.upper.status_error);
518
515 skb->ip_summed = CHECKSUM_NONE; 519 skb->ip_summed = CHECKSUM_NONE;
516 520
517 /* Rx csum disabled */ 521 /* Rx csum disabled */
@@ -529,6 +533,16 @@ static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter,
529 return; 533 return;
530 534
531 if (status_err & IXGBE_RXDADV_ERR_TCPE) { 535 if (status_err & IXGBE_RXDADV_ERR_TCPE) {
536 u16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info;
537
538 /*
539 * 82599 errata, UDP frames with a 0 checksum can be marked as
540 * checksum errors.
541 */
542 if ((pkt_info & IXGBE_RXDADV_PKTTYPE_UDP) &&
543 (adapter->hw.mac.type == ixgbe_mac_82599EB))
544 return;
545
532 adapter->hw_csum_rx_error++; 546 adapter->hw_csum_rx_error++;
533 return; 547 return;
534 } 548 }
@@ -571,7 +585,7 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter,
571 rx_desc = IXGBE_RX_DESC_ADV(*rx_ring, i); 585 rx_desc = IXGBE_RX_DESC_ADV(*rx_ring, i);
572 586
573 if (!bi->page_dma && 587 if (!bi->page_dma &&
574 (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED)) { 588 (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED)) {
575 if (!bi->page) { 589 if (!bi->page) {
576 bi->page = alloc_page(GFP_ATOMIC); 590 bi->page = alloc_page(GFP_ATOMIC);
577 if (!bi->page) { 591 if (!bi->page) {
@@ -615,7 +629,7 @@ static void ixgbe_alloc_rx_buffers(struct ixgbe_adapter *adapter,
615 } 629 }
616 /* Refresh the desc even if buffer_addrs didn't change because 630 /* Refresh the desc even if buffer_addrs didn't change because
617 * each write-back erases this info. */ 631 * each write-back erases this info. */
618 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) { 632 if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) {
619 rx_desc->read.pkt_addr = cpu_to_le64(bi->page_dma); 633 rx_desc->read.pkt_addr = cpu_to_le64(bi->page_dma);
620 rx_desc->read.hdr_addr = cpu_to_le64(bi->dma); 634 rx_desc->read.hdr_addr = cpu_to_le64(bi->dma);
621 } else { 635 } else {
@@ -712,7 +726,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
712 break; 726 break;
713 (*work_done)++; 727 (*work_done)++;
714 728
715 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) { 729 if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) {
716 hdr_info = le16_to_cpu(ixgbe_get_hdr_info(rx_desc)); 730 hdr_info = le16_to_cpu(ixgbe_get_hdr_info(rx_desc));
717 len = (hdr_info & IXGBE_RXDADV_HDRBUFLEN_MASK) >> 731 len = (hdr_info & IXGBE_RXDADV_HDRBUFLEN_MASK) >>
718 IXGBE_RXDADV_HDRBUFLEN_SHIFT; 732 IXGBE_RXDADV_HDRBUFLEN_SHIFT;
@@ -766,7 +780,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
766 prefetch(next_rxd); 780 prefetch(next_rxd);
767 cleaned_count++; 781 cleaned_count++;
768 782
769 if (adapter->flags & IXGBE_FLAG2_RSC_CAPABLE) 783 if (adapter->flags2 & IXGBE_FLAG2_RSC_CAPABLE)
770 rsc_count = ixgbe_get_rsc_count(rx_desc); 784 rsc_count = ixgbe_get_rsc_count(rx_desc);
771 785
772 if (rsc_count) { 786 if (rsc_count) {
@@ -784,7 +798,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
784 rx_ring->stats.packets++; 798 rx_ring->stats.packets++;
785 rx_ring->stats.bytes += skb->len; 799 rx_ring->stats.bytes += skb->len;
786 } else { 800 } else {
787 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) { 801 if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) {
788 rx_buffer_info->skb = next_buffer->skb; 802 rx_buffer_info->skb = next_buffer->skb;
789 rx_buffer_info->dma = next_buffer->dma; 803 rx_buffer_info->dma = next_buffer->dma;
790 next_buffer->skb = skb; 804 next_buffer->skb = skb;
@@ -802,7 +816,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
802 goto next_desc; 816 goto next_desc;
803 } 817 }
804 818
805 ixgbe_rx_checksum(adapter, staterr, skb); 819 ixgbe_rx_checksum(adapter, rx_desc, skb);
806 820
807 /* probably a little skewed due to removing CRC */ 821 /* probably a little skewed due to removing CRC */
808 total_rx_bytes += skb->len; 822 total_rx_bytes += skb->len;
@@ -1884,46 +1898,19 @@ static void ixgbe_configure_tx(struct ixgbe_adapter *adapter)
1884 1898
1885#define IXGBE_SRRCTL_BSIZEHDRSIZE_SHIFT 2 1899#define IXGBE_SRRCTL_BSIZEHDRSIZE_SHIFT 2
1886 1900
1887static void ixgbe_configure_srrctl(struct ixgbe_adapter *adapter, int index) 1901static void ixgbe_configure_srrctl(struct ixgbe_adapter *adapter,
1902 struct ixgbe_ring *rx_ring)
1888{ 1903{
1889 struct ixgbe_ring *rx_ring;
1890 u32 srrctl; 1904 u32 srrctl;
1891 int queue0 = 0; 1905 int index;
1892 unsigned long mask;
1893 struct ixgbe_ring_feature *feature = adapter->ring_feature; 1906 struct ixgbe_ring_feature *feature = adapter->ring_feature;
1894 1907
1895 if (adapter->hw.mac.type == ixgbe_mac_82599EB) { 1908 index = rx_ring->reg_idx;
1896 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { 1909 if (adapter->hw.mac.type == ixgbe_mac_82598EB) {
1897 int dcb_i = feature[RING_F_DCB].indices; 1910 unsigned long mask;
1898 if (dcb_i == 8)
1899 queue0 = index >> 4;
1900 else if (dcb_i == 4)
1901 queue0 = index >> 5;
1902 else
1903 dev_err(&adapter->pdev->dev, "Invalid DCB "
1904 "configuration\n");
1905#ifdef IXGBE_FCOE
1906 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) {
1907 struct ixgbe_ring_feature *f;
1908
1909 rx_ring = &adapter->rx_ring[queue0];
1910 f = &adapter->ring_feature[RING_F_FCOE];
1911 if ((queue0 == 0) && (index > rx_ring->reg_idx))
1912 queue0 = f->mask + index -
1913 rx_ring->reg_idx - 1;
1914 }
1915#endif /* IXGBE_FCOE */
1916 } else {
1917 queue0 = index;
1918 }
1919 } else {
1920 mask = (unsigned long) feature[RING_F_RSS].mask; 1911 mask = (unsigned long) feature[RING_F_RSS].mask;
1921 queue0 = index & mask;
1922 index = index & mask; 1912 index = index & mask;
1923 } 1913 }
1924
1925 rx_ring = &adapter->rx_ring[queue0];
1926
1927 srrctl = IXGBE_READ_REG(&adapter->hw, IXGBE_SRRCTL(index)); 1914 srrctl = IXGBE_READ_REG(&adapter->hw, IXGBE_SRRCTL(index));
1928 1915
1929 srrctl &= ~IXGBE_SRRCTL_BSIZEHDR_MASK; 1916 srrctl &= ~IXGBE_SRRCTL_BSIZEHDR_MASK;
@@ -1932,7 +1919,7 @@ static void ixgbe_configure_srrctl(struct ixgbe_adapter *adapter, int index)
1932 srrctl |= (IXGBE_RX_HDR_SIZE << IXGBE_SRRCTL_BSIZEHDRSIZE_SHIFT) & 1919 srrctl |= (IXGBE_RX_HDR_SIZE << IXGBE_SRRCTL_BSIZEHDRSIZE_SHIFT) &
1933 IXGBE_SRRCTL_BSIZEHDR_MASK; 1920 IXGBE_SRRCTL_BSIZEHDR_MASK;
1934 1921
1935 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) { 1922 if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) {
1936#if (PAGE_SIZE / 2) > IXGBE_MAX_RXBUFFER 1923#if (PAGE_SIZE / 2) > IXGBE_MAX_RXBUFFER
1937 srrctl |= IXGBE_MAX_RXBUFFER >> IXGBE_SRRCTL_BSIZEPKT_SHIFT; 1924 srrctl |= IXGBE_MAX_RXBUFFER >> IXGBE_SRRCTL_BSIZEPKT_SHIFT;
1938#else 1925#else
@@ -1988,6 +1975,7 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
1988{ 1975{
1989 u64 rdba; 1976 u64 rdba;
1990 struct ixgbe_hw *hw = &adapter->hw; 1977 struct ixgbe_hw *hw = &adapter->hw;
1978 struct ixgbe_ring *rx_ring;
1991 struct net_device *netdev = adapter->netdev; 1979 struct net_device *netdev = adapter->netdev;
1992 int max_frame = netdev->mtu + ETH_HLEN + ETH_FCS_LEN; 1980 int max_frame = netdev->mtu + ETH_HLEN + ETH_FCS_LEN;
1993 int i, j; 1981 int i, j;
@@ -2004,11 +1992,6 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
2004 /* Decide whether to use packet split mode or not */ 1992 /* Decide whether to use packet split mode or not */
2005 adapter->flags |= IXGBE_FLAG_RX_PS_ENABLED; 1993 adapter->flags |= IXGBE_FLAG_RX_PS_ENABLED;
2006 1994
2007#ifdef IXGBE_FCOE
2008 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED)
2009 adapter->flags &= ~IXGBE_FLAG_RX_PS_ENABLED;
2010#endif /* IXGBE_FCOE */
2011
2012 /* Set the RX buffer length according to the mode */ 1995 /* Set the RX buffer length according to the mode */
2013 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) { 1996 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) {
2014 rx_buf_len = IXGBE_RX_HDR_SIZE; 1997 rx_buf_len = IXGBE_RX_HDR_SIZE;
@@ -2022,7 +2005,7 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
2022 IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(0), psrtype); 2005 IXGBE_WRITE_REG(hw, IXGBE_PSRTYPE(0), psrtype);
2023 } 2006 }
2024 } else { 2007 } else {
2025 if (!(adapter->flags & IXGBE_FLAG2_RSC_ENABLED) && 2008 if (!(adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) &&
2026 (netdev->mtu <= ETH_DATA_LEN)) 2009 (netdev->mtu <= ETH_DATA_LEN))
2027 rx_buf_len = MAXIMUM_ETHERNET_VLAN_SIZE; 2010 rx_buf_len = MAXIMUM_ETHERNET_VLAN_SIZE;
2028 else 2011 else
@@ -2056,29 +2039,35 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
2056 * the Base and Length of the Rx Descriptor Ring 2039 * the Base and Length of the Rx Descriptor Ring
2057 */ 2040 */
2058 for (i = 0; i < adapter->num_rx_queues; i++) { 2041 for (i = 0; i < adapter->num_rx_queues; i++) {
2059 rdba = adapter->rx_ring[i].dma; 2042 rx_ring = &adapter->rx_ring[i];
2060 j = adapter->rx_ring[i].reg_idx; 2043 rdba = rx_ring->dma;
2044 j = rx_ring->reg_idx;
2061 IXGBE_WRITE_REG(hw, IXGBE_RDBAL(j), (rdba & DMA_BIT_MASK(32))); 2045 IXGBE_WRITE_REG(hw, IXGBE_RDBAL(j), (rdba & DMA_BIT_MASK(32)));
2062 IXGBE_WRITE_REG(hw, IXGBE_RDBAH(j), (rdba >> 32)); 2046 IXGBE_WRITE_REG(hw, IXGBE_RDBAH(j), (rdba >> 32));
2063 IXGBE_WRITE_REG(hw, IXGBE_RDLEN(j), rdlen); 2047 IXGBE_WRITE_REG(hw, IXGBE_RDLEN(j), rdlen);
2064 IXGBE_WRITE_REG(hw, IXGBE_RDH(j), 0); 2048 IXGBE_WRITE_REG(hw, IXGBE_RDH(j), 0);
2065 IXGBE_WRITE_REG(hw, IXGBE_RDT(j), 0); 2049 IXGBE_WRITE_REG(hw, IXGBE_RDT(j), 0);
2066 adapter->rx_ring[i].head = IXGBE_RDH(j); 2050 rx_ring->head = IXGBE_RDH(j);
2067 adapter->rx_ring[i].tail = IXGBE_RDT(j); 2051 rx_ring->tail = IXGBE_RDT(j);
2068 adapter->rx_ring[i].rx_buf_len = rx_buf_len; 2052 rx_ring->rx_buf_len = rx_buf_len;
2053
2054 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED)
2055 rx_ring->flags |= IXGBE_RING_RX_PS_ENABLED;
2069 2056
2070#ifdef IXGBE_FCOE 2057#ifdef IXGBE_FCOE
2071 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { 2058 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) {
2072 struct ixgbe_ring_feature *f; 2059 struct ixgbe_ring_feature *f;
2073 f = &adapter->ring_feature[RING_F_FCOE]; 2060 f = &adapter->ring_feature[RING_F_FCOE];
2074 if ((rx_buf_len < IXGBE_FCOE_JUMBO_FRAME_SIZE) && 2061 if ((i >= f->mask) && (i < f->mask + f->indices)) {
2075 (i >= f->mask) && (i < f->mask + f->indices)) 2062 rx_ring->flags &= ~IXGBE_RING_RX_PS_ENABLED;
2076 adapter->rx_ring[i].rx_buf_len = 2063 if (rx_buf_len < IXGBE_FCOE_JUMBO_FRAME_SIZE)
2077 IXGBE_FCOE_JUMBO_FRAME_SIZE; 2064 rx_ring->rx_buf_len =
2065 IXGBE_FCOE_JUMBO_FRAME_SIZE;
2066 }
2078 } 2067 }
2079 2068
2080#endif /* IXGBE_FCOE */ 2069#endif /* IXGBE_FCOE */
2081 ixgbe_configure_srrctl(adapter, j); 2070 ixgbe_configure_srrctl(adapter, rx_ring);
2082 } 2071 }
2083 2072
2084 if (hw->mac.type == ixgbe_mac_82598EB) { 2073 if (hw->mac.type == ixgbe_mac_82598EB) {
@@ -2151,10 +2140,11 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
2151 IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, rdrxctl); 2140 IXGBE_WRITE_REG(hw, IXGBE_RDRXCTL, rdrxctl);
2152 } 2141 }
2153 2142
2154 if (adapter->flags & IXGBE_FLAG2_RSC_ENABLED) { 2143 if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) {
2155 /* Enable 82599 HW-RSC */ 2144 /* Enable 82599 HW-RSC */
2156 for (i = 0; i < adapter->num_rx_queues; i++) { 2145 for (i = 0; i < adapter->num_rx_queues; i++) {
2157 j = adapter->rx_ring[i].reg_idx; 2146 rx_ring = &adapter->rx_ring[i];
2147 j = rx_ring->reg_idx;
2158 rscctrl = IXGBE_READ_REG(hw, IXGBE_RSCCTL(j)); 2148 rscctrl = IXGBE_READ_REG(hw, IXGBE_RSCCTL(j));
2159 rscctrl |= IXGBE_RSCCTL_RSCEN; 2149 rscctrl |= IXGBE_RSCCTL_RSCEN;
2160 /* 2150 /*
@@ -2162,7 +2152,7 @@ static void ixgbe_configure_rx(struct ixgbe_adapter *adapter)
2162 * total size of max desc * buf_len is not greater 2152 * total size of max desc * buf_len is not greater
2163 * than 65535 2153 * than 65535
2164 */ 2154 */
2165 if (adapter->flags & IXGBE_FLAG_RX_PS_ENABLED) { 2155 if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) {
2166#if (MAX_SKB_FRAGS > 16) 2156#if (MAX_SKB_FRAGS > 16)
2167 rscctrl |= IXGBE_RSCCTL_MAXDESC_16; 2157 rscctrl |= IXGBE_RSCCTL_MAXDESC_16;
2168#elif (MAX_SKB_FRAGS > 8) 2158#elif (MAX_SKB_FRAGS > 8)
@@ -3798,16 +3788,17 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
3798 adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82598; 3788 adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82598;
3799 } else if (hw->mac.type == ixgbe_mac_82599EB) { 3789 } else if (hw->mac.type == ixgbe_mac_82599EB) {
3800 adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82599; 3790 adapter->max_msix_q_vectors = MAX_MSIX_Q_VECTORS_82599;
3801 adapter->flags |= IXGBE_FLAG2_RSC_CAPABLE; 3791 adapter->flags2 |= IXGBE_FLAG2_RSC_CAPABLE;
3802 adapter->flags |= IXGBE_FLAG2_RSC_ENABLED; 3792 adapter->flags2 |= IXGBE_FLAG2_RSC_ENABLED;
3803 adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE; 3793 adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;
3804 adapter->ring_feature[RING_F_FDIR].indices = 3794 adapter->ring_feature[RING_F_FDIR].indices =
3805 IXGBE_MAX_FDIR_INDICES; 3795 IXGBE_MAX_FDIR_INDICES;
3806 adapter->atr_sample_rate = 20; 3796 adapter->atr_sample_rate = 20;
3807 adapter->fdir_pballoc = 0; 3797 adapter->fdir_pballoc = 0;
3808#ifdef IXGBE_FCOE 3798#ifdef IXGBE_FCOE
3809 adapter->flags |= IXGBE_FLAG_FCOE_ENABLED; 3799 adapter->flags |= IXGBE_FLAG_FCOE_CAPABLE;
3810 adapter->ring_feature[RING_F_FCOE].indices = IXGBE_FCRETA_SIZE; 3800 adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
3801 adapter->ring_feature[RING_F_FCOE].indices = 0;
3811#endif /* IXGBE_FCOE */ 3802#endif /* IXGBE_FCOE */
3812 } 3803 }
3813 3804
@@ -5125,9 +5116,6 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
5125 int count = 0; 5116 int count = 0;
5126 unsigned int f; 5117 unsigned int f;
5127 5118
5128 r_idx = skb->queue_mapping;
5129 tx_ring = &adapter->tx_ring[r_idx];
5130
5131 if (adapter->vlgrp && vlan_tx_tag_present(skb)) { 5119 if (adapter->vlgrp && vlan_tx_tag_present(skb)) {
5132 tx_flags |= vlan_tx_tag_get(skb); 5120 tx_flags |= vlan_tx_tag_get(skb);
5133 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { 5121 if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
@@ -5137,11 +5125,19 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
5137 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT; 5125 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT;
5138 tx_flags |= IXGBE_TX_FLAGS_VLAN; 5126 tx_flags |= IXGBE_TX_FLAGS_VLAN;
5139 } else if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) { 5127 } else if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
5140 tx_flags |= (skb->queue_mapping << 13); 5128 if (skb->priority != TC_PRIO_CONTROL) {
5141 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT; 5129 tx_flags |= (skb->queue_mapping << 13);
5142 tx_flags |= IXGBE_TX_FLAGS_VLAN; 5130 tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT;
5131 tx_flags |= IXGBE_TX_FLAGS_VLAN;
5132 } else {
5133 skb->queue_mapping =
5134 adapter->ring_feature[RING_F_DCB].indices-1;
5135 }
5143 } 5136 }
5144 5137
5138 r_idx = skb->queue_mapping;
5139 tx_ring = &adapter->tx_ring[r_idx];
5140
5145 if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) && 5141 if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) &&
5146 (skb->protocol == htons(ETH_P_FCOE))) 5142 (skb->protocol == htons(ETH_P_FCOE)))
5147 tx_flags |= IXGBE_TX_FLAGS_FCOE; 5143 tx_flags |= IXGBE_TX_FLAGS_FCOE;
@@ -5340,12 +5336,19 @@ static int ixgbe_del_sanmac_netdev(struct net_device *dev)
5340static void ixgbe_netpoll(struct net_device *netdev) 5336static void ixgbe_netpoll(struct net_device *netdev)
5341{ 5337{
5342 struct ixgbe_adapter *adapter = netdev_priv(netdev); 5338 struct ixgbe_adapter *adapter = netdev_priv(netdev);
5339 int i;
5343 5340
5344 disable_irq(adapter->pdev->irq);
5345 adapter->flags |= IXGBE_FLAG_IN_NETPOLL; 5341 adapter->flags |= IXGBE_FLAG_IN_NETPOLL;
5346 ixgbe_intr(adapter->pdev->irq, netdev); 5342 if (adapter->flags & IXGBE_FLAG_MSIX_ENABLED) {
5343 int num_q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS;
5344 for (i = 0; i < num_q_vectors; i++) {
5345 struct ixgbe_q_vector *q_vector = adapter->q_vector[i];
5346 ixgbe_msix_clean_many(0, q_vector);
5347 }
5348 } else {
5349 ixgbe_intr(adapter->pdev->irq, netdev);
5350 }
5347 adapter->flags &= ~IXGBE_FLAG_IN_NETPOLL; 5351 adapter->flags &= ~IXGBE_FLAG_IN_NETPOLL;
5348 enable_irq(adapter->pdev->irq);
5349} 5352}
5350#endif 5353#endif
5351 5354
@@ -5580,23 +5583,18 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
5580#endif 5583#endif
5581 5584
5582#ifdef IXGBE_FCOE 5585#ifdef IXGBE_FCOE
5583 if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) { 5586 if (adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) {
5584 if (hw->mac.ops.get_device_caps) { 5587 if (hw->mac.ops.get_device_caps) {
5585 hw->mac.ops.get_device_caps(hw, &device_caps); 5588 hw->mac.ops.get_device_caps(hw, &device_caps);
5586 if (!(device_caps & IXGBE_DEVICE_CAPS_FCOE_OFFLOADS)) { 5589 if (device_caps & IXGBE_DEVICE_CAPS_FCOE_OFFLOADS)
5587 netdev->features |= NETIF_F_FCOE_CRC; 5590 adapter->flags &= ~IXGBE_FLAG_FCOE_CAPABLE;
5588 netdev->features |= NETIF_F_FSO;
5589 netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1;
5590 } else {
5591 adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
5592 }
5593 } 5591 }
5594 } 5592 }
5595#endif /* IXGBE_FCOE */ 5593#endif /* IXGBE_FCOE */
5596 if (pci_using_dac) 5594 if (pci_using_dac)
5597 netdev->features |= NETIF_F_HIGHDMA; 5595 netdev->features |= NETIF_F_HIGHDMA;
5598 5596
5599 if (adapter->flags & IXGBE_FLAG2_RSC_ENABLED) 5597 if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED)
5600 netdev->features |= NETIF_F_LRO; 5598 netdev->features |= NETIF_F_LRO;
5601 5599
5602 /* make sure the EEPROM is good */ 5600 /* make sure the EEPROM is good */
@@ -5638,7 +5636,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
5638 adapter->wol = 0; 5636 adapter->wol = 0;
5639 break; 5637 break;
5640 } 5638 }
5641 device_init_wakeup(&adapter->pdev->dev, true);
5642 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); 5639 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
5643 5640
5644 /* pick up the PCI bus settings for reporting later */ 5641 /* pick up the PCI bus settings for reporting later */