|
@@ -1,7 +1,7 @@
|
|
/*******************************************************************************
|
|
/*******************************************************************************
|
|
|
|
|
|
Intel 10 Gigabit PCI Express Linux driver
|
|
Intel 10 Gigabit PCI Express Linux driver
|
|
- Copyright(c) 1999 - 2015 Intel Corporation.
|
|
|
|
|
|
+ Copyright(c) 1999 - 2016 Intel Corporation.
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it
|
|
This program is free software; you can redistribute it and/or modify it
|
|
under the terms and conditions of the GNU General Public License,
|
|
under the terms and conditions of the GNU General Public License,
|
|
@@ -54,15 +54,6 @@
|
|
#include <net/pkt_cls.h>
|
|
#include <net/pkt_cls.h>
|
|
#include <net/tc_act/tc_gact.h>
|
|
#include <net/tc_act/tc_gact.h>
|
|
|
|
|
|
-#ifdef CONFIG_OF
|
|
|
|
-#include <linux/of_net.h>
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
-#ifdef CONFIG_SPARC
|
|
|
|
-#include <asm/idprom.h>
|
|
|
|
-#include <asm/prom.h>
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
#include "ixgbe.h"
|
|
#include "ixgbe.h"
|
|
#include "ixgbe_common.h"
|
|
#include "ixgbe_common.h"
|
|
#include "ixgbe_dcb_82599.h"
|
|
#include "ixgbe_dcb_82599.h"
|
|
@@ -1086,6 +1077,36 @@ static void ixgbe_tx_timeout_reset(struct ixgbe_adapter *adapter)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/**
|
|
|
|
+ * ixgbe_tx_maxrate - callback to set the maximum per-queue bitrate
|
|
|
|
+ **/
|
|
|
|
+static int ixgbe_tx_maxrate(struct net_device *netdev,
|
|
|
|
+ int queue_index, u32 maxrate)
|
|
|
|
+{
|
|
|
|
+ struct ixgbe_adapter *adapter = netdev_priv(netdev);
|
|
|
|
+ struct ixgbe_hw *hw = &adapter->hw;
|
|
|
|
+ u32 bcnrc_val = ixgbe_link_mbps(adapter);
|
|
|
|
+
|
|
|
|
+ if (!maxrate)
|
|
|
|
+ return 0;
|
|
|
|
+
|
|
|
|
+ /* Calculate the rate factor values to set */
|
|
|
|
+ bcnrc_val <<= IXGBE_RTTBCNRC_RF_INT_SHIFT;
|
|
|
|
+ bcnrc_val /= maxrate;
|
|
|
|
+
|
|
|
|
+ /* clear everything but the rate factor */
|
|
|
|
+ bcnrc_val &= IXGBE_RTTBCNRC_RF_INT_MASK |
|
|
|
|
+ IXGBE_RTTBCNRC_RF_DEC_MASK;
|
|
|
|
+
|
|
|
|
+ /* enable the rate scheduler */
|
|
|
|
+ bcnrc_val |= IXGBE_RTTBCNRC_RS_ENA;
|
|
|
|
+
|
|
|
|
+ IXGBE_WRITE_REG(hw, IXGBE_RTTDQSEL, queue_index);
|
|
|
|
+ IXGBE_WRITE_REG(hw, IXGBE_RTTBCNRC, bcnrc_val);
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* ixgbe_clean_tx_irq - Reclaim resources after transmit completes
|
|
* ixgbe_clean_tx_irq - Reclaim resources after transmit completes
|
|
* @q_vector: structure containing interrupt and ring information
|
|
* @q_vector: structure containing interrupt and ring information
|
|
@@ -3908,7 +3929,9 @@ static int ixgbe_vlan_rx_add_vid(struct net_device *netdev,
|
|
struct ixgbe_hw *hw = &adapter->hw;
|
|
struct ixgbe_hw *hw = &adapter->hw;
|
|
|
|
|
|
/* add VID to filter table */
|
|
/* add VID to filter table */
|
|
- hw->mac.ops.set_vfta(&adapter->hw, vid, VMDQ_P(0), true, true);
|
|
|
|
|
|
+ if (!vid || !(adapter->flags2 & IXGBE_FLAG2_VLAN_PROMISC))
|
|
|
|
+ hw->mac.ops.set_vfta(&adapter->hw, vid, VMDQ_P(0), true, !!vid);
|
|
|
|
+
|
|
set_bit(vid, adapter->active_vlans);
|
|
set_bit(vid, adapter->active_vlans);
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
@@ -3965,9 +3988,7 @@ static int ixgbe_vlan_rx_kill_vid(struct net_device *netdev,
|
|
struct ixgbe_hw *hw = &adapter->hw;
|
|
struct ixgbe_hw *hw = &adapter->hw;
|
|
|
|
|
|
/* remove VID from filter table */
|
|
/* remove VID from filter table */
|
|
- if (adapter->flags2 & IXGBE_FLAG2_VLAN_PROMISC)
|
|
|
|
- ixgbe_update_pf_promisc_vlvf(adapter, vid);
|
|
|
|
- else
|
|
|
|
|
|
+ if (vid && !(adapter->flags2 & IXGBE_FLAG2_VLAN_PROMISC))
|
|
hw->mac.ops.set_vfta(hw, vid, VMDQ_P(0), false, true);
|
|
hw->mac.ops.set_vfta(hw, vid, VMDQ_P(0), false, true);
|
|
|
|
|
|
clear_bit(vid, adapter->active_vlans);
|
|
clear_bit(vid, adapter->active_vlans);
|
|
@@ -4172,11 +4193,11 @@ static void ixgbe_vlan_promisc_disable(struct ixgbe_adapter *adapter)
|
|
|
|
|
|
static void ixgbe_restore_vlan(struct ixgbe_adapter *adapter)
|
|
static void ixgbe_restore_vlan(struct ixgbe_adapter *adapter)
|
|
{
|
|
{
|
|
- u16 vid;
|
|
|
|
|
|
+ u16 vid = 1;
|
|
|
|
|
|
ixgbe_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), 0);
|
|
ixgbe_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), 0);
|
|
|
|
|
|
- for_each_set_bit(vid, adapter->active_vlans, VLAN_N_VID)
|
|
|
|
|
|
+ for_each_set_bit_from(vid, adapter->active_vlans, VLAN_N_VID)
|
|
ixgbe_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), vid);
|
|
ixgbe_vlan_rx_add_vid(adapter->netdev, htons(ETH_P_8021Q), vid);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -4426,6 +4447,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
|
|
struct ixgbe_adapter *adapter = netdev_priv(netdev);
|
|
struct ixgbe_adapter *adapter = netdev_priv(netdev);
|
|
struct ixgbe_hw *hw = &adapter->hw;
|
|
struct ixgbe_hw *hw = &adapter->hw;
|
|
u32 fctrl, vmolr = IXGBE_VMOLR_BAM | IXGBE_VMOLR_AUPE;
|
|
u32 fctrl, vmolr = IXGBE_VMOLR_BAM | IXGBE_VMOLR_AUPE;
|
|
|
|
+ netdev_features_t features = netdev->features;
|
|
int count;
|
|
int count;
|
|
|
|
|
|
/* Check for Promiscuous and All Multicast modes */
|
|
/* Check for Promiscuous and All Multicast modes */
|
|
@@ -4443,14 +4465,13 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
|
|
hw->addr_ctrl.user_set_promisc = true;
|
|
hw->addr_ctrl.user_set_promisc = true;
|
|
fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE);
|
|
fctrl |= (IXGBE_FCTRL_UPE | IXGBE_FCTRL_MPE);
|
|
vmolr |= IXGBE_VMOLR_MPE;
|
|
vmolr |= IXGBE_VMOLR_MPE;
|
|
- ixgbe_vlan_promisc_enable(adapter);
|
|
|
|
|
|
+ features &= ~NETIF_F_HW_VLAN_CTAG_FILTER;
|
|
} else {
|
|
} else {
|
|
if (netdev->flags & IFF_ALLMULTI) {
|
|
if (netdev->flags & IFF_ALLMULTI) {
|
|
fctrl |= IXGBE_FCTRL_MPE;
|
|
fctrl |= IXGBE_FCTRL_MPE;
|
|
vmolr |= IXGBE_VMOLR_MPE;
|
|
vmolr |= IXGBE_VMOLR_MPE;
|
|
}
|
|
}
|
|
hw->addr_ctrl.user_set_promisc = false;
|
|
hw->addr_ctrl.user_set_promisc = false;
|
|
- ixgbe_vlan_promisc_disable(adapter);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -4483,7 +4504,7 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
|
|
}
|
|
}
|
|
|
|
|
|
/* This is useful for sniffing bad packets. */
|
|
/* This is useful for sniffing bad packets. */
|
|
- if (adapter->netdev->features & NETIF_F_RXALL) {
|
|
|
|
|
|
+ if (features & NETIF_F_RXALL) {
|
|
/* UPE and MPE will be handled by normal PROMISC logic
|
|
/* UPE and MPE will be handled by normal PROMISC logic
|
|
* in e1000e_set_rx_mode */
|
|
* in e1000e_set_rx_mode */
|
|
fctrl |= (IXGBE_FCTRL_SBP | /* Receive bad packets */
|
|
fctrl |= (IXGBE_FCTRL_SBP | /* Receive bad packets */
|
|
@@ -4496,10 +4517,15 @@ void ixgbe_set_rx_mode(struct net_device *netdev)
|
|
|
|
|
|
IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
|
|
IXGBE_WRITE_REG(hw, IXGBE_FCTRL, fctrl);
|
|
|
|
|
|
- if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX)
|
|
|
|
|
|
+ if (features & NETIF_F_HW_VLAN_CTAG_RX)
|
|
ixgbe_vlan_strip_enable(adapter);
|
|
ixgbe_vlan_strip_enable(adapter);
|
|
else
|
|
else
|
|
ixgbe_vlan_strip_disable(adapter);
|
|
ixgbe_vlan_strip_disable(adapter);
|
|
|
|
+
|
|
|
|
+ if (features & NETIF_F_HW_VLAN_CTAG_FILTER)
|
|
|
|
+ ixgbe_vlan_promisc_disable(adapter);
|
|
|
|
+ else
|
|
|
|
+ ixgbe_vlan_promisc_enable(adapter);
|
|
}
|
|
}
|
|
|
|
|
|
static void ixgbe_napi_enable_all(struct ixgbe_adapter *adapter)
|
|
static void ixgbe_napi_enable_all(struct ixgbe_adapter *adapter)
|
|
@@ -7211,103 +7237,61 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring,
|
|
return 1;
|
|
return 1;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static inline bool ixgbe_ipv6_csum_is_sctp(struct sk_buff *skb)
|
|
|
|
+{
|
|
|
|
+ unsigned int offset = 0;
|
|
|
|
+
|
|
|
|
+ ipv6_find_hdr(skb, &offset, IPPROTO_SCTP, NULL, NULL);
|
|
|
|
+
|
|
|
|
+ return offset == skb_checksum_start_offset(skb);
|
|
|
|
+}
|
|
|
|
+
|
|
static void ixgbe_tx_csum(struct ixgbe_ring *tx_ring,
|
|
static void ixgbe_tx_csum(struct ixgbe_ring *tx_ring,
|
|
struct ixgbe_tx_buffer *first)
|
|
struct ixgbe_tx_buffer *first)
|
|
{
|
|
{
|
|
struct sk_buff *skb = first->skb;
|
|
struct sk_buff *skb = first->skb;
|
|
u32 vlan_macip_lens = 0;
|
|
u32 vlan_macip_lens = 0;
|
|
- u32 mss_l4len_idx = 0;
|
|
|
|
u32 type_tucmd = 0;
|
|
u32 type_tucmd = 0;
|
|
|
|
|
|
if (skb->ip_summed != CHECKSUM_PARTIAL) {
|
|
if (skb->ip_summed != CHECKSUM_PARTIAL) {
|
|
- if (!(first->tx_flags & IXGBE_TX_FLAGS_HW_VLAN) &&
|
|
|
|
- !(first->tx_flags & IXGBE_TX_FLAGS_CC))
|
|
|
|
|
|
+csum_failed:
|
|
|
|
+ if (!(first->tx_flags & (IXGBE_TX_FLAGS_HW_VLAN |
|
|
|
|
+ IXGBE_TX_FLAGS_CC)))
|
|
return;
|
|
return;
|
|
- vlan_macip_lens = skb_network_offset(skb) <<
|
|
|
|
- IXGBE_ADVTXD_MACLEN_SHIFT;
|
|
|
|
- } else {
|
|
|
|
- u8 l4_hdr = 0;
|
|
|
|
- union {
|
|
|
|
- struct iphdr *ipv4;
|
|
|
|
- struct ipv6hdr *ipv6;
|
|
|
|
- u8 *raw;
|
|
|
|
- } network_hdr;
|
|
|
|
- union {
|
|
|
|
- struct tcphdr *tcphdr;
|
|
|
|
- u8 *raw;
|
|
|
|
- } transport_hdr;
|
|
|
|
- __be16 frag_off;
|
|
|
|
-
|
|
|
|
- if (skb->encapsulation) {
|
|
|
|
- network_hdr.raw = skb_inner_network_header(skb);
|
|
|
|
- transport_hdr.raw = skb_inner_transport_header(skb);
|
|
|
|
- vlan_macip_lens = skb_inner_network_offset(skb) <<
|
|
|
|
- IXGBE_ADVTXD_MACLEN_SHIFT;
|
|
|
|
- } else {
|
|
|
|
- network_hdr.raw = skb_network_header(skb);
|
|
|
|
- transport_hdr.raw = skb_transport_header(skb);
|
|
|
|
- vlan_macip_lens = skb_network_offset(skb) <<
|
|
|
|
- IXGBE_ADVTXD_MACLEN_SHIFT;
|
|
|
|
- }
|
|
|
|
-
|
|
|
|
- /* use first 4 bits to determine IP version */
|
|
|
|
- switch (network_hdr.ipv4->version) {
|
|
|
|
- case IPVERSION:
|
|
|
|
- vlan_macip_lens |= transport_hdr.raw - network_hdr.raw;
|
|
|
|
- type_tucmd |= IXGBE_ADVTXD_TUCMD_IPV4;
|
|
|
|
- l4_hdr = network_hdr.ipv4->protocol;
|
|
|
|
- break;
|
|
|
|
- case 6:
|
|
|
|
- vlan_macip_lens |= transport_hdr.raw - network_hdr.raw;
|
|
|
|
- l4_hdr = network_hdr.ipv6->nexthdr;
|
|
|
|
- if (likely((transport_hdr.raw - network_hdr.raw) ==
|
|
|
|
- sizeof(struct ipv6hdr)))
|
|
|
|
- break;
|
|
|
|
- ipv6_skip_exthdr(skb, network_hdr.raw - skb->data +
|
|
|
|
- sizeof(struct ipv6hdr),
|
|
|
|
- &l4_hdr, &frag_off);
|
|
|
|
- if (unlikely(frag_off))
|
|
|
|
- l4_hdr = NEXTHDR_FRAGMENT;
|
|
|
|
- break;
|
|
|
|
- default:
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
+ goto no_csum;
|
|
|
|
+ }
|
|
|
|
|
|
- switch (l4_hdr) {
|
|
|
|
- case IPPROTO_TCP:
|
|
|
|
- type_tucmd |= IXGBE_ADVTXD_TUCMD_L4T_TCP;
|
|
|
|
- mss_l4len_idx = (transport_hdr.tcphdr->doff * 4) <<
|
|
|
|
- IXGBE_ADVTXD_L4LEN_SHIFT;
|
|
|
|
- break;
|
|
|
|
- case IPPROTO_SCTP:
|
|
|
|
- type_tucmd |= IXGBE_ADVTXD_TUCMD_L4T_SCTP;
|
|
|
|
- mss_l4len_idx = sizeof(struct sctphdr) <<
|
|
|
|
- IXGBE_ADVTXD_L4LEN_SHIFT;
|
|
|
|
- break;
|
|
|
|
- case IPPROTO_UDP:
|
|
|
|
- mss_l4len_idx = sizeof(struct udphdr) <<
|
|
|
|
- IXGBE_ADVTXD_L4LEN_SHIFT;
|
|
|
|
|
|
+ switch (skb->csum_offset) {
|
|
|
|
+ case offsetof(struct tcphdr, check):
|
|
|
|
+ type_tucmd = IXGBE_ADVTXD_TUCMD_L4T_TCP;
|
|
|
|
+ /* fall through */
|
|
|
|
+ case offsetof(struct udphdr, check):
|
|
|
|
+ break;
|
|
|
|
+ case offsetof(struct sctphdr, checksum):
|
|
|
|
+ /* validate that this is actually an SCTP request */
|
|
|
|
+ if (((first->protocol == htons(ETH_P_IP)) &&
|
|
|
|
+ (ip_hdr(skb)->protocol == IPPROTO_SCTP)) ||
|
|
|
|
+ ((first->protocol == htons(ETH_P_IPV6)) &&
|
|
|
|
+ ixgbe_ipv6_csum_is_sctp(skb))) {
|
|
|
|
+ type_tucmd = IXGBE_ADVTXD_TUCMD_L4T_SCTP;
|
|
break;
|
|
break;
|
|
- default:
|
|
|
|
- if (unlikely(net_ratelimit())) {
|
|
|
|
- dev_warn(tx_ring->dev,
|
|
|
|
- "partial checksum, version=%d, l4 proto=%x\n",
|
|
|
|
- network_hdr.ipv4->version, l4_hdr);
|
|
|
|
- }
|
|
|
|
- skb_checksum_help(skb);
|
|
|
|
- goto no_csum;
|
|
|
|
}
|
|
}
|
|
-
|
|
|
|
- /* update TX checksum flag */
|
|
|
|
- first->tx_flags |= IXGBE_TX_FLAGS_CSUM;
|
|
|
|
|
|
+ /* fall through */
|
|
|
|
+ default:
|
|
|
|
+ skb_checksum_help(skb);
|
|
|
|
+ goto csum_failed;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /* update TX checksum flag */
|
|
|
|
+ first->tx_flags |= IXGBE_TX_FLAGS_CSUM;
|
|
|
|
+ vlan_macip_lens = skb_checksum_start_offset(skb) -
|
|
|
|
+ skb_network_offset(skb);
|
|
no_csum:
|
|
no_csum:
|
|
/* vlan_macip_lens: MACLEN, VLAN tag */
|
|
/* vlan_macip_lens: MACLEN, VLAN tag */
|
|
|
|
+ vlan_macip_lens |= skb_network_offset(skb) << IXGBE_ADVTXD_MACLEN_SHIFT;
|
|
vlan_macip_lens |= first->tx_flags & IXGBE_TX_FLAGS_VLAN_MASK;
|
|
vlan_macip_lens |= first->tx_flags & IXGBE_TX_FLAGS_VLAN_MASK;
|
|
|
|
|
|
- ixgbe_tx_ctxtdesc(tx_ring, vlan_macip_lens, 0,
|
|
|
|
- type_tucmd, mss_l4len_idx);
|
|
|
|
|
|
+ ixgbe_tx_ctxtdesc(tx_ring, vlan_macip_lens, 0, type_tucmd, 0);
|
|
}
|
|
}
|
|
|
|
|
|
#define IXGBE_SET_FLAG(_input, _flag, _result) \
|
|
#define IXGBE_SET_FLAG(_input, _flag, _result) \
|
|
@@ -8278,19 +8262,20 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
for (i = 0; nexthdr[i].jump; i++) {
|
|
for (i = 0; nexthdr[i].jump; i++) {
|
|
- if (nexthdr->o != cls->knode.sel->offoff ||
|
|
|
|
- nexthdr->s != cls->knode.sel->offshift ||
|
|
|
|
- nexthdr->m != cls->knode.sel->offmask ||
|
|
|
|
|
|
+ if (nexthdr[i].o != cls->knode.sel->offoff ||
|
|
|
|
+ nexthdr[i].s != cls->knode.sel->offshift ||
|
|
|
|
+ nexthdr[i].m != cls->knode.sel->offmask ||
|
|
/* do not support multiple key jumps its just mad */
|
|
/* do not support multiple key jumps its just mad */
|
|
cls->knode.sel->nkeys > 1)
|
|
cls->knode.sel->nkeys > 1)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
- if (nexthdr->off != cls->knode.sel->keys[0].off ||
|
|
|
|
- nexthdr->val != cls->knode.sel->keys[0].val ||
|
|
|
|
- nexthdr->mask != cls->knode.sel->keys[0].mask)
|
|
|
|
- return -EINVAL;
|
|
|
|
-
|
|
|
|
- adapter->jump_tables[link_uhtid] = nexthdr->jump;
|
|
|
|
|
|
+ if (nexthdr[i].off == cls->knode.sel->keys[0].off &&
|
|
|
|
+ nexthdr[i].val == cls->knode.sel->keys[0].val &&
|
|
|
|
+ nexthdr[i].mask == cls->knode.sel->keys[0].mask) {
|
|
|
|
+ adapter->jump_tables[link_uhtid] =
|
|
|
|
+ nexthdr[i].jump;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -8515,11 +8500,6 @@ static int ixgbe_set_features(struct net_device *netdev,
|
|
adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;
|
|
adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;
|
|
}
|
|
}
|
|
|
|
|
|
- if (features & NETIF_F_HW_VLAN_CTAG_RX)
|
|
|
|
- ixgbe_vlan_strip_enable(adapter);
|
|
|
|
- else
|
|
|
|
- ixgbe_vlan_strip_disable(adapter);
|
|
|
|
-
|
|
|
|
if (changed & NETIF_F_RXALL)
|
|
if (changed & NETIF_F_RXALL)
|
|
need_reset = true;
|
|
need_reset = true;
|
|
|
|
|
|
@@ -8536,6 +8516,9 @@ static int ixgbe_set_features(struct net_device *netdev,
|
|
|
|
|
|
if (need_reset)
|
|
if (need_reset)
|
|
ixgbe_do_reset(netdev);
|
|
ixgbe_do_reset(netdev);
|
|
|
|
+ else if (changed & (NETIF_F_HW_VLAN_CTAG_RX |
|
|
|
|
+ NETIF_F_HW_VLAN_CTAG_FILTER))
|
|
|
|
+ ixgbe_set_rx_mode(netdev);
|
|
|
|
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
@@ -8858,6 +8841,7 @@ static const struct net_device_ops ixgbe_netdev_ops = {
|
|
.ndo_set_mac_address = ixgbe_set_mac,
|
|
.ndo_set_mac_address = ixgbe_set_mac,
|
|
.ndo_change_mtu = ixgbe_change_mtu,
|
|
.ndo_change_mtu = ixgbe_change_mtu,
|
|
.ndo_tx_timeout = ixgbe_tx_timeout,
|
|
.ndo_tx_timeout = ixgbe_tx_timeout,
|
|
|
|
+ .ndo_set_tx_maxrate = ixgbe_tx_maxrate,
|
|
.ndo_vlan_rx_add_vid = ixgbe_vlan_rx_add_vid,
|
|
.ndo_vlan_rx_add_vid = ixgbe_vlan_rx_add_vid,
|
|
.ndo_vlan_rx_kill_vid = ixgbe_vlan_rx_kill_vid,
|
|
.ndo_vlan_rx_kill_vid = ixgbe_vlan_rx_kill_vid,
|
|
.ndo_do_ioctl = ixgbe_ioctl,
|
|
.ndo_do_ioctl = ixgbe_ioctl,
|
|
@@ -9010,29 +8994,6 @@ int ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id,
|
|
return is_wol_supported;
|
|
return is_wol_supported;
|
|
}
|
|
}
|
|
|
|
|
|
-/**
|
|
|
|
- * ixgbe_get_platform_mac_addr - Look up MAC address in Open Firmware / IDPROM
|
|
|
|
- * @adapter: Pointer to adapter struct
|
|
|
|
- */
|
|
|
|
-static void ixgbe_get_platform_mac_addr(struct ixgbe_adapter *adapter)
|
|
|
|
-{
|
|
|
|
-#ifdef CONFIG_OF
|
|
|
|
- struct device_node *dp = pci_device_to_OF_node(adapter->pdev);
|
|
|
|
- struct ixgbe_hw *hw = &adapter->hw;
|
|
|
|
- const unsigned char *addr;
|
|
|
|
-
|
|
|
|
- addr = of_get_mac_address(dp);
|
|
|
|
- if (addr) {
|
|
|
|
- ether_addr_copy(hw->mac.perm_addr, addr);
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
-#endif /* CONFIG_OF */
|
|
|
|
-
|
|
|
|
-#ifdef CONFIG_SPARC
|
|
|
|
- ether_addr_copy(hw->mac.perm_addr, idprom->id_ethaddr);
|
|
|
|
-#endif /* CONFIG_SPARC */
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/**
|
|
/**
|
|
* ixgbe_probe - Device Initialization Routine
|
|
* ixgbe_probe - Device Initialization Routine
|
|
* @pdev: PCI device information struct
|
|
* @pdev: PCI device information struct
|
|
@@ -9136,12 +9097,12 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
strlcpy(netdev->name, pci_name(pdev), sizeof(netdev->name));
|
|
strlcpy(netdev->name, pci_name(pdev), sizeof(netdev->name));
|
|
|
|
|
|
/* Setup hw api */
|
|
/* Setup hw api */
|
|
- memcpy(&hw->mac.ops, ii->mac_ops, sizeof(hw->mac.ops));
|
|
|
|
|
|
+ hw->mac.ops = *ii->mac_ops;
|
|
hw->mac.type = ii->mac;
|
|
hw->mac.type = ii->mac;
|
|
hw->mvals = ii->mvals;
|
|
hw->mvals = ii->mvals;
|
|
|
|
|
|
/* EEPROM */
|
|
/* EEPROM */
|
|
- memcpy(&hw->eeprom.ops, ii->eeprom_ops, sizeof(hw->eeprom.ops));
|
|
|
|
|
|
+ hw->eeprom.ops = *ii->eeprom_ops;
|
|
eec = IXGBE_READ_REG(hw, IXGBE_EEC(hw));
|
|
eec = IXGBE_READ_REG(hw, IXGBE_EEC(hw));
|
|
if (ixgbe_removed(hw->hw_addr)) {
|
|
if (ixgbe_removed(hw->hw_addr)) {
|
|
err = -EIO;
|
|
err = -EIO;
|
|
@@ -9152,7 +9113,7 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
hw->eeprom.ops.read = &ixgbe_read_eeprom_bit_bang_generic;
|
|
hw->eeprom.ops.read = &ixgbe_read_eeprom_bit_bang_generic;
|
|
|
|
|
|
/* PHY */
|
|
/* PHY */
|
|
- memcpy(&hw->phy.ops, ii->phy_ops, sizeof(hw->phy.ops));
|
|
|
|
|
|
+ hw->phy.ops = *ii->phy_ops;
|
|
hw->phy.sfp_type = ixgbe_sfp_type_unknown;
|
|
hw->phy.sfp_type = ixgbe_sfp_type_unknown;
|
|
/* ixgbe_identify_phy_generic will set prtad and mmds properly */
|
|
/* ixgbe_identify_phy_generic will set prtad and mmds properly */
|
|
hw->phy.mdio.prtad = MDIO_PRTAD_NONE;
|
|
hw->phy.mdio.prtad = MDIO_PRTAD_NONE;
|
|
@@ -9169,6 +9130,10 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
if (err)
|
|
if (err)
|
|
goto err_sw_init;
|
|
goto err_sw_init;
|
|
|
|
|
|
|
|
+ /* Make sure the SWFW semaphore is in a valid state */
|
|
|
|
+ if (hw->mac.ops.init_swfw_sync)
|
|
|
|
+ hw->mac.ops.init_swfw_sync(hw);
|
|
|
|
+
|
|
/* Make it possible the adapter to be woken up via WOL */
|
|
/* Make it possible the adapter to be woken up via WOL */
|
|
switch (adapter->hw.mac.type) {
|
|
switch (adapter->hw.mac.type) {
|
|
case ixgbe_mac_82599EB:
|
|
case ixgbe_mac_82599EB:
|
|
@@ -9215,48 +9180,42 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|
goto skip_sriov;
|
|
goto skip_sriov;
|
|
/* Mailbox */
|
|
/* Mailbox */
|
|
ixgbe_init_mbx_params_pf(hw);
|
|
ixgbe_init_mbx_params_pf(hw);
|
|
- memcpy(&hw->mbx.ops, ii->mbx_ops, sizeof(hw->mbx.ops));
|
|
|
|
|
|
+ hw->mbx.ops = ii->mbx_ops;
|
|
pci_sriov_set_totalvfs(pdev, IXGBE_MAX_VFS_DRV_LIMIT);
|
|
pci_sriov_set_totalvfs(pdev, IXGBE_MAX_VFS_DRV_LIMIT);
|
|
ixgbe_enable_sriov(adapter);
|
|
ixgbe_enable_sriov(adapter);
|
|
skip_sriov:
|
|
skip_sriov:
|
|
|
|
|
|
#endif
|
|
#endif
|
|
netdev->features = NETIF_F_SG |
|
|
netdev->features = NETIF_F_SG |
|
|
- NETIF_F_IP_CSUM |
|
|
|
|
- NETIF_F_IPV6_CSUM |
|
|
|
|
- NETIF_F_HW_VLAN_CTAG_TX |
|
|
|
|
- NETIF_F_HW_VLAN_CTAG_RX |
|
|
|
|
NETIF_F_TSO |
|
|
NETIF_F_TSO |
|
|
NETIF_F_TSO6 |
|
|
NETIF_F_TSO6 |
|
|
NETIF_F_RXHASH |
|
|
NETIF_F_RXHASH |
|
|
- NETIF_F_RXCSUM;
|
|
|
|
-
|
|
|
|
- netdev->hw_features = netdev->features | NETIF_F_HW_L2FW_DOFFLOAD;
|
|
|
|
|
|
+ NETIF_F_RXCSUM |
|
|
|
|
+ NETIF_F_HW_CSUM |
|
|
|
|
+ NETIF_F_HW_VLAN_CTAG_TX |
|
|
|
|
+ NETIF_F_HW_VLAN_CTAG_RX |
|
|
|
|
+ NETIF_F_HW_VLAN_CTAG_FILTER;
|
|
|
|
|
|
- switch (adapter->hw.mac.type) {
|
|
|
|
- case ixgbe_mac_82599EB:
|
|
|
|
- case ixgbe_mac_X540:
|
|
|
|
- case ixgbe_mac_X550:
|
|
|
|
- case ixgbe_mac_X550EM_x:
|
|
|
|
|
|
+ if (hw->mac.type >= ixgbe_mac_82599EB)
|
|
netdev->features |= NETIF_F_SCTP_CRC;
|
|
netdev->features |= NETIF_F_SCTP_CRC;
|
|
- netdev->hw_features |= NETIF_F_SCTP_CRC |
|
|
|
|
- NETIF_F_NTUPLE |
|
|
|
|
- NETIF_F_HW_TC;
|
|
|
|
- break;
|
|
|
|
- default:
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
|
|
|
|
- netdev->hw_features |= NETIF_F_RXALL;
|
|
|
|
- netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER;
|
|
|
|
|
|
+ /* copy netdev features into list of user selectable features */
|
|
|
|
+ netdev->hw_features |= netdev->features;
|
|
|
|
+ netdev->hw_features |= NETIF_F_RXALL |
|
|
|
|
+ NETIF_F_HW_L2FW_DOFFLOAD;
|
|
|
|
+
|
|
|
|
+ if (hw->mac.type >= ixgbe_mac_82599EB)
|
|
|
|
+ netdev->hw_features |= NETIF_F_NTUPLE |
|
|
|
|
+ NETIF_F_HW_TC;
|
|
|
|
|
|
- netdev->vlan_features |= NETIF_F_TSO;
|
|
|
|
- netdev->vlan_features |= NETIF_F_TSO6;
|
|
|
|
- netdev->vlan_features |= NETIF_F_IP_CSUM;
|
|
|
|
- netdev->vlan_features |= NETIF_F_IPV6_CSUM;
|
|
|
|
- netdev->vlan_features |= NETIF_F_SG;
|
|
|
|
|
|
+ netdev->vlan_features |= NETIF_F_SG |
|
|
|
|
+ NETIF_F_TSO |
|
|
|
|
+ NETIF_F_TSO6 |
|
|
|
|
+ NETIF_F_HW_CSUM |
|
|
|
|
+ NETIF_F_SCTP_CRC;
|
|
|
|
|
|
- netdev->hw_enc_features |= NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM;
|
|
|
|
|
|
+ netdev->mpls_features |= NETIF_F_HW_CSUM;
|
|
|
|
+ netdev->hw_enc_features |= NETIF_F_HW_CSUM;
|
|
|
|
|
|
netdev->priv_flags |= IFF_UNICAST_FLT;
|
|
netdev->priv_flags |= IFF_UNICAST_FLT;
|
|
netdev->priv_flags |= IFF_SUPP_NOFCS;
|
|
netdev->priv_flags |= IFF_SUPP_NOFCS;
|
|
@@ -9304,7 +9263,8 @@ skip_sriov:
|
|
goto err_sw_init;
|
|
goto err_sw_init;
|
|
}
|
|
}
|
|
|
|
|
|
- ixgbe_get_platform_mac_addr(adapter);
|
|
|
|
|
|
+ eth_platform_get_mac_address(&adapter->pdev->dev,
|
|
|
|
+ adapter->hw.mac.perm_addr);
|
|
|
|
|
|
memcpy(netdev->dev_addr, hw->mac.perm_addr, netdev->addr_len);
|
|
memcpy(netdev->dev_addr, hw->mac.perm_addr, netdev->addr_len);
|
|
|
|
|