Skip to content

Commit 97b5631

Browse files
dmertmananguy11
authored andcommitted
iidc/ice/irdma: Rename to iidc_* convention
In preparation of supporting more than a single core PCI driver for RDMA, homogenize naming to iidc_rdma_* and IIDC_RDMA_* form. Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com> Signed-off-by: Dave Ertman <david.m.ertman@intel.com> Signed-off-by: Tatyana Nikolova <tatyana.e.nikolova@intel.com> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
1 parent 468d8b4 commit 97b5631

File tree

6 files changed

+64
-56
lines changed

6 files changed

+64
-56
lines changed

drivers/infiniband/hw/irdma/main.c

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ static void irdma_log_invalid_mtu(u16 mtu, struct irdma_sc_dev *dev)
6161
}
6262

6363
static void irdma_fill_qos_info(struct irdma_l2params *l2params,
64-
struct iidc_qos_params *qos_info)
64+
struct iidc_rdma_qos_params *qos_info)
6565
{
6666
int i;
6767

@@ -85,26 +85,26 @@ static void irdma_fill_qos_info(struct irdma_l2params *l2params,
8585
}
8686
}
8787

88-
static void irdma_iidc_event_handler(struct ice_pf *pf, struct iidc_event *event)
88+
static void irdma_iidc_event_handler(struct ice_pf *pf, struct iidc_rdma_event *event)
8989
{
9090
struct irdma_device *iwdev = dev_get_drvdata(&pf->adev->dev);
9191
struct irdma_l2params l2params = {};
9292

93-
if (*event->type & BIT(IIDC_EVENT_AFTER_MTU_CHANGE)) {
93+
if (*event->type & BIT(IIDC_RDMA_EVENT_AFTER_MTU_CHANGE)) {
9494
ibdev_dbg(&iwdev->ibdev, "CLNT: new MTU = %d\n", iwdev->netdev->mtu);
9595
if (iwdev->vsi.mtu != iwdev->netdev->mtu) {
9696
l2params.mtu = iwdev->netdev->mtu;
9797
l2params.mtu_changed = true;
9898
irdma_log_invalid_mtu(l2params.mtu, &iwdev->rf->sc_dev);
9999
irdma_change_l2params(&iwdev->vsi, &l2params);
100100
}
101-
} else if (*event->type & BIT(IIDC_EVENT_BEFORE_TC_CHANGE)) {
101+
} else if (*event->type & BIT(IIDC_RDMA_EVENT_BEFORE_TC_CHANGE)) {
102102
if (iwdev->vsi.tc_change_pending)
103103
return;
104104

105105
irdma_prep_tc_change(iwdev);
106-
} else if (*event->type & BIT(IIDC_EVENT_AFTER_TC_CHANGE)) {
107-
struct iidc_qos_params qos_info = {};
106+
} else if (*event->type & BIT(IIDC_RDMA_EVENT_AFTER_TC_CHANGE)) {
107+
struct iidc_rdma_qos_params qos_info = {};
108108

109109
if (!iwdev->vsi.tc_change_pending)
110110
return;
@@ -116,7 +116,7 @@ static void irdma_iidc_event_handler(struct ice_pf *pf, struct iidc_event *event
116116
if (iwdev->rf->protocol_used != IRDMA_IWARP_PROTOCOL_ONLY)
117117
iwdev->dcb_vlan_mode = qos_info.num_tc > 1 && !l2params.dscp_mode;
118118
irdma_change_l2params(&iwdev->vsi, &l2params);
119-
} else if (*event->type & BIT(IIDC_EVENT_CRIT_ERR)) {
119+
} else if (*event->type & BIT(IIDC_RDMA_EVENT_CRIT_ERR)) {
120120
ibdev_warn(&iwdev->ibdev, "ICE OICR event notification: oicr = 0x%08x\n",
121121
event->reg);
122122
if (event->reg & IRDMAPFINT_OICR_PE_CRITERR_M) {
@@ -245,11 +245,12 @@ static void irdma_deinit_interrupts(struct irdma_pci_f *rf, struct ice_pf *pf)
245245

246246
static void irdma_remove(struct auxiliary_device *aux_dev)
247247
{
248-
struct iidc_auxiliary_dev *iidc_adev = container_of(aux_dev,
249-
struct iidc_auxiliary_dev,
250-
adev);
251-
struct ice_pf *pf = iidc_adev->pf;
252248
struct irdma_device *iwdev = auxiliary_get_drvdata(aux_dev);
249+
struct iidc_rdma_core_auxiliary_dev *iidc_adev;
250+
struct ice_pf *pf;
251+
252+
iidc_adev = container_of(aux_dev, struct iidc_rdma_core_auxiliary_dev, adev);
253+
pf = iidc_adev->pf;
253254

254255
irdma_ib_unregister_device(iwdev);
255256
ice_rdma_update_vsi_filter(pf, iwdev->vsi_num, false);
@@ -292,17 +293,19 @@ static void irdma_fill_device_info(struct irdma_device *iwdev, struct ice_pf *pf
292293

293294
static int irdma_probe(struct auxiliary_device *aux_dev, const struct auxiliary_device_id *id)
294295
{
295-
struct iidc_auxiliary_dev *iidc_adev = container_of(aux_dev,
296-
struct iidc_auxiliary_dev,
297-
adev);
298-
struct ice_pf *pf = iidc_adev->pf;
299-
struct ice_vsi *vsi = ice_get_main_vsi(pf);
300-
struct iidc_qos_params qos_info = {};
296+
struct iidc_rdma_core_auxiliary_dev *iidc_adev;
297+
struct iidc_rdma_qos_params qos_info = {};
298+
struct irdma_l2params l2params = {};
301299
struct irdma_device *iwdev;
302300
struct irdma_pci_f *rf;
303-
struct irdma_l2params l2params = {};
301+
struct ice_vsi *vsi;
302+
struct ice_pf *pf;
304303
int err;
305304

305+
iidc_adev = container_of(aux_dev, struct iidc_rdma_core_auxiliary_dev, adev);
306+
pf = iidc_adev->pf;
307+
vsi = ice_get_main_vsi(pf);
308+
306309
if (!vsi)
307310
return -EIO;
308311
iwdev = ib_alloc_device(irdma_device, ibdev);
@@ -367,7 +370,7 @@ static const struct auxiliary_device_id irdma_auxiliary_id_table[] = {
367370

368371
MODULE_DEVICE_TABLE(auxiliary, irdma_auxiliary_id_table);
369372

370-
static struct iidc_auxiliary_drv irdma_auxiliary_drv = {
373+
static struct iidc_rdma_core_auxiliary_drv irdma_auxiliary_drv = {
371374
.adrv = {
372375
.id_table = irdma_auxiliary_id_table,
373376
.probe = irdma_probe,

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -352,8 +352,8 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked)
352352
struct ice_aqc_port_ets_elem buf = { 0 };
353353
struct ice_dcbx_cfg *old_cfg, *curr_cfg;
354354
struct device *dev = ice_pf_to_dev(pf);
355+
struct iidc_rdma_event *event;
355356
int ret = ICE_DCB_NO_HW_CHG;
356-
struct iidc_event *event;
357357
struct ice_vsi *pf_vsi;
358358

359359
curr_cfg = &pf->hw.port_info->qos_cfg.local_dcbx_cfg;
@@ -405,7 +405,7 @@ int ice_pf_dcb_cfg(struct ice_pf *pf, struct ice_dcbx_cfg *new_cfg, bool locked)
405405
goto free_cfg;
406406
}
407407

408-
set_bit(IIDC_EVENT_BEFORE_TC_CHANGE, event->type);
408+
set_bit(IIDC_RDMA_EVENT_BEFORE_TC_CHANGE, event->type);
409409
ice_send_event_to_aux(pf, event);
410410
kfree(event);
411411

@@ -740,7 +740,7 @@ static int ice_dcb_noncontig_cfg(struct ice_pf *pf)
740740
void ice_pf_dcb_recfg(struct ice_pf *pf, bool locked)
741741
{
742742
struct ice_dcbx_cfg *dcbcfg = &pf->hw.port_info->qos_cfg.local_dcbx_cfg;
743-
struct iidc_event *event;
743+
struct iidc_rdma_event *event;
744744
u8 tc_map = 0;
745745
int v, ret;
746746

@@ -789,7 +789,7 @@ void ice_pf_dcb_recfg(struct ice_pf *pf, bool locked)
789789
if (!event)
790790
return;
791791

792-
set_bit(IIDC_EVENT_AFTER_TC_CHANGE, event->type);
792+
set_bit(IIDC_RDMA_EVENT_AFTER_TC_CHANGE, event->type);
793793
ice_send_event_to_aux(pf, event);
794794
kfree(event);
795795
}

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

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,27 @@ static DEFINE_XARRAY_ALLOC1(ice_aux_id);
1515
* This function has to be called with a device_lock on the
1616
* pf->adev.dev to avoid race conditions.
1717
*/
18-
static struct iidc_auxiliary_drv *ice_get_auxiliary_drv(struct ice_pf *pf)
18+
static
19+
struct iidc_rdma_core_auxiliary_drv *ice_get_auxiliary_drv(struct ice_pf *pf)
1920
{
2021
struct auxiliary_device *adev;
2122

2223
adev = pf->adev;
2324
if (!adev || !adev->dev.driver)
2425
return NULL;
2526

26-
return container_of(adev->dev.driver, struct iidc_auxiliary_drv,
27-
adrv.driver);
27+
return container_of(adev->dev.driver,
28+
struct iidc_rdma_core_auxiliary_drv, adrv.driver);
2829
}
2930

3031
/**
3132
* ice_send_event_to_aux - send event to RDMA AUX driver
3233
* @pf: pointer to PF struct
3334
* @event: event struct
3435
*/
35-
void ice_send_event_to_aux(struct ice_pf *pf, struct iidc_event *event)
36+
void ice_send_event_to_aux(struct ice_pf *pf, struct iidc_rdma_event *event)
3637
{
37-
struct iidc_auxiliary_drv *iadrv;
38+
struct iidc_rdma_core_auxiliary_drv *iadrv;
3839

3940
if (WARN_ON_ONCE(!in_task()))
4041
return;
@@ -141,7 +142,8 @@ EXPORT_SYMBOL_GPL(ice_del_rdma_qset);
141142
* @pf: struct for PF
142143
* @reset_type: type of reset
143144
*/
144-
int ice_rdma_request_reset(struct ice_pf *pf, enum iidc_reset_type reset_type)
145+
int ice_rdma_request_reset(struct ice_pf *pf,
146+
enum iidc_rdma_reset_type reset_type)
145147
{
146148
enum ice_reset_req reset;
147149

@@ -205,7 +207,7 @@ EXPORT_SYMBOL_GPL(ice_rdma_update_vsi_filter);
205207
* @pf: pointer to PF struct
206208
* @qos: set of QoS values
207209
*/
208-
void ice_get_qos_params(struct ice_pf *pf, struct iidc_qos_params *qos)
210+
void ice_get_qos_params(struct ice_pf *pf, struct iidc_rdma_qos_params *qos)
209211
{
210212
struct ice_dcbx_cfg *dcbx_cfg;
211213
unsigned int i;
@@ -263,9 +265,10 @@ EXPORT_SYMBOL_GPL(ice_free_rdma_qvector);
263265
*/
264266
static void ice_adev_release(struct device *dev)
265267
{
266-
struct iidc_auxiliary_dev *iadev;
268+
struct iidc_rdma_core_auxiliary_dev *iadev;
267269

268-
iadev = container_of(dev, struct iidc_auxiliary_dev, adev.dev);
270+
iadev = container_of(dev, struct iidc_rdma_core_auxiliary_dev,
271+
adev.dev);
269272
kfree(iadev);
270273
}
271274

@@ -275,7 +278,7 @@ static void ice_adev_release(struct device *dev)
275278
*/
276279
int ice_plug_aux_dev(struct ice_pf *pf)
277280
{
278-
struct iidc_auxiliary_dev *iadev;
281+
struct iidc_rdma_core_auxiliary_dev *iadev;
279282
struct auxiliary_device *adev;
280283
int ret;
281284

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88

99
struct ice_pf;
1010

11-
void ice_send_event_to_aux(struct ice_pf *pf, struct iidc_event *event);
11+
void ice_send_event_to_aux(struct ice_pf *pf, struct iidc_rdma_event *event);
1212

1313
#endif /* !_ICE_IDC_INT_H_ */

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2401,11 +2401,11 @@ static void ice_service_task(struct work_struct *work)
24012401
}
24022402

24032403
if (test_and_clear_bit(ICE_AUX_ERR_PENDING, pf->state)) {
2404-
struct iidc_event *event;
2404+
struct iidc_rdma_event *event;
24052405

24062406
event = kzalloc(sizeof(*event), GFP_KERNEL);
24072407
if (event) {
2408-
set_bit(IIDC_EVENT_CRIT_ERR, event->type);
2408+
set_bit(IIDC_RDMA_EVENT_CRIT_ERR, event->type);
24092409
/* report the entire OICR value to AUX driver */
24102410
swap(event->reg, pf->oicr_err_reg);
24112411
ice_send_event_to_aux(pf, event);
@@ -2424,11 +2424,11 @@ static void ice_service_task(struct work_struct *work)
24242424
ice_plug_aux_dev(pf);
24252425

24262426
if (test_and_clear_bit(ICE_FLAG_MTU_CHANGED, pf->flags)) {
2427-
struct iidc_event *event;
2427+
struct iidc_rdma_event *event;
24282428

24292429
event = kzalloc(sizeof(*event), GFP_KERNEL);
24302430
if (event) {
2431-
set_bit(IIDC_EVENT_AFTER_MTU_CHANGE, event->type);
2431+
set_bit(IIDC_RDMA_EVENT_AFTER_MTU_CHANGE, event->type);
24322432
ice_send_event_to_aux(pf, event);
24332433
kfree(event);
24342434
}

include/linux/net/intel/iidc_rdma.h

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
#include <linux/kernel.h>
1212
#include <linux/netdevice.h>
1313

14-
enum iidc_event_type {
15-
IIDC_EVENT_BEFORE_MTU_CHANGE,
16-
IIDC_EVENT_AFTER_MTU_CHANGE,
17-
IIDC_EVENT_BEFORE_TC_CHANGE,
18-
IIDC_EVENT_AFTER_TC_CHANGE,
19-
IIDC_EVENT_CRIT_ERR,
20-
IIDC_EVENT_NBITS /* must be last */
14+
enum iidc_rdma_event_type {
15+
IIDC_RDMA_EVENT_BEFORE_MTU_CHANGE,
16+
IIDC_RDMA_EVENT_AFTER_MTU_CHANGE,
17+
IIDC_RDMA_EVENT_BEFORE_TC_CHANGE,
18+
IIDC_RDMA_EVENT_AFTER_TC_CHANGE,
19+
IIDC_RDMA_EVENT_CRIT_ERR,
20+
IIDC_RDMA_EVENT_NBITS /* must be last */
2121
};
2222

23-
enum iidc_reset_type {
23+
enum iidc_rdma_reset_type {
2424
IIDC_PFR,
2525
IIDC_CORER,
2626
IIDC_GLOBR,
@@ -47,7 +47,7 @@ struct iidc_rdma_qset_params {
4747
u8 tc; /* TC branch the Qset should belong to */
4848
};
4949

50-
struct iidc_qos_info {
50+
struct iidc_rdma_qos_info {
5151
u64 tc_ctx;
5252
u8 rel_bw;
5353
u8 prio_type;
@@ -56,8 +56,8 @@ struct iidc_qos_info {
5656
};
5757

5858
/* Struct to pass QoS info */
59-
struct iidc_qos_params {
60-
struct iidc_qos_info tc_info[IEEE_8021QAZ_MAX_TCS];
59+
struct iidc_rdma_qos_params {
60+
struct iidc_rdma_qos_info tc_info[IEEE_8021QAZ_MAX_TCS];
6161
u8 up2tc[IIDC_MAX_USER_PRIORITY];
6262
u8 vport_relative_bw;
6363
u8 vport_priority_type;
@@ -66,18 +66,20 @@ struct iidc_qos_params {
6666
u8 dscp_map[IIDC_MAX_DSCP_MAPPING];
6767
};
6868

69-
struct iidc_event {
70-
DECLARE_BITMAP(type, IIDC_EVENT_NBITS);
69+
struct iidc_rdma_event {
70+
DECLARE_BITMAP(type, IIDC_RDMA_EVENT_NBITS);
7171
u32 reg;
7272
};
7373

7474
struct ice_pf;
7575

7676
int ice_add_rdma_qset(struct ice_pf *pf, struct iidc_rdma_qset_params *qset);
7777
int ice_del_rdma_qset(struct ice_pf *pf, struct iidc_rdma_qset_params *qset);
78-
int ice_rdma_request_reset(struct ice_pf *pf, enum iidc_reset_type reset_type);
78+
int ice_rdma_request_reset(struct ice_pf *pf,
79+
enum iidc_rdma_reset_type reset_type);
7980
int ice_rdma_update_vsi_filter(struct ice_pf *pf, u16 vsi_id, bool enable);
80-
void ice_get_qos_params(struct ice_pf *pf, struct iidc_qos_params *qos);
81+
void ice_get_qos_params(struct ice_pf *pf,
82+
struct iidc_rdma_qos_params *qos);
8183
int ice_alloc_rdma_qvector(struct ice_pf *pf, struct msix_entry *entry);
8284
void ice_free_rdma_qvector(struct ice_pf *pf, struct msix_entry *entry);
8385

@@ -86,7 +88,7 @@ void ice_free_rdma_qvector(struct ice_pf *pf, struct msix_entry *entry);
8688
* instance of this struct dedicated to it.
8789
*/
8890

89-
struct iidc_auxiliary_dev {
91+
struct iidc_rdma_core_auxiliary_dev {
9092
struct auxiliary_device adev;
9193
struct ice_pf *pf;
9294
};
@@ -96,14 +98,14 @@ struct iidc_auxiliary_dev {
9698
* driver will access these ops by performing a container_of on the
9799
* auxiliary_device->dev.driver.
98100
*/
99-
struct iidc_auxiliary_drv {
101+
struct iidc_rdma_core_auxiliary_drv {
100102
struct auxiliary_driver adrv;
101103
/* This event_handler is meant to be a blocking call. For instance,
102104
* when a BEFORE_MTU_CHANGE event comes in, the event_handler will not
103105
* return until the auxiliary driver is ready for the MTU change to
104106
* happen.
105107
*/
106-
void (*event_handler)(struct ice_pf *pf, struct iidc_event *event);
108+
void (*event_handler)(struct ice_pf *pf, struct iidc_rdma_event *event);
107109
};
108110

109111
#endif /* _IIDC_RDMA_H_*/

0 commit comments

Comments
 (0)