Commit c380e377 authored by David S. Miller's avatar David S. Miller

Merge branch '10GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue

Jeff Kirsher says:

====================
10GbE Intel Wired LAN Driver Updates 2017-05-31

This series contains updates to ixgbe and ixgbevf only.

Scott enables support for TSO & GSO for MPLS encapsulated packets for both
ixgbe and ixgbevf.

Liwei Song fixes an issue where seqcount/seqlock in ixgbe_get_stats64()
are not initialized in time, so move the initialization into probe routine
after the transmit and receive rings are initialized.

Paul cleans up led_[on|off] for X550EM_X, since the firmware configures
the PHY & MAC and we have no PHY access so LED on/off is not supported
with this device.

Emil provides several fixes, starting with enabling RSS on VF to VF
traffic on the same PF.  Fixed PHY identification, where the previous
method was unreliable, so use a different register to ensure proper
identification.  Cleaned up the logic which could cause us to
skip the link configuration, this skipping over the link configuration
was leaving SFP+ PHY's in an unstable state, so always call
setup_mac_link().  Added RS1 (rate select 1) support for ixgbe.  Lastly,
fixed incorrect logic in the setting up of SFP+ link speed.

Mark fixes the thermal sensor event logic, where it was being executed
when there really was no thermal event.  So simplify the logic to only
execute when there is a thermal event.

Tony adds additional error checks and reporting when setting a VF MAC
address to ensure that the MAC filter was successfully added.  Also
fixed possible truncation warnings, as well as implicit fallthrough
warnings.
====================
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents a99bbf6e d9c23ff8
...@@ -1589,15 +1589,17 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw, ...@@ -1589,15 +1589,17 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw,
switch (ntohs(input_mask->formatted.vlan_id) & 0xEFFF) { switch (ntohs(input_mask->formatted.vlan_id) & 0xEFFF) {
case 0x0000: case 0x0000:
/* mask VLAN ID, fall through to mask VLAN priority */ /* mask VLAN ID */
fdirm |= IXGBE_FDIRM_VLANID; fdirm |= IXGBE_FDIRM_VLANID;
/* fall through */
case 0x0FFF: case 0x0FFF:
/* mask VLAN priority */ /* mask VLAN priority */
fdirm |= IXGBE_FDIRM_VLANP; fdirm |= IXGBE_FDIRM_VLANP;
break; break;
case 0xE000: case 0xE000:
/* mask VLAN ID only, fall through */ /* mask VLAN ID only */
fdirm |= IXGBE_FDIRM_VLANID; fdirm |= IXGBE_FDIRM_VLANID;
/* fall through */
case 0xEFFF: case 0xEFFF:
/* no VLAN fields masked */ /* no VLAN fields masked */
break; break;
...@@ -1608,8 +1610,9 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw, ...@@ -1608,8 +1610,9 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw,
switch (input_mask->formatted.flex_bytes & 0xFFFF) { switch (input_mask->formatted.flex_bytes & 0xFFFF) {
case 0x0000: case 0x0000:
/* Mask Flex Bytes, fall through */ /* Mask Flex Bytes */
fdirm |= IXGBE_FDIRM_FLEX; fdirm |= IXGBE_FDIRM_FLEX;
/* fall through */
case 0xFFFF: case 0xFFFF:
break; break;
default: default:
......
...@@ -155,7 +155,7 @@ s32 ixgbe_setup_fc_generic(struct ixgbe_hw *hw) ...@@ -155,7 +155,7 @@ s32 ixgbe_setup_fc_generic(struct ixgbe_hw *hw)
if (ret_val) if (ret_val)
return ret_val; return ret_val;
/* only backplane uses autoc so fall though */ /* fall through - only backplane uses autoc */
case ixgbe_media_type_fiber: case ixgbe_media_type_fiber:
reg = IXGBE_READ_REG(hw, IXGBE_PCS1GANA); reg = IXGBE_READ_REG(hw, IXGBE_PCS1GANA);
...@@ -395,6 +395,7 @@ s32 ixgbe_init_hw_generic(struct ixgbe_hw *hw) ...@@ -395,6 +395,7 @@ s32 ixgbe_init_hw_generic(struct ixgbe_hw *hw)
} }
/* Initialize the LED link active for LED blink support */ /* Initialize the LED link active for LED blink support */
if (hw->mac.ops.init_led_link_act)
hw->mac.ops.init_led_link_act(hw); hw->mac.ops.init_led_link_act(hw);
return status; return status;
...@@ -3548,7 +3549,7 @@ void ixgbe_set_rxpba_generic(struct ixgbe_hw *hw, ...@@ -3548,7 +3549,7 @@ void ixgbe_set_rxpba_generic(struct ixgbe_hw *hw,
rxpktsize <<= IXGBE_RXPBSIZE_SHIFT; rxpktsize <<= IXGBE_RXPBSIZE_SHIFT;
for (; i < (num_pb / 2); i++) for (; i < (num_pb / 2); i++)
IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), rxpktsize); IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), rxpktsize);
/* Fall through to configure remaining packet buffers */ /* fall through - configure remaining packet buffers */
case (PBA_STRATEGY_EQUAL): case (PBA_STRATEGY_EQUAL):
/* Divide the remaining Rx packet buffer evenly among the TCs */ /* Divide the remaining Rx packet buffer evenly among the TCs */
rxpktsize = (pbsize / (num_pb - i)) << IXGBE_RXPBSIZE_SHIFT; rxpktsize = (pbsize / (num_pb - i)) << IXGBE_RXPBSIZE_SHIFT;
...@@ -4120,15 +4121,6 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, ...@@ -4120,15 +4121,6 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,
speedcnt++; speedcnt++;
highest_link_speed = IXGBE_LINK_SPEED_10GB_FULL; highest_link_speed = IXGBE_LINK_SPEED_10GB_FULL;
/* If we already have link at this speed, just jump out */
status = hw->mac.ops.check_link(hw, &link_speed, &link_up,
false);
if (status)
return status;
if (link_speed == IXGBE_LINK_SPEED_10GB_FULL && link_up)
goto out;
/* Set the module link speed */ /* Set the module link speed */
switch (hw->phy.media_type) { switch (hw->phy.media_type) {
case ixgbe_media_type_fiber: case ixgbe_media_type_fiber:
...@@ -4180,15 +4172,6 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, ...@@ -4180,15 +4172,6 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,
if (highest_link_speed == IXGBE_LINK_SPEED_UNKNOWN) if (highest_link_speed == IXGBE_LINK_SPEED_UNKNOWN)
highest_link_speed = IXGBE_LINK_SPEED_1GB_FULL; highest_link_speed = IXGBE_LINK_SPEED_1GB_FULL;
/* If we already have link at this speed, just jump out */
status = hw->mac.ops.check_link(hw, &link_speed, &link_up,
false);
if (status)
return status;
if (link_speed == IXGBE_LINK_SPEED_1GB_FULL && link_up)
goto out;
/* Set the module link speed */ /* Set the module link speed */
switch (hw->phy.media_type) { switch (hw->phy.media_type) {
case ixgbe_media_type_fiber: case ixgbe_media_type_fiber:
...@@ -4295,4 +4278,23 @@ void ixgbe_set_soft_rate_select_speed(struct ixgbe_hw *hw, ...@@ -4295,4 +4278,23 @@ void ixgbe_set_soft_rate_select_speed(struct ixgbe_hw *hw,
hw_dbg(hw, "Failed to write Rx Rate Select RS0\n"); hw_dbg(hw, "Failed to write Rx Rate Select RS0\n");
return; return;
} }
/* Set RS1 */
status = hw->phy.ops.read_i2c_byte(hw, IXGBE_SFF_SFF_8472_ESCB,
IXGBE_I2C_EEPROM_DEV_ADDR2,
&eeprom_data);
if (status) {
hw_dbg(hw, "Failed to read Rx Rate Select RS1\n");
return;
}
eeprom_data = (eeprom_data & ~IXGBE_SFF_SOFT_RS_SELECT_MASK) | rs;
status = hw->phy.ops.write_i2c_byte(hw, IXGBE_SFF_SFF_8472_ESCB,
IXGBE_I2C_EEPROM_DEV_ADDR2,
eeprom_data);
if (status) {
hw_dbg(hw, "Failed to write Rx Rate Select RS1\n");
return;
}
} }
...@@ -2254,6 +2254,9 @@ static int ixgbe_set_phys_id(struct net_device *netdev, ...@@ -2254,6 +2254,9 @@ static int ixgbe_set_phys_id(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;
if (!hw->mac.ops.led_on || !hw->mac.ops.led_off)
return -EOPNOTSUPP;
switch (state) { switch (state) {
case ETHTOOL_ID_ACTIVE: case ETHTOOL_ID_ACTIVE:
adapter->led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL); adapter->led_reg = IXGBE_READ_REG(hw, IXGBE_LEDCTL);
...@@ -2665,6 +2668,7 @@ static int ixgbe_flowspec_to_flow_type(struct ethtool_rx_flow_spec *fsp, ...@@ -2665,6 +2668,7 @@ static int ixgbe_flowspec_to_flow_type(struct ethtool_rx_flow_spec *fsp,
*flow_type = IXGBE_ATR_FLOW_TYPE_IPV4; *flow_type = IXGBE_ATR_FLOW_TYPE_IPV4;
break; break;
} }
/* fall through */
default: default:
return 0; return 0;
} }
......
...@@ -58,6 +58,7 @@ ...@@ -58,6 +58,7 @@
#include <net/tc_act/tc_gact.h> #include <net/tc_act/tc_gact.h>
#include <net/tc_act/tc_mirred.h> #include <net/tc_act/tc_mirred.h>
#include <net/vxlan.h> #include <net/vxlan.h>
#include <net/mpls.h>
#include "ixgbe.h" #include "ixgbe.h"
#include "ixgbe_common.h" #include "ixgbe_common.h"
...@@ -1451,7 +1452,7 @@ static int __ixgbe_notify_dca(struct device *dev, void *data) ...@@ -1451,7 +1452,7 @@ static int __ixgbe_notify_dca(struct device *dev, void *data)
IXGBE_DCA_CTRL_DCA_MODE_CB2); IXGBE_DCA_CTRL_DCA_MODE_CB2);
break; break;
} }
/* Fall Through since DCA is disabled. */ /* fall through - DCA is disabled. */
case DCA_PROVIDER_REMOVE: case DCA_PROVIDER_REMOVE:
if (adapter->flags & IXGBE_FLAG_DCA_ENABLED) { if (adapter->flags & IXGBE_FLAG_DCA_ENABLED) {
dca_remove_requester(dev); dca_remove_requester(dev);
...@@ -2232,6 +2233,7 @@ static struct sk_buff *ixgbe_run_xdp(struct ixgbe_adapter *adapter, ...@@ -2232,6 +2233,7 @@ static struct sk_buff *ixgbe_run_xdp(struct ixgbe_adapter *adapter,
break; break;
default: default:
bpf_warn_invalid_xdp_action(act); bpf_warn_invalid_xdp_action(act);
/* fallthrough */
case XDP_ABORTED: case XDP_ABORTED:
trace_xdp_exception(rx_ring->netdev, xdp_prog, act); trace_xdp_exception(rx_ring->netdev, xdp_prog, act);
/* fallthrough -- handle aborts by dropping packet */ /* fallthrough -- handle aborts by dropping packet */
...@@ -2638,8 +2640,7 @@ static void ixgbe_check_overtemp_subtask(struct ixgbe_adapter *adapter) ...@@ -2638,8 +2640,7 @@ static void ixgbe_check_overtemp_subtask(struct ixgbe_adapter *adapter)
if (test_bit(__IXGBE_DOWN, &adapter->state)) if (test_bit(__IXGBE_DOWN, &adapter->state))
return; return;
if (!(adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) && if (!(adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_EVENT))
!(adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_EVENT))
return; return;
adapter->flags2 &= ~IXGBE_FLAG2_TEMP_SENSOR_EVENT; adapter->flags2 &= ~IXGBE_FLAG2_TEMP_SENSOR_EVENT;
...@@ -3105,23 +3106,23 @@ int ixgbe_poll(struct napi_struct *napi, int budget) ...@@ -3105,23 +3106,23 @@ int ixgbe_poll(struct napi_struct *napi, int budget)
static int ixgbe_request_msix_irqs(struct ixgbe_adapter *adapter) static int ixgbe_request_msix_irqs(struct ixgbe_adapter *adapter)
{ {
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
unsigned int ri = 0, ti = 0;
int vector, err; int vector, err;
int ri = 0, ti = 0;
for (vector = 0; vector < adapter->num_q_vectors; vector++) { for (vector = 0; vector < adapter->num_q_vectors; vector++) {
struct ixgbe_q_vector *q_vector = adapter->q_vector[vector]; struct ixgbe_q_vector *q_vector = adapter->q_vector[vector];
struct msix_entry *entry = &adapter->msix_entries[vector]; struct msix_entry *entry = &adapter->msix_entries[vector];
if (q_vector->tx.ring && q_vector->rx.ring) { if (q_vector->tx.ring && q_vector->rx.ring) {
snprintf(q_vector->name, sizeof(q_vector->name) - 1, snprintf(q_vector->name, sizeof(q_vector->name),
"%s-%s-%d", netdev->name, "TxRx", ri++); "%s-TxRx-%u", netdev->name, ri++);
ti++; ti++;
} else if (q_vector->rx.ring) { } else if (q_vector->rx.ring) {
snprintf(q_vector->name, sizeof(q_vector->name) - 1, snprintf(q_vector->name, sizeof(q_vector->name),
"%s-%s-%d", netdev->name, "rx", ri++); "%s-rx-%u", netdev->name, ri++);
} else if (q_vector->tx.ring) { } else if (q_vector->tx.ring) {
snprintf(q_vector->name, sizeof(q_vector->name) - 1, snprintf(q_vector->name, sizeof(q_vector->name),
"%s-%s-%d", netdev->name, "tx", ti++); "%s-tx-%u", netdev->name, ti++);
} else { } else {
/* skip this unused q_vector */ /* skip this unused q_vector */
continue; continue;
...@@ -3802,6 +3803,9 @@ static void ixgbe_setup_mrqc(struct ixgbe_adapter *adapter) ...@@ -3802,6 +3803,9 @@ static void ixgbe_setup_mrqc(struct ixgbe_adapter *adapter)
mrqc = IXGBE_MRQC_VMDQRSS32EN; mrqc = IXGBE_MRQC_VMDQRSS32EN;
else else
mrqc = IXGBE_MRQC_VMDQRSS64EN; mrqc = IXGBE_MRQC_VMDQRSS64EN;
/* Enable L3/L4 for Tx Switched packets */
mrqc |= IXGBE_MRQC_L3L4TXSWEN;
} else { } else {
if (tcs > 4) if (tcs > 4)
mrqc = IXGBE_MRQC_RTRSS8TCEN; mrqc = IXGBE_MRQC_RTRSS8TCEN;
...@@ -4174,7 +4178,7 @@ static void ixgbe_setup_rdrxctl(struct ixgbe_adapter *adapter) ...@@ -4174,7 +4178,7 @@ static void ixgbe_setup_rdrxctl(struct ixgbe_adapter *adapter)
case ixgbe_mac_x550em_a: case ixgbe_mac_x550em_a:
if (adapter->num_vfs) if (adapter->num_vfs)
rdrxctl |= IXGBE_RDRXCTL_PSP; rdrxctl |= IXGBE_RDRXCTL_PSP;
/* fall through for older HW */ /* fall through */
case ixgbe_mac_82599EB: case ixgbe_mac_82599EB:
case ixgbe_mac_X540: case ixgbe_mac_X540:
/* Disable RSC for ACK packets */ /* Disable RSC for ACK packets */
...@@ -6183,8 +6187,6 @@ int ixgbe_setup_tx_resources(struct ixgbe_ring *tx_ring) ...@@ -6183,8 +6187,6 @@ int ixgbe_setup_tx_resources(struct ixgbe_ring *tx_ring)
if (!tx_ring->tx_buffer_info) if (!tx_ring->tx_buffer_info)
goto err; goto err;
u64_stats_init(&tx_ring->syncp);
/* round up to nearest 4K */ /* round up to nearest 4K */
tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc); tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc);
tx_ring->size = ALIGN(tx_ring->size, 4096); tx_ring->size = ALIGN(tx_ring->size, 4096);
...@@ -6278,8 +6280,6 @@ int ixgbe_setup_rx_resources(struct ixgbe_adapter *adapter, ...@@ -6278,8 +6280,6 @@ int ixgbe_setup_rx_resources(struct ixgbe_adapter *adapter,
if (!rx_ring->rx_buffer_info) if (!rx_ring->rx_buffer_info)
goto err; goto err;
u64_stats_init(&rx_ring->syncp);
/* Round up to nearest 4K */ /* Round up to nearest 4K */
rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc); rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
rx_ring->size = ALIGN(rx_ring->size, 4096); rx_ring->size = ALIGN(rx_ring->size, 4096);
...@@ -6886,6 +6886,7 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter) ...@@ -6886,6 +6886,7 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
hwstats->o2bspc += IXGBE_READ_REG(hw, IXGBE_O2BSPC); hwstats->o2bspc += IXGBE_READ_REG(hw, IXGBE_O2BSPC);
hwstats->b2ospc += IXGBE_READ_REG(hw, IXGBE_B2OSPC); hwstats->b2ospc += IXGBE_READ_REG(hw, IXGBE_B2OSPC);
hwstats->b2ogprc += IXGBE_READ_REG(hw, IXGBE_B2OGPRC); hwstats->b2ogprc += IXGBE_READ_REG(hw, IXGBE_B2OGPRC);
/* fall through */
case ixgbe_mac_82599EB: case ixgbe_mac_82599EB:
for (i = 0; i < 16; i++) for (i = 0; i < 16; i++)
adapter->hw_rx_no_dma_resources += adapter->hw_rx_no_dma_resources +=
...@@ -7667,6 +7668,9 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring, ...@@ -7667,6 +7668,9 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring,
if (err < 0) if (err < 0)
return err; return err;
if (eth_p_mpls(first->protocol))
ip.hdr = skb_inner_network_header(skb);
else
ip.hdr = skb_network_header(skb); ip.hdr = skb_network_header(skb);
l4.hdr = skb_checksum_start(skb); l4.hdr = skb_checksum_start(skb);
...@@ -8205,6 +8209,7 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb, ...@@ -8205,6 +8209,7 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb,
if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED)
break; break;
/* fall through */
default: default:
return fallback(dev, skb); return fallback(dev, skb);
} }
...@@ -9929,6 +9934,7 @@ bool ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id, ...@@ -9929,6 +9934,7 @@ bool ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id,
/* only support first port */ /* only support first port */
if (hw->bus.func != 0) if (hw->bus.func != 0)
break; break;
/* fall through */
case IXGBE_SUBDEV_ID_82599_SP_560FLR: case IXGBE_SUBDEV_ID_82599_SP_560FLR:
case IXGBE_SUBDEV_ID_82599_SFP: case IXGBE_SUBDEV_ID_82599_SFP:
case IXGBE_SUBDEV_ID_82599_RNDC: case IXGBE_SUBDEV_ID_82599_RNDC:
...@@ -10191,7 +10197,11 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -10191,7 +10197,11 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID; netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID;
netdev->hw_enc_features |= netdev->vlan_features; netdev->hw_enc_features |= netdev->vlan_features;
netdev->mpls_features |= NETIF_F_HW_CSUM; netdev->mpls_features |= NETIF_F_SG |
NETIF_F_TSO |
NETIF_F_TSO6 |
NETIF_F_HW_CSUM;
netdev->mpls_features |= IXGBE_GSO_PARTIAL_FEATURES;
/* set this bit last since it cannot be part of vlan_features */ /* set this bit last since it cannot be part of vlan_features */
netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER | netdev->features |= NETIF_F_HW_VLAN_CTAG_FILTER |
...@@ -10275,6 +10285,10 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -10275,6 +10285,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;
for (i = 0; i < adapter->num_rx_queues; i++)
u64_stats_init(&adapter->rx_ring[i]->syncp);
for (i = 0; i < adapter->num_tx_queues; i++)
u64_stats_init(&adapter->tx_ring[i]->syncp);
for (i = 0; i < adapter->num_xdp_queues; i++) for (i = 0; i < adapter->num_xdp_queues; i++)
u64_stats_init(&adapter->xdp_ring[i]->syncp); u64_stats_init(&adapter->xdp_ring[i]->syncp);
......
...@@ -84,8 +84,9 @@ ...@@ -84,8 +84,9 @@
#define IXGBE_CS4227_GLOBAL_ID_LSB 0 #define IXGBE_CS4227_GLOBAL_ID_LSB 0
#define IXGBE_CS4227_GLOBAL_ID_MSB 1 #define IXGBE_CS4227_GLOBAL_ID_MSB 1
#define IXGBE_CS4227_SCRATCH 2 #define IXGBE_CS4227_SCRATCH 2
#define IXGBE_CS4223_PHY_ID 0x7003 /* Quad port */ #define IXGBE_CS4227_EFUSE_PDF_SKU 0x19F
#define IXGBE_CS4227_PHY_ID 0x3003 /* Dual port */ #define IXGBE_CS4223_SKU_ID 0x0010 /* Quad port */
#define IXGBE_CS4227_SKU_ID 0x0014 /* Dual port */
#define IXGBE_CS4227_RESET_PENDING 0x1357 #define IXGBE_CS4227_RESET_PENDING 0x1357
#define IXGBE_CS4227_RESET_COMPLETE 0x5AA5 #define IXGBE_CS4227_RESET_COMPLETE 0x5AA5
#define IXGBE_CS4227_RETRIES 15 #define IXGBE_CS4227_RETRIES 15
......
...@@ -540,16 +540,15 @@ static s32 ixgbe_set_vf_lpe(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf) ...@@ -540,16 +540,15 @@ static s32 ixgbe_set_vf_lpe(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)
case ixgbe_mbox_api_11: case ixgbe_mbox_api_11:
case ixgbe_mbox_api_12: case ixgbe_mbox_api_12:
case ixgbe_mbox_api_13: case ixgbe_mbox_api_13:
/* /* Version 1.1 supports jumbo frames on VFs if PF has
* Version 1.1 supports jumbo frames on VFs if PF has
* jumbo frames enabled which means legacy VFs are * jumbo frames enabled which means legacy VFs are
* disabled * disabled
*/ */
if (pf_max_frame > ETH_FRAME_LEN) if (pf_max_frame > ETH_FRAME_LEN)
break; break;
/* fall through */
default: default:
/* /* If the PF or VF are running w/ jumbo frames enabled
* If the PF or VF are running w/ jumbo frames enabled
* we need to shut down the VF Rx path as we cannot * we need to shut down the VF Rx path as we cannot
* support jumbo frames on legacy VFs * support jumbo frames on legacy VFs
*/ */
...@@ -778,11 +777,17 @@ static inline void ixgbe_vf_reset_event(struct ixgbe_adapter *adapter, u32 vf) ...@@ -778,11 +777,17 @@ static inline void ixgbe_vf_reset_event(struct ixgbe_adapter *adapter, u32 vf)
static int ixgbe_set_vf_mac(struct ixgbe_adapter *adapter, static int ixgbe_set_vf_mac(struct ixgbe_adapter *adapter,
int vf, unsigned char *mac_addr) int vf, unsigned char *mac_addr)
{ {
s32 retval;
ixgbe_del_mac_filter(adapter, adapter->vfinfo[vf].vf_mac_addresses, vf); ixgbe_del_mac_filter(adapter, adapter->vfinfo[vf].vf_mac_addresses, vf);
memcpy(adapter->vfinfo[vf].vf_mac_addresses, mac_addr, ETH_ALEN); retval = ixgbe_add_mac_filter(adapter, mac_addr, vf);
ixgbe_add_mac_filter(adapter, adapter->vfinfo[vf].vf_mac_addresses, vf); if (retval >= 0)
memcpy(adapter->vfinfo[vf].vf_mac_addresses, mac_addr,
ETH_ALEN);
else
memset(adapter->vfinfo[vf].vf_mac_addresses, 0, ETH_ALEN);
return 0; return retval;
} }
int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask) int ixgbe_vf_configuration(struct pci_dev *pdev, unsigned int event_mask)
...@@ -1347,27 +1352,49 @@ void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter) ...@@ -1347,27 +1352,49 @@ void ixgbe_ping_all_vfs(struct ixgbe_adapter *adapter)
int ixgbe_ndo_set_vf_mac(struct net_device *netdev, int vf, u8 *mac) int ixgbe_ndo_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
{ {
struct ixgbe_adapter *adapter = netdev_priv(netdev); struct ixgbe_adapter *adapter = netdev_priv(netdev);
s32 retval;
if (vf >= adapter->num_vfs) if (vf >= adapter->num_vfs)
return -EINVAL; return -EINVAL;
if (is_zero_ether_addr(mac)) { if (is_valid_ether_addr(mac)) {
adapter->vfinfo[vf].pf_set_mac = false;
dev_info(&adapter->pdev->dev, "removing MAC on VF %d\n", vf);
} else if (is_valid_ether_addr(mac)) {
adapter->vfinfo[vf].pf_set_mac = true;
dev_info(&adapter->pdev->dev, "setting MAC %pM on VF %d\n", dev_info(&adapter->pdev->dev, "setting MAC %pM on VF %d\n",
mac, vf); mac, vf);
dev_info(&adapter->pdev->dev, "Reload the VF driver to make this change effective."); dev_info(&adapter->pdev->dev, "Reload the VF driver to make this change effective.");
retval = ixgbe_set_vf_mac(adapter, vf, mac);
if (retval >= 0) {
adapter->vfinfo[vf].pf_set_mac = true;
if (test_bit(__IXGBE_DOWN, &adapter->state)) { if (test_bit(__IXGBE_DOWN, &adapter->state)) {
dev_warn(&adapter->pdev->dev, "The VF MAC address has been set, but the PF device is not up.\n"); dev_warn(&adapter->pdev->dev, "The VF MAC address has been set, but the PF device is not up.\n");
dev_warn(&adapter->pdev->dev, "Bring the PF device up before attempting to use the VF device.\n"); dev_warn(&adapter->pdev->dev, "Bring the PF device up before attempting to use the VF device.\n");
} }
} else { } else {
return -EINVAL; dev_warn(&adapter->pdev->dev, "The VF MAC address was NOT set due to invalid or duplicate MAC address.\n");
} }
} else if (is_zero_ether_addr(mac)) {
unsigned char *vf_mac_addr =
adapter->vfinfo[vf].vf_mac_addresses;
/* nothing to do */
if (is_zero_ether_addr(vf_mac_addr))
return 0;
return ixgbe_set_vf_mac(adapter, vf, mac); dev_info(&adapter->pdev->dev, "removing MAC on VF %d\n", vf);
retval = ixgbe_del_mac_filter(adapter, vf_mac_addr, vf);
if (retval >= 0) {
adapter->vfinfo[vf].pf_set_mac = false;
memcpy(vf_mac_addr, mac, ETH_ALEN);
} else {
dev_warn(&adapter->pdev->dev, "Could NOT remove the VF MAC address.\n");
}
} else {
retval = -EINVAL;
}
return retval;
} }
static int ixgbe_enable_port_vlan(struct ixgbe_adapter *adapter, int vf, static int ixgbe_enable_port_vlan(struct ixgbe_adapter *adapter, int vf,
......
...@@ -1750,14 +1750,14 @@ ixgbe_setup_mac_link_sfp_n(struct ixgbe_hw *hw, ixgbe_link_speed speed, ...@@ -1750,14 +1750,14 @@ ixgbe_setup_mac_link_sfp_n(struct ixgbe_hw *hw, ixgbe_link_speed speed,
if (ret_val == IXGBE_ERR_SFP_NOT_PRESENT) if (ret_val == IXGBE_ERR_SFP_NOT_PRESENT)
return 0; return 0;
if (!ret_val) if (ret_val)
return ret_val; return ret_val;
/* Configure internal PHY for native SFI based on module type */ /* Configure internal PHY for native SFI based on module type */
ret_val = hw->mac.ops.read_iosf_sb_reg(hw, ret_val = hw->mac.ops.read_iosf_sb_reg(hw,
IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
IXGBE_SB_IOSF_TARGET_KR_PHY, &reg_phy_int); IXGBE_SB_IOSF_TARGET_KR_PHY, &reg_phy_int);
if (!ret_val) if (ret_val)
return ret_val; return ret_val;
reg_phy_int &= IXGBE_KRM_PMD_FLX_MASK_ST20_SFI_10G_DA; reg_phy_int &= IXGBE_KRM_PMD_FLX_MASK_ST20_SFI_10G_DA;
...@@ -1767,7 +1767,7 @@ ixgbe_setup_mac_link_sfp_n(struct ixgbe_hw *hw, ixgbe_link_speed speed, ...@@ -1767,7 +1767,7 @@ ixgbe_setup_mac_link_sfp_n(struct ixgbe_hw *hw, ixgbe_link_speed speed,
ret_val = hw->mac.ops.write_iosf_sb_reg(hw, ret_val = hw->mac.ops.write_iosf_sb_reg(hw,
IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id), IXGBE_KRM_PMD_FLX_MASK_ST20(hw->bus.lan_id),
IXGBE_SB_IOSF_TARGET_KR_PHY, reg_phy_int); IXGBE_SB_IOSF_TARGET_KR_PHY, reg_phy_int);
if (!ret_val) if (ret_val)
return ret_val; return ret_val;
/* Setup SFI internal link. */ /* Setup SFI internal link. */
...@@ -1798,7 +1798,7 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed, ...@@ -1798,7 +1798,7 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed,
if (ret_val == IXGBE_ERR_SFP_NOT_PRESENT) if (ret_val == IXGBE_ERR_SFP_NOT_PRESENT)
return 0; return 0;
if (!ret_val) if (ret_val)
return ret_val; return ret_val;
/* Configure internal PHY for KR/KX. */ /* Configure internal PHY for KR/KX. */
...@@ -1807,8 +1807,8 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed, ...@@ -1807,8 +1807,8 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed,
if (hw->phy.mdio.prtad == MDIO_PRTAD_NONE) if (hw->phy.mdio.prtad == MDIO_PRTAD_NONE)
return IXGBE_ERR_PHY_ADDR_INVALID; return IXGBE_ERR_PHY_ADDR_INVALID;
/* Get external PHY device id */ /* Get external PHY SKU id */
ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_GLOBAL_ID_MSB, ret_val = hw->phy.ops.read_reg(hw, IXGBE_CS4227_EFUSE_PDF_SKU,
IXGBE_MDIO_ZERO_DEV_TYPE, &reg_phy_ext); IXGBE_MDIO_ZERO_DEV_TYPE, &reg_phy_ext);
if (ret_val) if (ret_val)
return ret_val; return ret_val;
...@@ -1816,7 +1816,7 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed, ...@@ -1816,7 +1816,7 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed,
/* When configuring quad port CS4223, the MAC instance is part /* When configuring quad port CS4223, the MAC instance is part
* of the slice offset. * of the slice offset.
*/ */
if (reg_phy_ext == IXGBE_CS4223_PHY_ID) if (reg_phy_ext == IXGBE_CS4223_SKU_ID)
slice_offset = (hw->bus.lan_id + slice_offset = (hw->bus.lan_id +
(hw->bus.instance_id << 1)) << 12; (hw->bus.instance_id << 1)) << 12;
else else
...@@ -1824,12 +1824,28 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed, ...@@ -1824,12 +1824,28 @@ ixgbe_setup_mac_link_sfp_x550a(struct ixgbe_hw *hw, ixgbe_link_speed speed,
/* Configure CS4227/CS4223 LINE side to proper mode. */ /* Configure CS4227/CS4223 LINE side to proper mode. */
reg_slice = IXGBE_CS4227_LINE_SPARE24_LSB + slice_offset; reg_slice = IXGBE_CS4227_LINE_SPARE24_LSB + slice_offset;
ret_val = hw->phy.ops.read_reg(hw, reg_slice,
IXGBE_MDIO_ZERO_DEV_TYPE, &reg_phy_ext);
if (ret_val)
return ret_val;
reg_phy_ext &= ~((IXGBE_CS4227_EDC_MODE_CX1 << 1) |
(IXGBE_CS4227_EDC_MODE_SR << 1));
if (setup_linear) if (setup_linear)
reg_phy_ext = (IXGBE_CS4227_EDC_MODE_CX1 << 1) | 1; reg_phy_ext = (IXGBE_CS4227_EDC_MODE_CX1 << 1) | 1;
else else
reg_phy_ext = (IXGBE_CS4227_EDC_MODE_SR << 1) | 1; reg_phy_ext = (IXGBE_CS4227_EDC_MODE_SR << 1) | 1;
return hw->phy.ops.write_reg(hw, reg_slice, IXGBE_MDIO_ZERO_DEV_TYPE,
reg_phy_ext); ret_val = hw->phy.ops.write_reg(hw, reg_slice,
IXGBE_MDIO_ZERO_DEV_TYPE, reg_phy_ext);
if (ret_val)
return ret_val;
/* Flush previous write with a read */
return hw->phy.ops.read_reg(hw, reg_slice,
IXGBE_MDIO_ZERO_DEV_TYPE, &reg_phy_ext);
} }
/** /**
...@@ -3206,6 +3222,7 @@ static s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw) ...@@ -3206,6 +3222,7 @@ static s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw)
phy->ops.setup_link = NULL; phy->ops.setup_link = NULL;
phy->ops.read_reg = NULL; phy->ops.read_reg = NULL;
phy->ops.write_reg = NULL; phy->ops.write_reg = NULL;
phy->ops.reset = NULL;
break; break;
default: default:
break; break;
...@@ -3819,6 +3836,28 @@ static const struct ixgbe_mac_operations mac_ops_X550EM_x = { ...@@ -3819,6 +3836,28 @@ static const struct ixgbe_mac_operations mac_ops_X550EM_x = {
.write_iosf_sb_reg = ixgbe_write_iosf_sb_reg_x550, .write_iosf_sb_reg = ixgbe_write_iosf_sb_reg_x550,
}; };
static const struct ixgbe_mac_operations mac_ops_X550EM_x_fw = {
X550_COMMON_MAC
.led_on = NULL,
.led_off = NULL,
.init_led_link_act = NULL,
.reset_hw = &ixgbe_reset_hw_X550em,
.get_media_type = &ixgbe_get_media_type_X550em,
.get_san_mac_addr = NULL,
.get_wwn_prefix = NULL,
.setup_link = &ixgbe_setup_mac_link_X540,
.get_link_capabilities = &ixgbe_get_link_capabilities_X550em,
.get_bus_info = &ixgbe_get_bus_info_X550em,
.setup_sfp = ixgbe_setup_sfp_modules_X550em,
.acquire_swfw_sync = &ixgbe_acquire_swfw_sync_X550em,
.release_swfw_sync = &ixgbe_release_swfw_sync_X550em,
.init_swfw_sync = &ixgbe_init_swfw_sync_X540,
.setup_fc = NULL,
.fc_autoneg = ixgbe_fc_autoneg,
.read_iosf_sb_reg = ixgbe_read_iosf_sb_reg_x550,
.write_iosf_sb_reg = ixgbe_write_iosf_sb_reg_x550,
};
static struct ixgbe_mac_operations mac_ops_x550em_a = { static struct ixgbe_mac_operations mac_ops_x550em_a = {
X550_COMMON_MAC X550_COMMON_MAC
.led_on = ixgbe_led_on_t_x550em, .led_on = ixgbe_led_on_t_x550em,
...@@ -3986,7 +4025,7 @@ const struct ixgbe_info ixgbe_X550EM_x_info = { ...@@ -3986,7 +4025,7 @@ const struct ixgbe_info ixgbe_X550EM_x_info = {
const struct ixgbe_info ixgbe_x550em_x_fw_info = { const struct ixgbe_info ixgbe_x550em_x_fw_info = {
.mac = ixgbe_mac_X550EM_x, .mac = ixgbe_mac_X550EM_x,
.get_invariants = ixgbe_get_invariants_X550_x_fw, .get_invariants = ixgbe_get_invariants_X550_x_fw,
.mac_ops = &mac_ops_X550EM_x, .mac_ops = &mac_ops_X550EM_x_fw,
.eeprom_ops = &eeprom_ops_X550EM_x, .eeprom_ops = &eeprom_ops_X550EM_x,
.phy_ops = &phy_ops_x550em_x_fw, .phy_ops = &phy_ops_x550em_x_fw,
.mbx_ops = &mbx_ops_generic, .mbx_ops = &mbx_ops_generic,
......
...@@ -49,6 +49,7 @@ ...@@ -49,6 +49,7 @@
#include <linux/if.h> #include <linux/if.h>
#include <linux/if_vlan.h> #include <linux/if_vlan.h>
#include <linux/prefetch.h> #include <linux/prefetch.h>
#include <net/mpls.h>
#include "ixgbevf.h" #include "ixgbevf.h"
...@@ -1350,23 +1351,23 @@ static int ixgbevf_request_msix_irqs(struct ixgbevf_adapter *adapter) ...@@ -1350,23 +1351,23 @@ static int ixgbevf_request_msix_irqs(struct ixgbevf_adapter *adapter)
{ {
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
int q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS; int q_vectors = adapter->num_msix_vectors - NON_Q_VECTORS;
unsigned int ri = 0, ti = 0;
int vector, err; int vector, err;
int ri = 0, ti = 0;
for (vector = 0; vector < q_vectors; vector++) { for (vector = 0; vector < q_vectors; vector++) {
struct ixgbevf_q_vector *q_vector = adapter->q_vector[vector]; struct ixgbevf_q_vector *q_vector = adapter->q_vector[vector];
struct msix_entry *entry = &adapter->msix_entries[vector]; struct msix_entry *entry = &adapter->msix_entries[vector];
if (q_vector->tx.ring && q_vector->rx.ring) { if (q_vector->tx.ring && q_vector->rx.ring) {
snprintf(q_vector->name, sizeof(q_vector->name) - 1, snprintf(q_vector->name, sizeof(q_vector->name),
"%s-%s-%d", netdev->name, "TxRx", ri++); "%s-TxRx-%u", netdev->name, ri++);
ti++; ti++;
} else if (q_vector->rx.ring) { } else if (q_vector->rx.ring) {
snprintf(q_vector->name, sizeof(q_vector->name) - 1, snprintf(q_vector->name, sizeof(q_vector->name),
"%s-%s-%d", netdev->name, "rx", ri++); "%s-rx-%u", netdev->name, ri++);
} else if (q_vector->tx.ring) { } else if (q_vector->tx.ring) {
snprintf(q_vector->name, sizeof(q_vector->name) - 1, snprintf(q_vector->name, sizeof(q_vector->name),
"%s-%s-%d", netdev->name, "tx", ti++); "%s-tx-%u", netdev->name, ti++);
} else { } else {
/* skip this unused q_vector */ /* skip this unused q_vector */
continue; continue;
...@@ -3321,6 +3322,9 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring, ...@@ -3321,6 +3322,9 @@ static int ixgbevf_tso(struct ixgbevf_ring *tx_ring,
if (err < 0) if (err < 0)
return err; return err;
if (eth_p_mpls(first->protocol))
ip.hdr = skb_inner_network_header(skb);
else
ip.hdr = skb_network_header(skb); ip.hdr = skb_network_header(skb);
l4.hdr = skb_checksum_start(skb); l4.hdr = skb_checksum_start(skb);
...@@ -4075,7 +4079,11 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -4075,7 +4079,11 @@ static int ixgbevf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
netdev->features |= NETIF_F_HIGHDMA; netdev->features |= NETIF_F_HIGHDMA;
netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID; netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID;
netdev->mpls_features |= NETIF_F_HW_CSUM; netdev->mpls_features |= NETIF_F_SG |
NETIF_F_TSO |
NETIF_F_TSO6 |
NETIF_F_HW_CSUM;
netdev->mpls_features |= IXGBEVF_GSO_PARTIAL_FEATURES;
netdev->hw_enc_features |= netdev->vlan_features; netdev->hw_enc_features |= netdev->vlan_features;
/* set this bit last since it cannot be part of vlan_features */ /* set this bit last since it cannot be part of vlan_features */
......
...@@ -335,6 +335,7 @@ int ixgbevf_get_reta_locked(struct ixgbe_hw *hw, u32 *reta, int num_rx_queues) ...@@ -335,6 +335,7 @@ int ixgbevf_get_reta_locked(struct ixgbe_hw *hw, u32 *reta, int num_rx_queues)
case ixgbe_mbox_api_12: case ixgbe_mbox_api_12:
if (hw->mac.type < ixgbe_mac_X550_vf) if (hw->mac.type < ixgbe_mac_X550_vf)
break; break;
/* fall through */
default: default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
...@@ -401,6 +402,7 @@ int ixgbevf_get_rss_key_locked(struct ixgbe_hw *hw, u8 *rss_key) ...@@ -401,6 +402,7 @@ int ixgbevf_get_rss_key_locked(struct ixgbe_hw *hw, u8 *rss_key)
case ixgbe_mbox_api_12: case ixgbe_mbox_api_12:
if (hw->mac.type < ixgbe_mac_X550_vf) if (hw->mac.type < ixgbe_mac_X550_vf)
break; break;
/* fall through */
default: default:
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment