Skip to content

Commit 2c1f9e2

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/next-queue
Jeff Kirsher says: ==================== 100GbE Intel Wired LAN Driver Updates 2019-09-03 This series contains updates to ice driver only. Anirudh adds the ability for the driver to handle EMP resets correctly by adding the logic to the existing ice_reset_subtask(). Jeb fixes up the logic to properly free up the resources for a switch rule whether or not it was successful in the removal. Brett fixes up the reporting of ITR values to let the user know odd ITR values are not allowed. Fixes the driver to only disable VLAN pruning on VLAN deletion when the VLAN being deleted is the last VLAN on the VF VSI. Chinh updates the driver to determine the TSA value from the priority value when in CEE mode. Bruce aligns the driver with the hardware specification by ensuring that a PF reset is done as part of the unload logic. Also update the driver unloading field, based on the latest hardware specification, which allows us to remove an unnecessary endian conversion. Moves #defines based on their need in the code. Jesse adds the current state of auto-negotiation in the link up message. In addition, adds additional information to inform the user of an issue with the topology/configuration of the link. Usha updates the driver to allow the maximum TCs that the firmware supports, rather than hard coding to a set value. Dave updates the DCB initialization flow to handle the case of an actual error during DCB init. Updated the driver to report the current stats, even when the netdev is down, which aligns with our other drivers. Mitch fixes the VF reset code flows to ensure that it properly calls ice_dis_vsi_txq() to notify the firmware that the VF is being reset. Michal fixes the driver so the DCB is not enabled when the SW LLDP is activated, which was causing a communication issue with other NICs. The problem lies in that DCB was being enabled without checking the number of TCs. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
2 parents 94810bd + cd186e5 commit 2c1f9e2

File tree

9 files changed

+144
-74
lines changed

9 files changed

+144
-74
lines changed

drivers/net/ethernet/intel/ice/ice_adminq_cmd.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ struct ice_aqc_get_ver {
3535

3636
/* Queue Shutdown (direct 0x0003) */
3737
struct ice_aqc_q_shutdown {
38-
__le32 driver_unloading;
38+
u8 driver_unloading;
3939
#define ICE_AQC_DRIVER_UNLOADING BIT(0)
40-
u8 reserved[12];
40+
u8 reserved[15];
4141
};
4242

4343
/* Request resource ownership (direct 0x0008)
@@ -91,6 +91,7 @@ struct ice_aqc_list_caps_elem {
9191
#define ICE_AQC_CAPS_SRIOV 0x0012
9292
#define ICE_AQC_CAPS_VF 0x0013
9393
#define ICE_AQC_CAPS_VSI 0x0017
94+
#define ICE_AQC_CAPS_DCB 0x0018
9495
#define ICE_AQC_CAPS_RSS 0x0040
9596
#define ICE_AQC_CAPS_RXQS 0x0041
9697
#define ICE_AQC_CAPS_TXQS 0x0042

drivers/net/ethernet/intel/ice/ice_common.c

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1275,7 +1275,7 @@ enum ice_status ice_aq_q_shutdown(struct ice_hw *hw, bool unloading)
12751275
ice_fill_dflt_direct_cmd_desc(&desc, ice_aqc_opc_q_shutdown);
12761276

12771277
if (unloading)
1278-
cmd->driver_unloading = cpu_to_le32(ICE_AQC_DRIVER_UNLOADING);
1278+
cmd->driver_unloading = ICE_AQC_DRIVER_UNLOADING;
12791279

12801280
return ice_aq_send_cmd(hw, &desc, NULL, 0, NULL);
12811281
}
@@ -1594,6 +1594,18 @@ ice_parse_caps(struct ice_hw *hw, void *buf, u32 cap_count,
15941594
prefix, func_p->guar_num_vsi);
15951595
}
15961596
break;
1597+
case ICE_AQC_CAPS_DCB:
1598+
caps->dcb = (number == 1);
1599+
caps->active_tc_bitmap = logical_id;
1600+
caps->maxtc = phys_id;
1601+
ice_debug(hw, ICE_DBG_INIT,
1602+
"%s: DCB = %d\n", prefix, caps->dcb);
1603+
ice_debug(hw, ICE_DBG_INIT,
1604+
"%s: active TC bitmap = %d\n", prefix,
1605+
caps->active_tc_bitmap);
1606+
ice_debug(hw, ICE_DBG_INIT,
1607+
"%s: TC max = %d\n", prefix, caps->maxtc);
1608+
break;
15971609
case ICE_AQC_CAPS_RSS:
15981610
caps->rss_table_size = number;
15991611
caps->rss_table_entry_width = logical_id;

drivers/net/ethernet/intel/ice/ice_dcb.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,9 +444,15 @@ ice_parse_cee_pgcfg_tlv(struct ice_cee_feat_tlv *tlv,
444444
* |pg0|pg1|pg2|pg3|pg4|pg5|pg6|pg7|
445445
* ---------------------------------
446446
*/
447-
ice_for_each_traffic_class(i)
447+
ice_for_each_traffic_class(i) {
448448
etscfg->tcbwtable[i] = buf[offset++];
449449

450+
if (etscfg->prio_table[i] == ICE_CEE_PGID_STRICT)
451+
dcbcfg->etscfg.tsatable[i] = ICE_IEEE_TSA_STRICT;
452+
else
453+
dcbcfg->etscfg.tsatable[i] = ICE_IEEE_TSA_ETS;
454+
}
455+
450456
/* Number of TCs supported (1 octet) */
451457
etscfg->maxtcs = buf[offset];
452458
}

drivers/net/ethernet/intel/ice/ice_dcb_lib.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ static int ice_dcb_sw_dflt_cfg(struct ice_pf *pf, bool locked)
413413
memset(&pi->local_dcbx_cfg, 0, sizeof(*dcbcfg));
414414

415415
dcbcfg->etscfg.willing = 1;
416-
dcbcfg->etscfg.maxtcs = 8;
416+
dcbcfg->etscfg.maxtcs = hw->func_caps.common_cap.maxtc;
417417
dcbcfg->etscfg.tcbwtable[0] = 100;
418418
dcbcfg->etscfg.tsatable[0] = ICE_IEEE_TSA_ETS;
419419

@@ -422,7 +422,7 @@ static int ice_dcb_sw_dflt_cfg(struct ice_pf *pf, bool locked)
422422
dcbcfg->etsrec.willing = 0;
423423

424424
dcbcfg->pfc.willing = 1;
425-
dcbcfg->pfc.pfccap = IEEE_8021QAZ_MAX_TCS;
425+
dcbcfg->pfc.pfccap = hw->func_caps.common_cap.maxtc;
426426

427427
dcbcfg->numapps = 1;
428428
dcbcfg->app[0].selector = ICE_APP_SEL_ETHTYPE;
@@ -452,11 +452,18 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)
452452
port_info = hw->port_info;
453453

454454
err = ice_init_dcb(hw);
455+
if (err && !port_info->is_sw_lldp) {
456+
dev_err(&pf->pdev->dev, "Error initializing DCB %d\n", err);
457+
goto dcb_init_err;
458+
}
459+
460+
dev_info(&pf->pdev->dev,
461+
"DCB is enabled in the hardware, max number of TCs supported on this port are %d\n",
462+
pf->hw.func_caps.common_cap.maxtc);
455463
if (err) {
456464
/* FW LLDP is disabled, activate SW DCBX/LLDP mode */
457465
dev_info(&pf->pdev->dev,
458466
"FW LLDP is disabled, DCBx/LLDP in SW mode.\n");
459-
port_info->is_sw_lldp = true;
460467
clear_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags);
461468
err = ice_dcb_sw_dflt_cfg(pf, locked);
462469
if (err) {
@@ -468,11 +475,9 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)
468475

469476
pf->dcbx_cap = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE;
470477
set_bit(ICE_FLAG_DCB_CAPABLE, pf->flags);
471-
set_bit(ICE_FLAG_DCB_ENA, pf->flags);
472478
return 0;
473479
}
474480

475-
port_info->is_sw_lldp = false;
476481
set_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags);
477482

478483
/* DCBX in FW and LLDP enabled in FW */
@@ -484,7 +489,6 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)
484489
if (err)
485490
goto dcb_init_err;
486491

487-
dev_info(&pf->pdev->dev, "DCBX offload supported\n");
488492
return err;
489493

490494
dcb_init_err:

drivers/net/ethernet/intel/ice/ice_ethtool.c

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3253,86 +3253,86 @@ static int
32533253
ice_set_rc_coalesce(enum ice_container_type c_type, struct ethtool_coalesce *ec,
32543254
struct ice_ring_container *rc, struct ice_vsi *vsi)
32553255
{
3256+
const char *c_type_str = (c_type == ICE_RX_CONTAINER) ? "rx" : "tx";
3257+
u32 use_adaptive_coalesce, coalesce_usecs;
32563258
struct ice_pf *pf = vsi->back;
32573259
u16 itr_setting;
32583260

32593261
if (!rc->ring)
32603262
return -EINVAL;
32613263

3262-
itr_setting = rc->itr_setting & ~ICE_ITR_DYNAMIC;
3263-
32643264
switch (c_type) {
32653265
case ICE_RX_CONTAINER:
32663266
if (ec->rx_coalesce_usecs_high > ICE_MAX_INTRL ||
32673267
(ec->rx_coalesce_usecs_high &&
32683268
ec->rx_coalesce_usecs_high < pf->hw.intrl_gran)) {
32693269
netdev_info(vsi->netdev,
3270-
"Invalid value, rx-usecs-high valid values are 0 (disabled), %d-%d\n",
3271-
pf->hw.intrl_gran, ICE_MAX_INTRL);
3270+
"Invalid value, %s-usecs-high valid values are 0 (disabled), %d-%d\n",
3271+
c_type_str, pf->hw.intrl_gran,
3272+
ICE_MAX_INTRL);
32723273
return -EINVAL;
32733274
}
3274-
32753275
if (ec->rx_coalesce_usecs_high != rc->ring->q_vector->intrl) {
32763276
rc->ring->q_vector->intrl = ec->rx_coalesce_usecs_high;
32773277
wr32(&pf->hw, GLINT_RATE(rc->ring->q_vector->reg_idx),
32783278
ice_intrl_usec_to_reg(ec->rx_coalesce_usecs_high,
32793279
pf->hw.intrl_gran));
32803280
}
32813281

3282-
if (ec->rx_coalesce_usecs != itr_setting &&
3283-
ec->use_adaptive_rx_coalesce) {
3284-
netdev_info(vsi->netdev,
3285-
"Rx interrupt throttling cannot be changed if adaptive-rx is enabled\n");
3286-
return -EINVAL;
3287-
}
3282+
use_adaptive_coalesce = ec->use_adaptive_rx_coalesce;
3283+
coalesce_usecs = ec->rx_coalesce_usecs;
32883284

3289-
if (ec->rx_coalesce_usecs > ICE_ITR_MAX) {
3290-
netdev_info(vsi->netdev,
3291-
"Invalid value, rx-usecs range is 0-%d\n",
3292-
ICE_ITR_MAX);
3293-
return -EINVAL;
3294-
}
3295-
3296-
if (ec->use_adaptive_rx_coalesce) {
3297-
rc->itr_setting |= ICE_ITR_DYNAMIC;
3298-
} else {
3299-
rc->itr_setting = ITR_REG_ALIGN(ec->rx_coalesce_usecs);
3300-
rc->target_itr = ITR_TO_REG(rc->itr_setting);
3301-
}
33023285
break;
33033286
case ICE_TX_CONTAINER:
33043287
if (ec->tx_coalesce_usecs_high) {
33053288
netdev_info(vsi->netdev,
3306-
"setting tx-usecs-high is not supported\n");
3307-
return -EINVAL;
3308-
}
3309-
3310-
if (ec->tx_coalesce_usecs != itr_setting &&
3311-
ec->use_adaptive_tx_coalesce) {
3312-
netdev_info(vsi->netdev,
3313-
"Tx interrupt throttling cannot be changed if adaptive-tx is enabled\n");
3289+
"setting %s-usecs-high is not supported\n",
3290+
c_type_str);
33143291
return -EINVAL;
33153292
}
33163293

3317-
if (ec->tx_coalesce_usecs > ICE_ITR_MAX) {
3318-
netdev_info(vsi->netdev,
3319-
"Invalid value, tx-usecs range is 0-%d\n",
3320-
ICE_ITR_MAX);
3321-
return -EINVAL;
3322-
}
3294+
use_adaptive_coalesce = ec->use_adaptive_tx_coalesce;
3295+
coalesce_usecs = ec->tx_coalesce_usecs;
33233296

3324-
if (ec->use_adaptive_tx_coalesce) {
3325-
rc->itr_setting |= ICE_ITR_DYNAMIC;
3326-
} else {
3327-
rc->itr_setting = ITR_REG_ALIGN(ec->tx_coalesce_usecs);
3328-
rc->target_itr = ITR_TO_REG(rc->itr_setting);
3329-
}
33303297
break;
33313298
default:
33323299
dev_dbg(&pf->pdev->dev, "Invalid container type %d\n", c_type);
33333300
return -EINVAL;
33343301
}
33353302

3303+
itr_setting = rc->itr_setting & ~ICE_ITR_DYNAMIC;
3304+
if (coalesce_usecs != itr_setting && use_adaptive_coalesce) {
3305+
netdev_info(vsi->netdev,
3306+
"%s interrupt throttling cannot be changed if adaptive-%s is enabled\n",
3307+
c_type_str, c_type_str);
3308+
return -EINVAL;
3309+
}
3310+
3311+
if (coalesce_usecs > ICE_ITR_MAX) {
3312+
netdev_info(vsi->netdev,
3313+
"Invalid value, %s-usecs range is 0-%d\n",
3314+
c_type_str, ICE_ITR_MAX);
3315+
return -EINVAL;
3316+
}
3317+
3318+
/* hardware only supports an ITR granularity of 2us */
3319+
if (coalesce_usecs % 2 != 0) {
3320+
netdev_info(vsi->netdev,
3321+
"Invalid value, %s-usecs must be even\n",
3322+
c_type_str);
3323+
return -EINVAL;
3324+
}
3325+
3326+
if (use_adaptive_coalesce) {
3327+
rc->itr_setting |= ICE_ITR_DYNAMIC;
3328+
} else {
3329+
/* store user facing value how it was set */
3330+
rc->itr_setting = coalesce_usecs;
3331+
/* set to static and convert to value HW understands */
3332+
rc->target_itr =
3333+
ITR_TO_REG(ITR_REG_ALIGN(rc->itr_setting));
3334+
}
3335+
33363336
return 0;
33373337
}
33383338

drivers/net/ethernet/intel/ice/ice_main.c

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,8 @@ static void ice_reset_subtask(struct ice_pf *pf)
567567
reset_type = ICE_RESET_CORER;
568568
if (test_and_clear_bit(__ICE_GLOBR_RECV, pf->state))
569569
reset_type = ICE_RESET_GLOBR;
570+
if (test_and_clear_bit(__ICE_EMPR_RECV, pf->state))
571+
reset_type = ICE_RESET_EMPR;
570572
/* return if no valid reset type requested */
571573
if (reset_type == ICE_RESET_INVAL)
572574
return;
@@ -611,6 +613,22 @@ static void ice_reset_subtask(struct ice_pf *pf)
611613
}
612614
}
613615

616+
/**
617+
* ice_print_topo_conflict - print topology conflict message
618+
* @vsi: the VSI whose topology status is being checked
619+
*/
620+
static void ice_print_topo_conflict(struct ice_vsi *vsi)
621+
{
622+
switch (vsi->port_info->phy.link_info.topo_media_conflict) {
623+
case ICE_AQ_LINK_TOPO_CONFLICT:
624+
case ICE_AQ_LINK_MEDIA_CONFLICT:
625+
netdev_info(vsi->netdev, "Possible mis-configuration of the Ethernet port detected, please use the Intel(R) Ethernet Port Configuration Tool application to address the issue.\n");
626+
break;
627+
default:
628+
break;
629+
}
630+
}
631+
614632
/**
615633
* ice_print_link_msg - print link up or down message
616634
* @vsi: the VSI whose link status is being queried
@@ -624,6 +642,7 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup)
624642
const char *speed;
625643
const char *fec;
626644
const char *fc;
645+
const char *an;
627646

628647
if (!vsi)
629648
return;
@@ -707,6 +726,12 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup)
707726
break;
708727
}
709728

729+
/* check if autoneg completed, might be false due to not supported */
730+
if (vsi->port_info->phy.link_info.an_info & ICE_AQ_AN_COMPLETED)
731+
an = "True";
732+
else
733+
an = "False";
734+
710735
/* Get FEC mode requested based on PHY caps last SW configuration */
711736
caps = devm_kzalloc(&vsi->back->pdev->dev, sizeof(*caps), GFP_KERNEL);
712737
if (!caps) {
@@ -731,8 +756,9 @@ void ice_print_link_msg(struct ice_vsi *vsi, bool isup)
731756
devm_kfree(&vsi->back->pdev->dev, caps);
732757

733758
done:
734-
netdev_info(vsi->netdev, "NIC Link is up %sbps, Requested FEC: %s, FEC: %s, Flow Control: %s\n",
735-
speed, fec_req, fec, fc);
759+
netdev_info(vsi->netdev, "NIC Link is up %sbps, Requested FEC: %s, FEC: %s, Autoneg: %s, Flow Control: %s\n",
760+
speed, fec_req, fec, an, fc);
761+
ice_print_topo_conflict(vsi);
736762
}
737763

738764
/**
@@ -2636,6 +2662,11 @@ static void ice_remove(struct pci_dev *pdev)
26362662
ice_deinit_pf(pf);
26372663
ice_deinit_hw(&pf->hw);
26382664
ice_clear_interrupt_scheme(pf);
2665+
/* Issue a PFR as part of the prescribed driver unload flow. Do not
2666+
* do it via ice_schedule_reset() since there is no need to rebuild
2667+
* and the service task is already stopped.
2668+
*/
2669+
ice_reset(&pf->hw, ICE_RESET_PFR);
26392670
pci_disable_pcie_error_reporting(pdev);
26402671
}
26412672

@@ -3446,12 +3477,16 @@ void ice_get_stats64(struct net_device *netdev, struct rtnl_link_stats64 *stats)
34463477

34473478
vsi_stats = &vsi->net_stats;
34483479

3449-
if (test_bit(__ICE_DOWN, vsi->state) || !vsi->num_txq || !vsi->num_rxq)
3480+
if (!vsi->num_txq || !vsi->num_rxq)
34503481
return;
3482+
34513483
/* netdev packet/byte stats come from ring counter. These are obtained
34523484
* by summing up ring counters (done by ice_update_vsi_ring_stats).
3485+
* But, only call the update routine and read the registers if VSI is
3486+
* not down.
34533487
*/
3454-
ice_update_vsi_ring_stats(vsi);
3488+
if (!test_bit(__ICE_DOWN, vsi->state))
3489+
ice_update_vsi_ring_stats(vsi);
34553490
stats->tx_packets = vsi_stats->tx_packets;
34563491
stats->tx_bytes = vsi_stats->tx_bytes;
34573492
stats->rx_packets = vsi_stats->rx_packets;

drivers/net/ethernet/intel/ice/ice_switch.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,12 +1623,13 @@ ice_remove_rule_internal(struct ice_hw *hw, u8 recp_id,
16231623
status = ice_aq_sw_rules(hw, s_rule,
16241624
ICE_SW_RULE_RX_TX_NO_HDR_SIZE, 1,
16251625
ice_aqc_opc_remove_sw_rules, NULL);
1626-
if (status)
1627-
goto exit;
16281626

16291627
/* Remove a book keeping from the list */
16301628
devm_kfree(ice_hw_to_dev(hw), s_rule);
16311629

1630+
if (status)
1631+
goto exit;
1632+
16321633
list_del(&list_elem->list_entry);
16331634
devm_kfree(ice_hw_to_dev(hw), list_elem);
16341635
}

drivers/net/ethernet/intel/ice/ice_type.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@
44
#ifndef _ICE_TYPE_H_
55
#define _ICE_TYPE_H_
66

7+
#define ICE_BYTES_PER_WORD 2
8+
#define ICE_BYTES_PER_DWORD 4
9+
710
#include "ice_status.h"
811
#include "ice_hw_autogen.h"
912
#include "ice_osdep.h"
1013
#include "ice_controlq.h"
1114
#include "ice_lan_tx_rx.h"
1215

13-
#define ICE_BYTES_PER_WORD 2
14-
#define ICE_BYTES_PER_DWORD 4
15-
1616
static inline bool ice_is_tc_ena(unsigned long bitmap, u8 tc)
1717
{
1818
return test_bit(tc, &bitmap);
@@ -139,6 +139,9 @@ struct ice_phy_info {
139139
/* Common HW capabilities for SW use */
140140
struct ice_hw_common_caps {
141141
u32 valid_functions;
142+
/* DCB capabilities */
143+
u32 active_tc_bitmap;
144+
u32 maxtc;
142145

143146
/* Tx/Rx queues */
144147
u16 num_rxq; /* Number/Total Rx queues */

0 commit comments

Comments
 (0)