Skip to content

Commit

Permalink
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/gi…
Browse files Browse the repository at this point in the history
…t/jkirsher/next-queue

Jeff Kirsher says:

====================
100GbE Intel Wired LAN Driver Updates 2019-02-22

This series contains updates to the ice driver only.

Bruce adds the __always_unused attribute to a parameter to avoid
compiler warnings when using -Wunused-parameter.  Fixed unnecessary
type-casting and the use of sizeof().  Fix the allocation of structs
that have become memory hogs, so allocate them in heaps and fix all the
associated references.  Fixed the "possible" numeric overflow issues
that were caught with static analysis.

Maciej fixes the maximum MTU calculation by taking into account double
VLAN tagging amd ensure that the operations are done in the correct
order.

Victor fixes the supported node calculation, where we were not taking
into account if there is space to add the new VSI or intermediate node
above that layer, then it is not required to continue the calculation.
Added a check for a leaf node presence for a given VSI, which is needed
before removing a VSI.

Jake fixes an issue where the VSI list is shared, so simply removing a
VSI from the list will cause issues for the other users who reference
the list.  Since we also free the memory, this could lead to
segmentation faults.

Brett fixes an issue where driver unload could cause a system reboot
when intel_iommu=on parameter is set.  The issue is that we are not
clearing the CAUSE_ENA bit for the appropriate control queues register
when freeing the miscellaneous interrupt vector.

Mitch is so kind, he prevented spamming the VF with link messages when
the link status really has not changed.  Updates the driver to use the
absolute vector ID and not the per-PF vector ID for the VF MSIx vector
allocation.

Lukasz fixes the ethtool pause parameter for the ice driver, which was
originally based off the link status but is now based off the PHY
configuration.  This is to resolve an issue where pause parameters could
be set while link was down.

Jesse updates the string that reports statistics so the string does not
get modified at runtime and cause reports of string truncation.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Feb 25, 2019
2 parents ace4a26 + 1fa6e13 commit a0392ab
Show file tree
Hide file tree
Showing 12 changed files with 364 additions and 199 deletions.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/intel/ice/ice.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ extern const char ice_drv_ver[];
#define ICE_DFLT_NETIF_M (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_LINK)

#define ICE_MAX_MTU (ICE_AQ_SET_MAC_FRAME_SIZE_MAX - \
ETH_HLEN + ETH_FCS_LEN + VLAN_HLEN)
(ETH_HLEN + ETH_FCS_LEN + (VLAN_HLEN * 2)))

#define ICE_UP_TABLE_TRANSLATE(val, i) \
(((val) << ICE_AQ_VSI_UP_TABLE_UP##i##_S) & \
Expand Down
21 changes: 19 additions & 2 deletions drivers/net/ethernet/intel/ice/ice_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -2450,6 +2450,7 @@ ice_aq_dis_lan_txq(struct ice_hw *hw, u8 num_qgrps,
{
struct ice_aqc_dis_txqs *cmd;
struct ice_aq_desc desc;
enum ice_status status;
u16 i, sz = 0;

cmd = &desc.params.dis_txqs;
Expand Down Expand Up @@ -2485,6 +2486,8 @@ ice_aq_dis_lan_txq(struct ice_hw *hw, u8 num_qgrps,
break;
}

/* flush pipe on time out */
cmd->cmd_type |= ICE_AQC_Q_DIS_CMD_FLUSH_PIPE;
/* If no queue group info, we are in a reset flow. Issue the AQ */
if (!qg_list)
goto do_aq;
Expand All @@ -2510,7 +2513,17 @@ ice_aq_dis_lan_txq(struct ice_hw *hw, u8 num_qgrps,
return ICE_ERR_PARAM;

do_aq:
return ice_aq_send_cmd(hw, &desc, qg_list, buf_size, cd);
status = ice_aq_send_cmd(hw, &desc, qg_list, buf_size, cd);
if (status) {
if (!qg_list)
ice_debug(hw, ICE_DBG_SCHED, "VM%d disable failed %d\n",
vmvf_num, hw->adminq.sq_last_status);
else
ice_debug(hw, ICE_DBG_SCHED, "disable Q %d failed %d\n",
le16_to_cpu(qg_list[0].q_id[0]),
hw->adminq.sq_last_status);
}
return status;
}

/* End of FW Admin Queue command wrappers */
Expand Down Expand Up @@ -2796,8 +2809,12 @@ ice_ena_vsi_txq(struct ice_port_info *pi, u16 vsi_handle, u8 tc, u8 num_qgrps,

/* add the lan q */
status = ice_aq_add_lan_txq(hw, num_qgrps, buf, buf_size, cd);
if (status)
if (status) {
ice_debug(hw, ICE_DBG_SCHED, "enable Q %d failed %d\n",
le16_to_cpu(buf->txqs[0].txq_id),
hw->adminq.sq_last_status);
goto ena_txq_exit;
}

node.node_teid = buf->txqs[0].q_teid;
node.data.elem_type = ICE_AQC_ELEM_TYPE_LEAF;
Expand Down
132 changes: 73 additions & 59 deletions drivers/net/ethernet/intel/ice/ice_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,45 +63,45 @@ static const struct ice_stats ice_gstrings_vsi_stats[] = {
* is queried on the base PF netdev.
*/
static const struct ice_stats ice_gstrings_pf_stats[] = {
ICE_PF_STAT("tx_bytes", stats.eth.tx_bytes),
ICE_PF_STAT("rx_bytes", stats.eth.rx_bytes),
ICE_PF_STAT("tx_unicast", stats.eth.tx_unicast),
ICE_PF_STAT("rx_unicast", stats.eth.rx_unicast),
ICE_PF_STAT("tx_multicast", stats.eth.tx_multicast),
ICE_PF_STAT("rx_multicast", stats.eth.rx_multicast),
ICE_PF_STAT("tx_broadcast", stats.eth.tx_broadcast),
ICE_PF_STAT("rx_broadcast", stats.eth.rx_broadcast),
ICE_PF_STAT("tx_errors", stats.eth.tx_errors),
ICE_PF_STAT("tx_size_64", stats.tx_size_64),
ICE_PF_STAT("rx_size_64", stats.rx_size_64),
ICE_PF_STAT("tx_size_127", stats.tx_size_127),
ICE_PF_STAT("rx_size_127", stats.rx_size_127),
ICE_PF_STAT("tx_size_255", stats.tx_size_255),
ICE_PF_STAT("rx_size_255", stats.rx_size_255),
ICE_PF_STAT("tx_size_511", stats.tx_size_511),
ICE_PF_STAT("rx_size_511", stats.rx_size_511),
ICE_PF_STAT("tx_size_1023", stats.tx_size_1023),
ICE_PF_STAT("rx_size_1023", stats.rx_size_1023),
ICE_PF_STAT("tx_size_1522", stats.tx_size_1522),
ICE_PF_STAT("rx_size_1522", stats.rx_size_1522),
ICE_PF_STAT("tx_size_big", stats.tx_size_big),
ICE_PF_STAT("rx_size_big", stats.rx_size_big),
ICE_PF_STAT("link_xon_tx", stats.link_xon_tx),
ICE_PF_STAT("link_xon_rx", stats.link_xon_rx),
ICE_PF_STAT("link_xoff_tx", stats.link_xoff_tx),
ICE_PF_STAT("link_xoff_rx", stats.link_xoff_rx),
ICE_PF_STAT("tx_dropped_link_down", stats.tx_dropped_link_down),
ICE_PF_STAT("rx_undersize", stats.rx_undersize),
ICE_PF_STAT("rx_fragments", stats.rx_fragments),
ICE_PF_STAT("rx_oversize", stats.rx_oversize),
ICE_PF_STAT("rx_jabber", stats.rx_jabber),
ICE_PF_STAT("rx_csum_bad", hw_csum_rx_error),
ICE_PF_STAT("rx_length_errors", stats.rx_len_errors),
ICE_PF_STAT("rx_dropped", stats.eth.rx_discards),
ICE_PF_STAT("rx_crc_errors", stats.crc_errors),
ICE_PF_STAT("illegal_bytes", stats.illegal_bytes),
ICE_PF_STAT("mac_local_faults", stats.mac_local_faults),
ICE_PF_STAT("mac_remote_faults", stats.mac_remote_faults),
ICE_PF_STAT("port.tx_bytes", stats.eth.tx_bytes),
ICE_PF_STAT("port.rx_bytes", stats.eth.rx_bytes),
ICE_PF_STAT("port.tx_unicast", stats.eth.tx_unicast),
ICE_PF_STAT("port.rx_unicast", stats.eth.rx_unicast),
ICE_PF_STAT("port.tx_multicast", stats.eth.tx_multicast),
ICE_PF_STAT("port.rx_multicast", stats.eth.rx_multicast),
ICE_PF_STAT("port.tx_broadcast", stats.eth.tx_broadcast),
ICE_PF_STAT("port.rx_broadcast", stats.eth.rx_broadcast),
ICE_PF_STAT("port.tx_errors", stats.eth.tx_errors),
ICE_PF_STAT("port.tx_size_64", stats.tx_size_64),
ICE_PF_STAT("port.rx_size_64", stats.rx_size_64),
ICE_PF_STAT("port.tx_size_127", stats.tx_size_127),
ICE_PF_STAT("port.rx_size_127", stats.rx_size_127),
ICE_PF_STAT("port.tx_size_255", stats.tx_size_255),
ICE_PF_STAT("port.rx_size_255", stats.rx_size_255),
ICE_PF_STAT("port.tx_size_511", stats.tx_size_511),
ICE_PF_STAT("port.rx_size_511", stats.rx_size_511),
ICE_PF_STAT("port.tx_size_1023", stats.tx_size_1023),
ICE_PF_STAT("port.rx_size_1023", stats.rx_size_1023),
ICE_PF_STAT("port.tx_size_1522", stats.tx_size_1522),
ICE_PF_STAT("port.rx_size_1522", stats.rx_size_1522),
ICE_PF_STAT("port.tx_size_big", stats.tx_size_big),
ICE_PF_STAT("port.rx_size_big", stats.rx_size_big),
ICE_PF_STAT("port.link_xon_tx", stats.link_xon_tx),
ICE_PF_STAT("port.link_xon_rx", stats.link_xon_rx),
ICE_PF_STAT("port.link_xoff_tx", stats.link_xoff_tx),
ICE_PF_STAT("port.link_xoff_rx", stats.link_xoff_rx),
ICE_PF_STAT("port.tx_dropped_link_down", stats.tx_dropped_link_down),
ICE_PF_STAT("port.rx_undersize", stats.rx_undersize),
ICE_PF_STAT("port.rx_fragments", stats.rx_fragments),
ICE_PF_STAT("port.rx_oversize", stats.rx_oversize),
ICE_PF_STAT("port.rx_jabber", stats.rx_jabber),
ICE_PF_STAT("port.rx_csum_bad", hw_csum_rx_error),
ICE_PF_STAT("port.rx_length_errors", stats.rx_len_errors),
ICE_PF_STAT("port.rx_dropped", stats.eth.rx_discards),
ICE_PF_STAT("port.rx_crc_errors", stats.crc_errors),
ICE_PF_STAT("port.illegal_bytes", stats.illegal_bytes),
ICE_PF_STAT("port.mac_local_faults", stats.mac_local_faults),
ICE_PF_STAT("port.mac_remote_faults", stats.mac_remote_faults),
};

static const u32 ice_regs_dump_list[] = {
Expand Down Expand Up @@ -304,7 +304,7 @@ static void ice_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
return;

for (i = 0; i < ICE_PF_STATS_LEN; i++) {
snprintf(p, ETH_GSTRING_LEN, "port.%s",
snprintf(p, ETH_GSTRING_LEN, "%s",
ice_gstrings_pf_stats[i].stat_string);
p += ETH_GSTRING_LEN;
}
Expand Down Expand Up @@ -1084,7 +1084,7 @@ ice_get_settings_link_up(struct ethtool_link_ksettings *ks,
* current PHY type, get what is supported by the NVM and intersect
* them to get what is truly supported
*/
memset(&cap_ksettings, 0, sizeof(struct ethtool_link_ksettings));
memset(&cap_ksettings, 0, sizeof(cap_ksettings));
ice_phy_type_to_ethtool(netdev, &cap_ksettings);
ethtool_intersect_link_masks(ks, &cap_ksettings);

Expand Down Expand Up @@ -1416,7 +1416,7 @@ ice_set_link_ksettings(struct net_device *netdev,
return -EOPNOTSUPP;

/* copy the ksettings to copy_ks to avoid modifying the original */
memcpy(&copy_ks, ks, sizeof(struct ethtool_link_ksettings));
memcpy(&copy_ks, ks, sizeof(copy_ks));

/* save autoneg out of ksettings */
autoneg = copy_ks.base.autoneg;
Expand All @@ -1435,7 +1435,7 @@ ice_set_link_ksettings(struct net_device *netdev,
return -EINVAL;

/* get our own copy of the bits to check against */
memset(&safe_ks, 0, sizeof(struct ethtool_link_ksettings));
memset(&safe_ks, 0, sizeof(safe_ks));
safe_ks.base.cmd = copy_ks.base.cmd;
safe_ks.base.link_mode_masks_nwords =
copy_ks.base.link_mode_masks_nwords;
Expand All @@ -1449,8 +1449,7 @@ ice_set_link_ksettings(struct net_device *netdev,
/* If copy_ks.base and safe_ks.base are not the same now, then they are
* trying to set something that we do not support.
*/
if (memcmp(&copy_ks.base, &safe_ks.base,
sizeof(struct ethtool_link_settings)))
if (memcmp(&copy_ks.base, &safe_ks.base, sizeof(copy_ks.base)))
return -EOPNOTSUPP;

while (test_and_set_bit(__ICE_CFG_BUSY, pf->state)) {
Expand All @@ -1474,7 +1473,7 @@ ice_set_link_ksettings(struct net_device *netdev,
}

/* Copy abilities to config in case autoneg is not set below */
memset(&config, 0, sizeof(struct ice_aqc_set_phy_cfg_data));
memset(&config, 0, sizeof(config));
config.caps = abilities->caps & ~ICE_AQC_PHY_AN_MODE;
if (abilities->caps & ICE_AQC_PHY_AN_MODE)
config.caps |= ICE_AQ_PHY_ENA_AUTO_LINK_UPDT;
Expand Down Expand Up @@ -1668,7 +1667,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)
vsi->tx_rings[0]->count, new_tx_cnt);

tx_rings = devm_kcalloc(&pf->pdev->dev, vsi->alloc_txq,
sizeof(struct ice_ring), GFP_KERNEL);
sizeof(*tx_rings), GFP_KERNEL);
if (!tx_rings) {
err = -ENOMEM;
goto done;
Expand Down Expand Up @@ -1700,7 +1699,7 @@ ice_set_ringparam(struct net_device *netdev, struct ethtool_ringparam *ring)
vsi->rx_rings[0]->count, new_rx_cnt);

rx_rings = devm_kcalloc(&pf->pdev->dev, vsi->alloc_rxq,
sizeof(struct ice_ring), GFP_KERNEL);
sizeof(*rx_rings), GFP_KERNEL);
if (!rx_rings) {
err = -ENOMEM;
goto done;
Expand Down Expand Up @@ -1819,21 +1818,36 @@ static void
ice_get_pauseparam(struct net_device *netdev, struct ethtool_pauseparam *pause)
{
struct ice_netdev_priv *np = netdev_priv(netdev);
struct ice_port_info *pi;
struct ice_port_info *pi = np->vsi->port_info;
struct ice_aqc_get_phy_caps_data *pcaps;
struct ice_vsi *vsi = np->vsi;
enum ice_status status;

pi = np->vsi->port_info;
pause->autoneg =
((pi->phy.link_info.an_info & ICE_AQ_AN_COMPLETED) ?
AUTONEG_ENABLE : AUTONEG_DISABLE);
/* Initialize pause params */
pause->rx_pause = 0;
pause->tx_pause = 0;

if (pi->fc.current_mode == ICE_FC_RX_PAUSE) {
pause->rx_pause = 1;
} else if (pi->fc.current_mode == ICE_FC_TX_PAUSE) {
pcaps = devm_kzalloc(&vsi->back->pdev->dev, sizeof(*pcaps),
GFP_KERNEL);
if (!pcaps)
return;

/* Get current phy config */
status = ice_aq_get_phy_caps(pi, false, ICE_AQC_REPORT_SW_CFG, pcaps,
NULL);
if (status)
goto out;

pause->autoneg = ((pcaps->caps & ICE_AQC_PHY_AN_MODE) ?
AUTONEG_ENABLE : AUTONEG_DISABLE);

if (pcaps->caps & ICE_AQC_PHY_EN_TX_LINK_PAUSE)
pause->tx_pause = 1;
} else if (pi->fc.current_mode == ICE_FC_FULL) {
if (pcaps->caps & ICE_AQC_PHY_EN_RX_LINK_PAUSE)
pause->rx_pause = 1;
pause->tx_pause = 1;
}

out:
devm_kfree(&vsi->back->pdev->dev, pcaps);
}

/**
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ethernet/intel/ice/ice_hw_autogen.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#define PF_FW_ATQLEN_ATQVFE_M BIT(28)
#define PF_FW_ATQLEN_ATQOVFL_M BIT(29)
#define PF_FW_ATQLEN_ATQCRIT_M BIT(30)
#define VF_MBX_ARQLEN(_VF) (0x0022BC00 + ((_VF) * 4))
#define PF_FW_ATQLEN_ATQENABLE_M BIT(31)
#define PF_FW_ATQT 0x00080400
#define PF_MBX_ARQBAH 0x0022E400
Expand Down
Loading

0 comments on commit a0392ab

Please sign in to comment.