Skip to content

Commit c380e37

Browse files
committed
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: David S. Miller <[email protected]>
2 parents a99bbf6 + d9c23ff commit c380e37

File tree

9 files changed

+180
-80
lines changed

9 files changed

+180
-80
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,15 +1589,17 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw,
15891589

15901590
switch (ntohs(input_mask->formatted.vlan_id) & 0xEFFF) {
15911591
case 0x0000:
1592-
/* mask VLAN ID, fall through to mask VLAN priority */
1592+
/* mask VLAN ID */
15931593
fdirm |= IXGBE_FDIRM_VLANID;
1594+
/* fall through */
15941595
case 0x0FFF:
15951596
/* mask VLAN priority */
15961597
fdirm |= IXGBE_FDIRM_VLANP;
15971598
break;
15981599
case 0xE000:
1599-
/* mask VLAN ID only, fall through */
1600+
/* mask VLAN ID only */
16001601
fdirm |= IXGBE_FDIRM_VLANID;
1602+
/* fall through */
16011603
case 0xEFFF:
16021604
/* no VLAN fields masked */
16031605
break;
@@ -1608,8 +1610,9 @@ s32 ixgbe_fdir_set_input_mask_82599(struct ixgbe_hw *hw,
16081610

16091611
switch (input_mask->formatted.flex_bytes & 0xFFFF) {
16101612
case 0x0000:
1611-
/* Mask Flex Bytes, fall through */
1613+
/* Mask Flex Bytes */
16121614
fdirm |= IXGBE_FDIRM_FLEX;
1615+
/* fall through */
16131616
case 0xFFFF:
16141617
break;
16151618
default:

drivers/net/ethernet/intel/ixgbe/ixgbe_common.c

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ s32 ixgbe_setup_fc_generic(struct ixgbe_hw *hw)
155155
if (ret_val)
156156
return ret_val;
157157

158-
/* only backplane uses autoc so fall though */
158+
/* fall through - only backplane uses autoc */
159159
case ixgbe_media_type_fiber:
160160
reg = IXGBE_READ_REG(hw, IXGBE_PCS1GANA);
161161

@@ -395,7 +395,8 @@ s32 ixgbe_init_hw_generic(struct ixgbe_hw *hw)
395395
}
396396

397397
/* Initialize the LED link active for LED blink support */
398-
hw->mac.ops.init_led_link_act(hw);
398+
if (hw->mac.ops.init_led_link_act)
399+
hw->mac.ops.init_led_link_act(hw);
399400

400401
return status;
401402
}
@@ -3548,7 +3549,7 @@ void ixgbe_set_rxpba_generic(struct ixgbe_hw *hw,
35483549
rxpktsize <<= IXGBE_RXPBSIZE_SHIFT;
35493550
for (; i < (num_pb / 2); i++)
35503551
IXGBE_WRITE_REG(hw, IXGBE_RXPBSIZE(i), rxpktsize);
3551-
/* Fall through to configure remaining packet buffers */
3552+
/* fall through - configure remaining packet buffers */
35523553
case (PBA_STRATEGY_EQUAL):
35533554
/* Divide the remaining Rx packet buffer evenly among the TCs */
35543555
rxpktsize = (pbsize / (num_pb - i)) << IXGBE_RXPBSIZE_SHIFT;
@@ -4120,15 +4121,6 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,
41204121
speedcnt++;
41214122
highest_link_speed = IXGBE_LINK_SPEED_10GB_FULL;
41224123

4123-
/* If we already have link at this speed, just jump out */
4124-
status = hw->mac.ops.check_link(hw, &link_speed, &link_up,
4125-
false);
4126-
if (status)
4127-
return status;
4128-
4129-
if (link_speed == IXGBE_LINK_SPEED_10GB_FULL && link_up)
4130-
goto out;
4131-
41324124
/* Set the module link speed */
41334125
switch (hw->phy.media_type) {
41344126
case ixgbe_media_type_fiber:
@@ -4180,15 +4172,6 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,
41804172
if (highest_link_speed == IXGBE_LINK_SPEED_UNKNOWN)
41814173
highest_link_speed = IXGBE_LINK_SPEED_1GB_FULL;
41824174

4183-
/* If we already have link at this speed, just jump out */
4184-
status = hw->mac.ops.check_link(hw, &link_speed, &link_up,
4185-
false);
4186-
if (status)
4187-
return status;
4188-
4189-
if (link_speed == IXGBE_LINK_SPEED_1GB_FULL && link_up)
4190-
goto out;
4191-
41924175
/* Set the module link speed */
41934176
switch (hw->phy.media_type) {
41944177
case ixgbe_media_type_fiber:
@@ -4295,4 +4278,23 @@ void ixgbe_set_soft_rate_select_speed(struct ixgbe_hw *hw,
42954278
hw_dbg(hw, "Failed to write Rx Rate Select RS0\n");
42964279
return;
42974280
}
4281+
4282+
/* Set RS1 */
4283+
status = hw->phy.ops.read_i2c_byte(hw, IXGBE_SFF_SFF_8472_ESCB,
4284+
IXGBE_I2C_EEPROM_DEV_ADDR2,
4285+
&eeprom_data);
4286+
if (status) {
4287+
hw_dbg(hw, "Failed to read Rx Rate Select RS1\n");
4288+
return;
4289+
}
4290+
4291+
eeprom_data = (eeprom_data & ~IXGBE_SFF_SOFT_RS_SELECT_MASK) | rs;
4292+
4293+
status = hw->phy.ops.write_i2c_byte(hw, IXGBE_SFF_SFF_8472_ESCB,
4294+
IXGBE_I2C_EEPROM_DEV_ADDR2,
4295+
eeprom_data);
4296+
if (status) {
4297+
hw_dbg(hw, "Failed to write Rx Rate Select RS1\n");
4298+
return;
4299+
}
42984300
}

drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2254,6 +2254,9 @@ static int ixgbe_set_phys_id(struct net_device *netdev,
22542254
struct ixgbe_adapter *adapter = netdev_priv(netdev);
22552255
struct ixgbe_hw *hw = &adapter->hw;
22562256

2257+
if (!hw->mac.ops.led_on || !hw->mac.ops.led_off)
2258+
return -EOPNOTSUPP;
2259+
22572260
switch (state) {
22582261
case ETHTOOL_ID_ACTIVE:
22592262
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,
26652668
*flow_type = IXGBE_ATR_FLOW_TYPE_IPV4;
26662669
break;
26672670
}
2671+
/* fall through */
26682672
default:
26692673
return 0;
26702674
}

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 31 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
#include <net/tc_act/tc_gact.h>
5959
#include <net/tc_act/tc_mirred.h>
6060
#include <net/vxlan.h>
61+
#include <net/mpls.h>
6162

6263
#include "ixgbe.h"
6364
#include "ixgbe_common.h"
@@ -1451,7 +1452,7 @@ static int __ixgbe_notify_dca(struct device *dev, void *data)
14511452
IXGBE_DCA_CTRL_DCA_MODE_CB2);
14521453
break;
14531454
}
1454-
/* Fall Through since DCA is disabled. */
1455+
/* fall through - DCA is disabled. */
14551456
case DCA_PROVIDER_REMOVE:
14561457
if (adapter->flags & IXGBE_FLAG_DCA_ENABLED) {
14571458
dca_remove_requester(dev);
@@ -2232,6 +2233,7 @@ static struct sk_buff *ixgbe_run_xdp(struct ixgbe_adapter *adapter,
22322233
break;
22332234
default:
22342235
bpf_warn_invalid_xdp_action(act);
2236+
/* fallthrough */
22352237
case XDP_ABORTED:
22362238
trace_xdp_exception(rx_ring->netdev, xdp_prog, act);
22372239
/* fallthrough -- handle aborts by dropping packet */
@@ -2638,8 +2640,7 @@ static void ixgbe_check_overtemp_subtask(struct ixgbe_adapter *adapter)
26382640
if (test_bit(__IXGBE_DOWN, &adapter->state))
26392641
return;
26402642

2641-
if (!(adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_CAPABLE) &&
2642-
!(adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_EVENT))
2643+
if (!(adapter->flags2 & IXGBE_FLAG2_TEMP_SENSOR_EVENT))
26432644
return;
26442645

26452646
adapter->flags2 &= ~IXGBE_FLAG2_TEMP_SENSOR_EVENT;
@@ -3105,23 +3106,23 @@ int ixgbe_poll(struct napi_struct *napi, int budget)
31053106
static int ixgbe_request_msix_irqs(struct ixgbe_adapter *adapter)
31063107
{
31073108
struct net_device *netdev = adapter->netdev;
3109+
unsigned int ri = 0, ti = 0;
31083110
int vector, err;
3109-
int ri = 0, ti = 0;
31103111

31113112
for (vector = 0; vector < adapter->num_q_vectors; vector++) {
31123113
struct ixgbe_q_vector *q_vector = adapter->q_vector[vector];
31133114
struct msix_entry *entry = &adapter->msix_entries[vector];
31143115

31153116
if (q_vector->tx.ring && q_vector->rx.ring) {
3116-
snprintf(q_vector->name, sizeof(q_vector->name) - 1,
3117-
"%s-%s-%d", netdev->name, "TxRx", ri++);
3117+
snprintf(q_vector->name, sizeof(q_vector->name),
3118+
"%s-TxRx-%u", netdev->name, ri++);
31183119
ti++;
31193120
} else if (q_vector->rx.ring) {
3120-
snprintf(q_vector->name, sizeof(q_vector->name) - 1,
3121-
"%s-%s-%d", netdev->name, "rx", ri++);
3121+
snprintf(q_vector->name, sizeof(q_vector->name),
3122+
"%s-rx-%u", netdev->name, ri++);
31223123
} else if (q_vector->tx.ring) {
3123-
snprintf(q_vector->name, sizeof(q_vector->name) - 1,
3124-
"%s-%s-%d", netdev->name, "tx", ti++);
3124+
snprintf(q_vector->name, sizeof(q_vector->name),
3125+
"%s-tx-%u", netdev->name, ti++);
31253126
} else {
31263127
/* skip this unused q_vector */
31273128
continue;
@@ -3802,6 +3803,9 @@ static void ixgbe_setup_mrqc(struct ixgbe_adapter *adapter)
38023803
mrqc = IXGBE_MRQC_VMDQRSS32EN;
38033804
else
38043805
mrqc = IXGBE_MRQC_VMDQRSS64EN;
3806+
3807+
/* Enable L3/L4 for Tx Switched packets */
3808+
mrqc |= IXGBE_MRQC_L3L4TXSWEN;
38053809
} else {
38063810
if (tcs > 4)
38073811
mrqc = IXGBE_MRQC_RTRSS8TCEN;
@@ -4174,7 +4178,7 @@ static void ixgbe_setup_rdrxctl(struct ixgbe_adapter *adapter)
41744178
case ixgbe_mac_x550em_a:
41754179
if (adapter->num_vfs)
41764180
rdrxctl |= IXGBE_RDRXCTL_PSP;
4177-
/* fall through for older HW */
4181+
/* fall through */
41784182
case ixgbe_mac_82599EB:
41794183
case ixgbe_mac_X540:
41804184
/* Disable RSC for ACK packets */
@@ -6183,8 +6187,6 @@ int ixgbe_setup_tx_resources(struct ixgbe_ring *tx_ring)
61836187
if (!tx_ring->tx_buffer_info)
61846188
goto err;
61856189

6186-
u64_stats_init(&tx_ring->syncp);
6187-
61886190
/* round up to nearest 4K */
61896191
tx_ring->size = tx_ring->count * sizeof(union ixgbe_adv_tx_desc);
61906192
tx_ring->size = ALIGN(tx_ring->size, 4096);
@@ -6278,8 +6280,6 @@ int ixgbe_setup_rx_resources(struct ixgbe_adapter *adapter,
62786280
if (!rx_ring->rx_buffer_info)
62796281
goto err;
62806282

6281-
u64_stats_init(&rx_ring->syncp);
6282-
62836283
/* Round up to nearest 4K */
62846284
rx_ring->size = rx_ring->count * sizeof(union ixgbe_adv_rx_desc);
62856285
rx_ring->size = ALIGN(rx_ring->size, 4096);
@@ -6886,6 +6886,7 @@ void ixgbe_update_stats(struct ixgbe_adapter *adapter)
68866886
hwstats->o2bspc += IXGBE_READ_REG(hw, IXGBE_O2BSPC);
68876887
hwstats->b2ospc += IXGBE_READ_REG(hw, IXGBE_B2OSPC);
68886888
hwstats->b2ogprc += IXGBE_READ_REG(hw, IXGBE_B2OGPRC);
6889+
/* fall through */
68896890
case ixgbe_mac_82599EB:
68906891
for (i = 0; i < 16; i++)
68916892
adapter->hw_rx_no_dma_resources +=
@@ -7667,7 +7668,10 @@ static int ixgbe_tso(struct ixgbe_ring *tx_ring,
76677668
if (err < 0)
76687669
return err;
76697670

7670-
ip.hdr = skb_network_header(skb);
7671+
if (eth_p_mpls(first->protocol))
7672+
ip.hdr = skb_inner_network_header(skb);
7673+
else
7674+
ip.hdr = skb_network_header(skb);
76717675
l4.hdr = skb_checksum_start(skb);
76727676

76737677
/* ADV DTYP TUCMD MKRLOC/ISCSIHEDLEN */
@@ -8205,6 +8209,7 @@ static u16 ixgbe_select_queue(struct net_device *dev, struct sk_buff *skb,
82058209

82068210
if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED)
82078211
break;
8212+
/* fall through */
82088213
default:
82098214
return fallback(dev, skb);
82108215
}
@@ -9929,6 +9934,7 @@ bool ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id,
99299934
/* only support first port */
99309935
if (hw->bus.func != 0)
99319936
break;
9937+
/* fall through */
99329938
case IXGBE_SUBDEV_ID_82599_SP_560FLR:
99339939
case IXGBE_SUBDEV_ID_82599_SFP:
99349940
case IXGBE_SUBDEV_ID_82599_RNDC:
@@ -10191,7 +10197,11 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1019110197

1019210198
netdev->vlan_features |= netdev->features | NETIF_F_TSO_MANGLEID;
1019310199
netdev->hw_enc_features |= netdev->vlan_features;
10194-
netdev->mpls_features |= NETIF_F_HW_CSUM;
10200+
netdev->mpls_features |= NETIF_F_SG |
10201+
NETIF_F_TSO |
10202+
NETIF_F_TSO6 |
10203+
NETIF_F_HW_CSUM;
10204+
netdev->mpls_features |= IXGBE_GSO_PARTIAL_FEATURES;
1019510205

1019610206
/* set this bit last since it cannot be part of vlan_features */
1019710207
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)
1027510285
if (err)
1027610286
goto err_sw_init;
1027710287

10288+
for (i = 0; i < adapter->num_rx_queues; i++)
10289+
u64_stats_init(&adapter->rx_ring[i]->syncp);
10290+
for (i = 0; i < adapter->num_tx_queues; i++)
10291+
u64_stats_init(&adapter->tx_ring[i]->syncp);
1027810292
for (i = 0; i < adapter->num_xdp_queues; i++)
1027910293
u64_stats_init(&adapter->xdp_ring[i]->syncp);
1028010294

drivers/net/ethernet/intel/ixgbe/ixgbe_phy.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,9 @@
8484
#define IXGBE_CS4227_GLOBAL_ID_LSB 0
8585
#define IXGBE_CS4227_GLOBAL_ID_MSB 1
8686
#define IXGBE_CS4227_SCRATCH 2
87-
#define IXGBE_CS4223_PHY_ID 0x7003 /* Quad port */
88-
#define IXGBE_CS4227_PHY_ID 0x3003 /* Dual port */
87+
#define IXGBE_CS4227_EFUSE_PDF_SKU 0x19F
88+
#define IXGBE_CS4223_SKU_ID 0x0010 /* Quad port */
89+
#define IXGBE_CS4227_SKU_ID 0x0014 /* Dual port */
8990
#define IXGBE_CS4227_RESET_PENDING 0x1357
9091
#define IXGBE_CS4227_RESET_COMPLETE 0x5AA5
9192
#define IXGBE_CS4227_RETRIES 15

0 commit comments

Comments
 (0)