Skip to content

Commit 09ca994

Browse files
committed
Merge branch '100GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
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: Jakub Kicinski <kuba@kernel.org>
2 parents 05417aa + deea427 commit 09ca994

File tree

10 files changed

+82
-134
lines changed

10 files changed

+82
-134
lines changed

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

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1193,18 +1193,16 @@ static int ice_devlink_set_parent(struct devlink_rate *devlink_rate,
11931193
static int ice_devlink_reinit_up(struct ice_pf *pf)
11941194
{
11951195
struct ice_vsi *vsi = ice_get_main_vsi(pf);
1196-
struct ice_vsi_cfg_params params;
11971196
int err;
11981197

11991198
err = ice_init_dev(pf);
12001199
if (err)
12011200
return err;
12021201

1203-
params = ice_vsi_to_params(vsi);
1204-
params.flags = ICE_VSI_FLAG_INIT;
1202+
vsi->flags = ICE_VSI_FLAG_INIT;
12051203

12061204
rtnl_lock();
1207-
err = ice_vsi_cfg(vsi, &params);
1205+
err = ice_vsi_cfg(vsi);
12081206
rtnl_unlock();
12091207
if (err)
12101208
goto err_vsi_cfg;

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

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,6 @@ struct ice_vsi {
331331
struct net_device *netdev;
332332
struct ice_sw *vsw; /* switch this VSI is on */
333333
struct ice_pf *back; /* back pointer to PF */
334-
struct ice_port_info *port_info; /* back pointer to port_info */
335334
struct ice_rx_ring **rx_rings; /* Rx ring array */
336335
struct ice_tx_ring **tx_rings; /* Tx ring array */
337336
struct ice_q_vector **q_vectors; /* q_vector array */
@@ -349,12 +348,9 @@ struct ice_vsi {
349348
/* tell if only dynamic irq allocation is allowed */
350349
bool irq_dyn_alloc;
351350

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

356-
struct ice_vf *vf; /* VF associated with this VSI */
357-
358354
u16 num_gfltr;
359355
u16 num_bfltr;
360356

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

449-
struct ice_channel *ch;
450-
451445
/* setup back reference, to which aggregator node this VSI
452446
* corresponds to
453447
*/
454448
struct ice_agg_node *agg_node;
449+
450+
struct_group_tagged(ice_vsi_cfg_params, params,
451+
struct ice_port_info *port_info; /* back pointer to port_info */
452+
struct ice_channel *ch; /* VSI's channel structure, may be NULL */
453+
struct ice_vf *vf; /* VF associated with this VSI, may be NULL */
454+
u32 flags; /* VSI flags used for rebuild and configuration */
455+
enum ice_vsi_type type; /* the type of the VSI */
456+
);
455457
} ____cacheline_internodealigned_in_smp;
456458

457459
/* struct that defines an interrupt vector */

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -160,10 +160,16 @@ static int ice_set_mac_type(struct ice_hw *hw)
160160
case ICE_DEV_ID_E825C_SGMII:
161161
hw->mac_type = ICE_MAC_GENERIC_3K_E825;
162162
break;
163-
case ICE_DEV_ID_E830_BACKPLANE:
164-
case ICE_DEV_ID_E830_QSFP56:
165-
case ICE_DEV_ID_E830_SFP:
166-
case ICE_DEV_ID_E830_SFP_DD:
163+
case ICE_DEV_ID_E830CC_BACKPLANE:
164+
case ICE_DEV_ID_E830CC_QSFP56:
165+
case ICE_DEV_ID_E830CC_SFP:
166+
case ICE_DEV_ID_E830CC_SFP_DD:
167+
case ICE_DEV_ID_E830C_BACKPLANE:
168+
case ICE_DEV_ID_E830_XXV_BACKPLANE:
169+
case ICE_DEV_ID_E830C_QSFP:
170+
case ICE_DEV_ID_E830_XXV_QSFP:
171+
case ICE_DEV_ID_E830C_SFP:
172+
case ICE_DEV_ID_E830_XXV_SFP:
167173
hw->mac_type = ICE_MAC_E830;
168174
break;
169175
default:

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

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,26 @@
1616
#define ICE_DEV_ID_E823L_1GBE 0x124F
1717
/* Intel(R) Ethernet Connection E823-L for QSFP */
1818
#define ICE_DEV_ID_E823L_QSFP 0x151D
19+
/* Intel(R) Ethernet Controller E830-CC for backplane */
20+
#define ICE_DEV_ID_E830CC_BACKPLANE 0x12D1
21+
/* Intel(R) Ethernet Controller E830-CC for QSFP */
22+
#define ICE_DEV_ID_E830CC_QSFP56 0x12D2
23+
/* Intel(R) Ethernet Controller E830-CC for SFP */
24+
#define ICE_DEV_ID_E830CC_SFP 0x12D3
25+
/* Intel(R) Ethernet Controller E830-CC for SFP-DD */
26+
#define ICE_DEV_ID_E830CC_SFP_DD 0x12D4
1927
/* Intel(R) Ethernet Controller E830-C for backplane */
20-
#define ICE_DEV_ID_E830_BACKPLANE 0x12D1
28+
#define ICE_DEV_ID_E830C_BACKPLANE 0x12D5
2129
/* Intel(R) Ethernet Controller E830-C for QSFP */
22-
#define ICE_DEV_ID_E830_QSFP56 0x12D2
30+
#define ICE_DEV_ID_E830C_QSFP 0x12D8
2331
/* Intel(R) Ethernet Controller E830-C for SFP */
24-
#define ICE_DEV_ID_E830_SFP 0x12D3
25-
/* Intel(R) Ethernet Controller E830-C for SFP-DD */
26-
#define ICE_DEV_ID_E830_SFP_DD 0x12D4
32+
#define ICE_DEV_ID_E830C_SFP 0x12DA
33+
/* Intel(R) Ethernet Controller E830-XXV for backplane */
34+
#define ICE_DEV_ID_E830_XXV_BACKPLANE 0x12DC
35+
/* Intel(R) Ethernet Controller E830-XXV for QSFP */
36+
#define ICE_DEV_ID_E830_XXV_QSFP 0x12DD
37+
/* Intel(R) Ethernet Controller E830-XXV for SFP */
38+
#define ICE_DEV_ID_E830_XXV_SFP 0x12DE
2739
/* Intel(R) Ethernet Controller E810-C for backplane */
2840
#define ICE_DEV_ID_E810C_BACKPLANE 0x1591
2941
/* Intel(R) Ethernet Controller E810-C for QSFP */

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

Lines changed: 11 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2227,18 +2227,16 @@ static int ice_vsi_cfg_tc_lan(struct ice_pf *pf, struct ice_vsi *vsi)
22272227
/**
22282228
* ice_vsi_cfg_def - configure default VSI based on the type
22292229
* @vsi: pointer to VSI
2230-
* @params: the parameters to configure this VSI with
22312230
*/
2232-
static int
2233-
ice_vsi_cfg_def(struct ice_vsi *vsi, struct ice_vsi_cfg_params *params)
2231+
static int ice_vsi_cfg_def(struct ice_vsi *vsi)
22342232
{
22352233
struct device *dev = ice_pf_to_dev(vsi->back);
22362234
struct ice_pf *pf = vsi->back;
22372235
int ret;
22382236

22392237
vsi->vsw = pf->first_sw;
22402238

2241-
ret = ice_vsi_alloc_def(vsi, params->ch);
2239+
ret = ice_vsi_alloc_def(vsi, vsi->ch);
22422240
if (ret)
22432241
return ret;
22442242

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

22652263
/* create the VSI */
2266-
ret = ice_vsi_init(vsi, params->flags);
2264+
ret = ice_vsi_init(vsi, vsi->flags);
22672265
if (ret)
22682266
goto unroll_get_qs;
22692267

@@ -2383,23 +2381,16 @@ ice_vsi_cfg_def(struct ice_vsi *vsi, struct ice_vsi_cfg_params *params)
23832381
/**
23842382
* ice_vsi_cfg - configure a previously allocated VSI
23852383
* @vsi: pointer to VSI
2386-
* @params: parameters used to configure this VSI
23872384
*/
2388-
int ice_vsi_cfg(struct ice_vsi *vsi, struct ice_vsi_cfg_params *params)
2385+
int ice_vsi_cfg(struct ice_vsi *vsi)
23892386
{
23902387
struct ice_pf *pf = vsi->back;
23912388
int ret;
23922389

2393-
if (WARN_ON(params->type == ICE_VSI_VF && !params->vf))
2390+
if (WARN_ON(vsi->type == ICE_VSI_VF && !vsi->vf))
23942391
return -EINVAL;
23952392

2396-
vsi->type = params->type;
2397-
vsi->port_info = params->pi;
2398-
2399-
/* For VSIs which don't have a connected VF, this will be NULL */
2400-
vsi->vf = params->vf;
2401-
2402-
ret = ice_vsi_cfg_def(vsi, params);
2393+
ret = ice_vsi_cfg_def(vsi);
24032394
if (ret)
24042395
return ret;
24052396

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

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

2497-
ret = ice_vsi_cfg(vsi, params);
2488+
vsi->params = *params;
2489+
ret = ice_vsi_cfg(vsi);
24982490
if (ret)
24992491
goto err_vsi_cfg;
25002492

@@ -3041,7 +3033,6 @@ ice_vsi_realloc_stat_arrays(struct ice_vsi *vsi)
30413033
*/
30423034
int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags)
30433035
{
3044-
struct ice_vsi_cfg_params params = {};
30453036
struct ice_coalesce_stored *coalesce;
30463037
int prev_num_q_vectors;
30473038
struct ice_pf *pf;
@@ -3050,9 +3041,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags)
30503041
if (!vsi)
30513042
return -EINVAL;
30523043

3053-
params = ice_vsi_to_params(vsi);
3054-
params.flags = vsi_flags;
3055-
3044+
vsi->flags = vsi_flags;
30563045
pf = vsi->back;
30573046
if (WARN_ON(vsi->type == ICE_VSI_VF && !vsi->vf))
30583047
return -EINVAL;
@@ -3062,7 +3051,7 @@ int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags)
30623051
goto err_vsi_cfg;
30633052

30643053
ice_vsi_decfg(vsi);
3065-
ret = ice_vsi_cfg_def(vsi, &params);
3054+
ret = ice_vsi_cfg_def(vsi);
30663055
if (ret)
30673056
goto err_vsi_cfg;
30683057

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

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,6 @@
1111
#define ICE_VSI_FLAG_INIT BIT(0)
1212
#define ICE_VSI_FLAG_NO_INIT 0
1313

14-
/**
15-
* struct ice_vsi_cfg_params - VSI configuration parameters
16-
* @pi: pointer to the port_info instance for the VSI
17-
* @ch: pointer to the channel structure for the VSI, may be NULL
18-
* @vf: pointer to the VF associated with this VSI, may be NULL
19-
* @type: the type of VSI to configure
20-
* @flags: VSI flags used for rebuild and configuration
21-
*
22-
* Parameter structure used when configuring a new VSI.
23-
*/
24-
struct ice_vsi_cfg_params {
25-
struct ice_port_info *pi;
26-
struct ice_channel *ch;
27-
struct ice_vf *vf;
28-
enum ice_vsi_type type;
29-
u32 flags;
30-
};
31-
32-
/**
33-
* ice_vsi_to_params - Get parameters for an existing VSI
34-
* @vsi: the VSI to get parameters for
35-
*
36-
* Fill a parameter structure for reconfiguring a VSI with its current
37-
* parameters, such as during a rebuild operation.
38-
*/
39-
static inline struct ice_vsi_cfg_params ice_vsi_to_params(struct ice_vsi *vsi)
40-
{
41-
struct ice_vsi_cfg_params params = {};
42-
43-
params.pi = vsi->port_info;
44-
params.ch = vsi->ch;
45-
params.vf = vsi->vf;
46-
params.type = vsi->type;
47-
48-
return params;
49-
}
50-
5114
const char *ice_vsi_type_str(enum ice_vsi_type vsi_type);
5215

5316
bool ice_pf_state_is_nominal(struct ice_pf *pf);
@@ -101,7 +64,7 @@ void ice_vsi_decfg(struct ice_vsi *vsi);
10164
void ice_dis_vsi(struct ice_vsi *vsi, bool locked);
10265

10366
int ice_vsi_rebuild(struct ice_vsi *vsi, u32 vsi_flags);
104-
int ice_vsi_cfg(struct ice_vsi *vsi, struct ice_vsi_cfg_params *params);
67+
int ice_vsi_cfg(struct ice_vsi *vsi);
10568

10669
bool ice_is_reset_in_progress(unsigned long *state);
10770
int ice_wait_for_reset(struct ice_pf *pf, unsigned long timeout);

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

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3685,7 +3685,7 @@ ice_pf_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi)
36853685
struct ice_vsi_cfg_params params = {};
36863686

36873687
params.type = ICE_VSI_PF;
3688-
params.pi = pi;
3688+
params.port_info = pi;
36893689
params.flags = ICE_VSI_FLAG_INIT;
36903690

36913691
return ice_vsi_setup(pf, &params);
@@ -3698,7 +3698,7 @@ ice_chnl_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi,
36983698
struct ice_vsi_cfg_params params = {};
36993699

37003700
params.type = ICE_VSI_CHNL;
3701-
params.pi = pi;
3701+
params.port_info = pi;
37023702
params.ch = ch;
37033703
params.flags = ICE_VSI_FLAG_INIT;
37043704

@@ -3719,7 +3719,7 @@ ice_ctrl_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi)
37193719
struct ice_vsi_cfg_params params = {};
37203720

37213721
params.type = ICE_VSI_CTRL;
3722-
params.pi = pi;
3722+
params.port_info = pi;
37233723
params.flags = ICE_VSI_FLAG_INIT;
37243724

37253725
return ice_vsi_setup(pf, &params);
@@ -3739,7 +3739,7 @@ ice_lb_vsi_setup(struct ice_pf *pf, struct ice_port_info *pi)
37393739
struct ice_vsi_cfg_params params = {};
37403740

37413741
params.type = ICE_VSI_LB;
3742-
params.pi = pi;
3742+
params.port_info = pi;
37433743
params.flags = ICE_VSI_FLAG_INIT;
37443744

37453745
return ice_vsi_setup(pf, &params);
@@ -5805,10 +5805,16 @@ static const struct pci_device_id ice_pci_tbl[] = {
58055805
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E825C_QSFP), },
58065806
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E825C_SFP), },
58075807
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E825C_SGMII), },
5808-
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E830_BACKPLANE) },
5809-
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E830_QSFP56) },
5810-
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E830_SFP) },
5811-
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E830_SFP_DD) },
5808+
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E830CC_BACKPLANE) },
5809+
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E830CC_QSFP56) },
5810+
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E830CC_SFP) },
5811+
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E830CC_SFP_DD) },
5812+
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E830C_BACKPLANE), },
5813+
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E830_XXV_BACKPLANE), },
5814+
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E830C_QSFP), },
5815+
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E830_XXV_QSFP), },
5816+
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E830C_SFP), },
5817+
{ PCI_VDEVICE(INTEL, ICE_DEV_ID_E830_XXV_SFP), },
58125818
/* required last entry */
58135819
{}
58145820
};

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ static struct ice_vsi *ice_vf_vsi_setup(struct ice_vf *vf)
225225
struct ice_vsi *vsi;
226226

227227
params.type = ICE_VSI_VF;
228-
params.pi = ice_vf_get_port_info(vf);
228+
params.port_info = ice_vf_get_port_info(vf);
229229
params.vf = vf;
230230
params.flags = ICE_VSI_FLAG_INIT;
231231

0 commit comments

Comments
 (0)