Commit 09ca9940 authored by Jakub Kicinski's avatar Jakub Kicinski
Browse files
Tony Nguyen says:

====================
Intel Wired LAN Driver Updates 2024-05-06 (ice)

This series contains updates to ice driver only.

Paul adds support for additional E830 devices and adjusts naming for
existing E830 devices.

Marcin commonizes a couple of TC setup calls to reduce duplicated code.

Mateusz adds ice_vsi_cfg_params into ice_vsi to consolidate info.

* '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue:
  ice: refactor struct ice_vsi_cfg_params to be inside of struct ice_vsi
  ice: Deduplicate tc action setup
  ice: update E830 device ids and comments
  ice: add additional E830 device ids
====================

Link: https://lore.kernel.org/r/20240506170827.948682-1-anthony.l.nguyen@intel.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parents 05417aa9 deea427f
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -1193,18 +1193,16 @@ static int ice_devlink_set_parent(struct devlink_rate *devlink_rate,
static int ice_devlink_reinit_up(struct ice_pf *pf)
{
	struct ice_vsi *vsi = ice_get_main_vsi(pf);
	struct ice_vsi_cfg_params params;
	int err;

	err = ice_init_dev(pf);
	if (err)
		return err;

	params = ice_vsi_to_params(vsi);
	params.flags = ICE_VSI_FLAG_INIT;
	vsi->flags = ICE_VSI_FLAG_INIT;

	rtnl_lock();
	err = ice_vsi_cfg(vsi, &params);
	err = ice_vsi_cfg(vsi);
	rtnl_unlock();
	if (err)
		goto err_vsi_cfg;
+8 −6
Original line number Diff line number Diff line
@@ -331,7 +331,6 @@ struct ice_vsi {
	struct net_device *netdev;
	struct ice_sw *vsw;		 /* switch this VSI is on */
	struct ice_pf *back;		 /* back pointer to PF */
	struct ice_port_info *port_info; /* back pointer to port_info */
	struct ice_rx_ring **rx_rings;	 /* Rx ring array */
	struct ice_tx_ring **tx_rings;	 /* Tx ring array */
	struct ice_q_vector **q_vectors; /* q_vector array */
@@ -349,12 +348,9 @@ struct ice_vsi {
	/* tell if only dynamic irq allocation is allowed */
	bool irq_dyn_alloc;

	enum ice_vsi_type type;
	u16 vsi_num;			/* HW (absolute) index of this VSI */
	u16 idx;			/* software index in pf->vsi[] */

	struct ice_vf *vf;		/* VF associated with this VSI */

	u16 num_gfltr;
	u16 num_bfltr;

@@ -446,12 +442,18 @@ struct ice_vsi {
	u8 old_numtc;
	u16 old_ena_tc;

	struct ice_channel *ch;

	/* setup back reference, to which aggregator node this VSI
	 * corresponds to
	 */
	struct ice_agg_node *agg_node;

	struct_group_tagged(ice_vsi_cfg_params, params,
		struct ice_port_info *port_info; /* back pointer to port_info */
		struct ice_channel *ch; /* VSI's channel structure, may be NULL */
		struct ice_vf *vf; /* VF associated with this VSI, may be NULL */
		u32 flags; /* VSI flags used for rebuild and configuration */
		enum ice_vsi_type type; /* the type of the VSI */
	);
} ____cacheline_internodealigned_in_smp;

/* struct that defines an interrupt vector */
+10 −4
Original line number Diff line number Diff line
@@ -160,10 +160,16 @@ static int ice_set_mac_type(struct ice_hw *hw)
	case ICE_DEV_ID_E825C_SGMII:
		hw->mac_type = ICE_MAC_GENERIC_3K_E825;
		break;
	case ICE_DEV_ID_E830_BACKPLANE:
	case ICE_DEV_ID_E830_QSFP56:
	case ICE_DEV_ID_E830_SFP:
	case ICE_DEV_ID_E830_SFP_DD:
	case ICE_DEV_ID_E830CC_BACKPLANE:
	case ICE_DEV_ID_E830CC_QSFP56:
	case ICE_DEV_ID_E830CC_SFP:
	case ICE_DEV_ID_E830CC_SFP_DD:
	case ICE_DEV_ID_E830C_BACKPLANE:
	case ICE_DEV_ID_E830_XXV_BACKPLANE:
	case ICE_DEV_ID_E830C_QSFP:
	case ICE_DEV_ID_E830_XXV_QSFP:
	case ICE_DEV_ID_E830C_SFP:
	case ICE_DEV_ID_E830_XXV_SFP:
		hw->mac_type = ICE_MAC_E830;
		break;
	default:
+17 −5
Original line number Diff line number Diff line
@@ -16,14 +16,26 @@
#define ICE_DEV_ID_E823L_1GBE		0x124F
/* Intel(R) Ethernet Connection E823-L for QSFP */
#define ICE_DEV_ID_E823L_QSFP		0x151D
/* Intel(R) Ethernet Controller E830-CC for backplane */
#define ICE_DEV_ID_E830CC_BACKPLANE	0x12D1
/* Intel(R) Ethernet Controller E830-CC for QSFP */
#define ICE_DEV_ID_E830CC_QSFP56	0x12D2
/* Intel(R) Ethernet Controller E830-CC for SFP */
#define ICE_DEV_ID_E830CC_SFP		0x12D3
/* Intel(R) Ethernet Controller E830-CC for SFP-DD */
#define ICE_DEV_ID_E830CC_SFP_DD	0x12D4
/* Intel(R) Ethernet Controller E830-C for backplane */
#define ICE_DEV_ID_E830_BACKPLANE	0x12D1
#define ICE_DEV_ID_E830C_BACKPLANE	0x12D5
/* Intel(R) Ethernet Controller E830-C for QSFP */
#define ICE_DEV_ID_E830_QSFP56		0x12D2
#define ICE_DEV_ID_E830C_QSFP		0x12D8
/* Intel(R) Ethernet Controller E830-C for SFP */
#define ICE_DEV_ID_E830_SFP		0x12D3
/* Intel(R) Ethernet Controller E830-C for SFP-DD */
#define ICE_DEV_ID_E830_SFP_DD		0x12D4
#define ICE_DEV_ID_E830C_SFP		0x12DA
/* Intel(R) Ethernet Controller E830-XXV for backplane */
#define ICE_DEV_ID_E830_XXV_BACKPLANE	0x12DC
/* Intel(R) Ethernet Controller E830-XXV for QSFP */
#define ICE_DEV_ID_E830_XXV_QSFP	0x12DD
/* Intel(R) Ethernet Controller E830-XXV for SFP */
#define ICE_DEV_ID_E830_XXV_SFP		0x12DE
/* Intel(R) Ethernet Controller E810-C for backplane */
#define ICE_DEV_ID_E810C_BACKPLANE	0x1591
/* Intel(R) Ethernet Controller E810-C for QSFP */
+11 −22
Original line number Diff line number Diff line
@@ -2227,10 +2227,8 @@ static int ice_vsi_cfg_tc_lan(struct ice_pf *pf, struct ice_vsi *vsi)
/**
 * ice_vsi_cfg_def - configure default VSI based on the type
 * @vsi: pointer to VSI
 * @params: the parameters to configure this VSI with
 */
static int
ice_vsi_cfg_def(struct ice_vsi *vsi, struct ice_vsi_cfg_params *params)
static int ice_vsi_cfg_def(struct ice_vsi *vsi)
{
	struct device *dev = ice_pf_to_dev(vsi->back);
	struct ice_pf *pf = vsi->back;
@@ -2238,7 +2236,7 @@ ice_vsi_cfg_def(struct ice_vsi *vsi, struct ice_vsi_cfg_params *params)

	vsi->vsw = pf->first_sw;

	ret = ice_vsi_alloc_def(vsi, params->ch);
	ret = ice_vsi_alloc_def(vsi, vsi->ch);
	if (ret)
		return ret;

@@ -2263,7 +2261,7 @@ ice_vsi_cfg_def(struct ice_vsi *vsi, struct ice_vsi_cfg_params *params)
	ice_vsi_set_tc_cfg(vsi);

	/* create the VSI */
	ret = ice_vsi_init(vsi, params->flags);
	ret = ice_vsi_init(vsi, vsi->flags);
	if (ret)
		goto unroll_get_qs;

@@ -2383,23 +2381,16 @@ ice_vsi_cfg_def(struct ice_vsi *vsi, struct ice_vsi_cfg_params *params)
/**
 * ice_vsi_cfg - configure a previously allocated VSI
 * @vsi: pointer to VSI
 * @params: parameters used to configure this VSI
 */
int ice_vsi_cfg(struct ice_vsi *vsi, struct ice_vsi_cfg_params *params)
int ice_vsi_cfg(struct ice_vsi *vsi)
{
	struct ice_pf *pf = vsi->back;
	int ret;

	if (WARN_ON(params->type == ICE_VSI_VF && !params->vf))
	if (WARN_ON(vsi->type == ICE_VSI_VF && !vsi->vf))
		return -EINVAL;

	vsi->type = params->type;
	vsi->port_info = params->pi;

	/* For VSIs which don't have a connected VF, this will be NULL */
	vsi->vf = params->vf;

	ret = ice_vsi_cfg_def(vsi, params);
	ret = ice_vsi_cfg_def(vsi);
	if (ret)
		return ret;

@@ -2485,7 +2476,7 @@ ice_vsi_setup(struct ice_pf *pf, struct ice_vsi_cfg_params *params)
	 * a port_info structure for it.
	 */
	if (WARN_ON(!(params->flags & ICE_VSI_FLAG_INIT)) ||
	    WARN_ON(!params->pi))
	    WARN_ON(!params->port_info))
		return NULL;

	vsi = ice_vsi_alloc(pf);
@@ -2494,7 +2485,8 @@ ice_vsi_setup(struct ice_pf *pf, struct ice_vsi_cfg_params *params)
		return NULL;
	}

	ret = ice_vsi_cfg(vsi, params);
	vsi->params = *params;
	ret = ice_vsi_cfg(vsi);
	if (ret)
		goto err_vsi_cfg;

@@ -3041,7 +3033,6 @@ ice_vsi_realloc_stat_arrays(struct ice_vsi *vsi)
 */
int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags)
{
	struct ice_vsi_cfg_params params = {};
	struct ice_coalesce_stored *coalesce;
	int prev_num_q_vectors;
	struct ice_pf *pf;
@@ -3050,9 +3041,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags)
	if (!vsi)
		return -EINVAL;

	params = ice_vsi_to_params(vsi);
	params.flags = vsi_flags;

	vsi->flags = vsi_flags;
	pf = vsi->back;
	if (WARN_ON(vsi->type == ICE_VSI_VF && !vsi->vf))
		return -EINVAL;
@@ -3062,7 +3051,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags)
		goto err_vsi_cfg;

	ice_vsi_decfg(vsi);
	ret = ice_vsi_cfg_def(vsi, &params);
	ret = ice_vsi_cfg_def(vsi);
	if (ret)
		goto err_vsi_cfg;

Loading