Commit 5f9721a2 authored by David S. Miller's avatar David S. Miller
Browse files


Jeff Kirsher says:

====================
100GbE Intel Wired LAN Driver Updates 2020-02-19

This series contains updates to the ice driver only.

Avinash adds input validation for software DCB configurations received
via lldptool or pcap to ensure bad bandwidth inputs are not inputted
which could cause the loss of link.

Paul update the malicious driver detection event messages to rate limit
once per second and to include the total number of receive|transmit MDD
event count.

Dan updates how TCAM entries are managed to ensure when overriding
pre-existing TCAM entries, properly delete the existing entry and remove
it from the change/update list.

Brett ensures we clear the relevant values in the QRXFLXP_CNTXT register
for VF queues to ensure the receive queue data is not stale.

Avinash adds required DCBNL operations for configuring ETS in software
DCB CEE mode.  Also added code to detect if DCB is in IEEE or CEE mode
to properly report what mode we are in.

Dave fixes the driver to properly report the current maximum TC, not the
maximum allowed number of TCs.

Krzysztof adds support for AF_XDP feature in the ice driver.

Jake increases the maximum time that the driver will wait for a PR reset
to account for possibility of a slightly longer than expected PD reset.

Jesse fixes a number of strings which did not have line feeds, so add
line feeds so that messages do not rum together, creating a jumbled
mess.

Bruce adds support for additional E810 and E823 device ids.  Also
updated the product name change for E822 devices.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 2e92a2d0 2fbfa966
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -212,6 +212,7 @@ enum ice_state {
	__ICE_SERVICE_SCHED,
	__ICE_SERVICE_DIS,
	__ICE_OICR_INTR_DIS,		/* Global OICR interrupt disabled */
	__ICE_MDD_VF_PRINT_PENDING,	/* set when MDD event handle */
	__ICE_STATE_NBITS		/* must be last */
};

@@ -340,6 +341,7 @@ enum ice_pf_flags {
	ICE_FLAG_FW_LLDP_AGENT,
	ICE_FLAG_ETHTOOL_CTXT,		/* set when ethtool holds RTNL lock */
	ICE_FLAG_LEGACY_RX,
	ICE_FLAG_MDD_AUTO_RESET_VF,
	ICE_PF_FLAGS_NBITS		/* must be last */
};

@@ -363,6 +365,8 @@ struct ice_pf {
	u16 num_vfs_supported;		/* num VFs supported for this PF */
	u16 num_vf_qps;			/* num queue pairs per VF */
	u16 num_vf_msix;		/* num vectors per VF */
	/* used to ratelimit the MDD event logging */
	unsigned long last_printed_mdd_jiffies;
	DECLARE_BITMAP(state, __ICE_STATE_NBITS);
	DECLARE_BITMAP(flags, ICE_PF_FLAGS_NBITS);
	unsigned long *avail_txqs;	/* bitmap to track PF Tx queue usage */
+7 −4
Original line number Diff line number Diff line
@@ -203,8 +203,7 @@ static void ice_cfg_itr_gran(struct ice_hw *hw)
 */
static u16 ice_calc_q_handle(struct ice_vsi *vsi, struct ice_ring *ring, u8 tc)
{
	WARN_ONCE(ice_ring_is_xdp(ring) && tc,
		  "XDP ring can't belong to TC other than 0");
	WARN_ONCE(ice_ring_is_xdp(ring) && tc, "XDP ring can't belong to TC other than 0\n");

	/* Idea here for calculation is that we subtract the number of queue
	 * count from TC that ring belongs to from it's absolute queue index
@@ -386,8 +385,8 @@ int ice_setup_rx_ctx(struct ice_ring *ring)
	 /* Enable Flexible Descriptors in the queue context which
	  * allows this driver to select a specific receive descriptor format
	  */
	if (vsi->type != ICE_VSI_VF) {
	regval = rd32(hw, QRXFLXP_CNTXT(pf_q));
	if (vsi->type != ICE_VSI_VF) {
		regval |= (rxdid << QRXFLXP_CNTXT_RXDID_IDX_S) &
			QRXFLXP_CNTXT_RXDID_IDX_M;

@@ -398,8 +397,12 @@ int ice_setup_rx_ctx(struct ice_ring *ring)
		regval |= (0x03 << QRXFLXP_CNTXT_RXDID_PRIO_S) &
			QRXFLXP_CNTXT_RXDID_PRIO_M;

		wr32(hw, QRXFLXP_CNTXT(pf_q), regval);
	} else {
		regval &= ~(QRXFLXP_CNTXT_RXDID_IDX_M |
			    QRXFLXP_CNTXT_RXDID_PRIO_M |
			    QRXFLXP_CNTXT_TS_M);
	}
	wr32(hw, QRXFLXP_CNTXT(pf_q), regval);

	/* Absolute queue number out of 2K needs to be passed */
	err = ice_write_rxq_ctx(hw, &rlan_ctx, pf_q);
+1 −1
Original line number Diff line number Diff line
@@ -6,7 +6,7 @@
#include "ice_adminq_cmd.h"
#include "ice_flow.h"

#define ICE_PF_RESET_WAIT_COUNT	200
#define ICE_PF_RESET_WAIT_COUNT	300

/**
 * ice_set_mac_type - Sets MAC type
+64 −3
Original line number Diff line number Diff line
@@ -62,6 +62,26 @@ u8 ice_dcb_get_ena_tc(struct ice_dcbx_cfg *dcbcfg)
	return ena_tc;
}

/**
 * ice_dcb_get_mode - gets the DCB mode
 * @port_info: pointer to port info structure
 * @host: if set it's HOST if not it's MANAGED
 */
static u8 ice_dcb_get_mode(struct ice_port_info *port_info, bool host)
{
	u8 mode;

	if (host)
		mode = DCB_CAP_DCBX_HOST;
	else
		mode = DCB_CAP_DCBX_LLD_MANAGED;

	if (port_info->local_dcbx_cfg.dcbx_mode & ICE_DCBX_MODE_CEE)
		return (mode | DCB_CAP_DCBX_VER_CEE);
	else
		return (mode | DCB_CAP_DCBX_VER_IEEE);
}

/**
 * ice_dcb_get_num_tc - Get the number of TCs from DCBX config
 * @dcbcfg: config to retrieve number of TCs from
@@ -148,6 +168,43 @@ void ice_vsi_cfg_dcb_rings(struct ice_vsi *vsi)
	}
}

/**
 * ice_dcb_bwchk - check if ETS bandwidth input parameters are correct
 * @pf: pointer to the PF struct
 * @dcbcfg: pointer to DCB config structure
 */
int ice_dcb_bwchk(struct ice_pf *pf, struct ice_dcbx_cfg *dcbcfg)
{
	struct ice_dcb_ets_cfg *etscfg = &dcbcfg->etscfg;
	u8 num_tc, total_bw = 0;
	int i;

	/* returns number of contigous TCs and 1 TC for non-contigous TCs,
	 * since at least 1 TC has to be configured
	 */
	num_tc = ice_dcb_get_num_tc(dcbcfg);

	/* no bandwidth checks required if there's only one TC, so assign
	 * all bandwidth to TC0 and return
	 */
	if (num_tc == 1) {
		etscfg->tcbwtable[0] = ICE_TC_MAX_BW;
		return 0;
	}

	for (i = 0; i < num_tc; i++)
		total_bw += etscfg->tcbwtable[i];

	if (!total_bw) {
		etscfg->tcbwtable[0] = ICE_TC_MAX_BW;
	} else if (total_bw != ICE_TC_MAX_BW) {
		dev_err(ice_pf_to_dev(pf), "Invalid config, total bandwidth must equal 100\n");
		return -EINVAL;
	}

	return 0;
}

/**
 * ice_pf_dcb_cfg - Apply new DCB configuration
 * @pf: pointer to the PF struct
@@ -182,6 +239,9 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked)
		return ret;
	}

	if (ice_dcb_bwchk(pf, new_cfg))
		return -EINVAL;

	/* Store old config in case FW config fails */
	old_cfg = kmemdup(curr_cfg, sizeof(*old_cfg), GFP_KERNEL);
	if (!old_cfg)
@@ -605,14 +665,14 @@ int ice_init_pf_dcb(struct ice_pf *pf, bool locked)

		ice_cfg_sw_lldp(pf_vsi, false, true);

		pf->dcbx_cap = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_IEEE;
		pf->dcbx_cap = ice_dcb_get_mode(port_info, true);
		return 0;
	}

	set_bit(ICE_FLAG_FW_LLDP_AGENT, pf->flags);

	/* DCBX in FW and LLDP enabled in FW */
	pf->dcbx_cap = DCB_CAP_DCBX_LLD_MANAGED | DCB_CAP_DCBX_VER_IEEE;
	/* DCBX/LLDP enabled in FW, set DCBNL mode advertisement */
	pf->dcbx_cap = ice_dcb_get_mode(port_info, false);

	err = ice_dcb_init_cfg(pf, locked);
	if (err)
@@ -772,6 +832,7 @@ ice_dcb_process_lldp_set_mib_change(struct ice_pf *pf,
	/* No change detected in DCBX configs */
	if (!memcmp(&tmp_dcbx_cfg, &pi->local_dcbx_cfg, sizeof(tmp_dcbx_cfg))) {
		dev_dbg(dev, "No change detected in DCBX configuration.\n");
		pf->dcbx_cap = ice_dcb_get_mode(pi, false);
		goto out;
	}

+1 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ u8 ice_dcb_get_num_tc(struct ice_dcbx_cfg *dcbcfg);
u8 ice_dcb_get_tc(struct ice_vsi *vsi, int queue_index);
int
ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked);
int ice_dcb_bwchk(struct ice_pf *pf, struct ice_dcbx_cfg *dcbcfg);
void ice_pf_dcb_recfg(struct ice_pf *pf);
void ice_vsi_cfg_dcb_rings(struct ice_vsi *vsi);
int ice_init_pf_dcb(struct ice_pf *pf, bool locked);
Loading