Lines Matching refs:pf

13  * @pf: pointer to PF struct
16 * pf->adev.dev to avoid race conditions.
18 static struct iidc_auxiliary_drv *ice_get_auxiliary_drv(struct ice_pf *pf)
22 adev = pf->adev;
32 * @pf: pointer to PF struct
35 void ice_send_event_to_aux(struct ice_pf *pf, struct iidc_event *event)
42 mutex_lock(&pf->adev_mutex);
43 if (!pf->adev)
46 device_lock(&pf->adev->dev);
47 iadrv = ice_get_auxiliary_drv(pf);
49 iadrv->event_handler(pf, event);
50 device_unlock(&pf->adev->dev);
52 mutex_unlock(&pf->adev_mutex);
57 * @pf: PF struct
60 int ice_add_rdma_qset(struct ice_pf *pf, struct iidc_rdma_qset_params *qset)
70 if (WARN_ON(!pf || !qset))
73 dev = ice_pf_to_dev(pf);
75 if (!ice_is_rdma_ena(pf))
78 vsi = ice_get_main_vsi(pf);
112 * @pf: PF struct
115 int ice_del_rdma_qset(struct ice_pf *pf, struct iidc_rdma_qset_params *qset)
121 if (WARN_ON(!pf || !qset))
124 vsi = ice_find_vsi(pf, qset->vport_id);
126 dev_err(ice_pf_to_dev(pf), "RDMA Invalid VSI\n");
141 * @pf: struct for PF
144 int ice_rdma_request_reset(struct ice_pf *pf, enum iidc_reset_type reset_type)
148 if (WARN_ON(!pf))
162 dev_err(ice_pf_to_dev(pf), "incorrect reset request\n");
166 return ice_schedule_reset(pf, reset);
172 * @pf: pointer to struct for PF
176 int ice_rdma_update_vsi_filter(struct ice_pf *pf, u16 vsi_id, bool enable)
181 if (WARN_ON(!pf))
184 vsi = ice_find_vsi(pf, vsi_id);
188 status = ice_cfg_rdma_fltr(&pf->hw, vsi->idx, enable);
190 dev_err(ice_pf_to_dev(pf), "Failed to %sable RDMA filtering\n",
205 * @pf: pointer to PF struct
208 void ice_get_qos_params(struct ice_pf *pf, struct iidc_qos_params *qos)
214 dcbx_cfg = &pf->hw.port_info->qos_cfg.local_dcbx_cfg;
215 up2tc = rd32(&pf->hw, PRTDCB_TUP2TC);
233 * @pf: board private structure to initialize
235 static int ice_alloc_rdma_qvectors(struct ice_pf *pf)
237 if (ice_is_rdma_ena(pf)) {
240 pf->msix_entries = kcalloc(pf->num_rdma_msix,
241 sizeof(*pf->msix_entries),
243 if (!pf->msix_entries)
246 /* RDMA is the only user of pf->msix_entries array */
247 pf->rdma_base_vector = 0;
249 for (i = 0; i < pf->num_rdma_msix; i++) {
250 struct msix_entry *entry = &pf->msix_entries[i];
253 map = ice_alloc_irq(pf, false);
266 * @pf: board private structure to initialize
268 static void ice_free_rdma_qvector(struct ice_pf *pf)
272 if (!pf->msix_entries)
275 for (i = 0; i < pf->num_rdma_msix; i++) {
278 map.index = pf->msix_entries[i].entry;
279 map.virq = pf->msix_entries[i].vector;
280 ice_free_irq(pf, map);
283 kfree(pf->msix_entries);
284 pf->msix_entries = NULL;
301 * @pf: pointer to pf struct
303 int ice_plug_aux_dev(struct ice_pf *pf)
312 if (!ice_is_rdma_ena(pf))
320 iadev->pf = pf;
322 adev->id = pf->aux_idx;
324 adev->dev.parent = &pf->pdev->dev;
325 adev->name = pf->rdma_mode & IIDC_RDMA_PROTOCOL_ROCEV2 ? "roce" : "iwarp";
339 mutex_lock(&pf->adev_mutex);
340 pf->adev = adev;
341 mutex_unlock(&pf->adev_mutex);
347 * @pf: pointer to pf struct
349 void ice_unplug_aux_dev(struct ice_pf *pf)
353 mutex_lock(&pf->adev_mutex);
354 adev = pf->adev;
355 pf->adev = NULL;
356 mutex_unlock(&pf->adev_mutex);
366 * @pf: ptr to ice_pf
368 int ice_init_rdma(struct ice_pf *pf)
370 struct device *dev = &pf->pdev->dev;
373 if (!ice_is_rdma_ena(pf)) {
378 ret = xa_alloc(&ice_aux_id, &pf->aux_idx, NULL, XA_LIMIT(1, INT_MAX),
386 ret = ice_alloc_rdma_qvectors(pf);
391 pf->rdma_mode |= IIDC_RDMA_PROTOCOL_ROCEV2;
392 ret = ice_plug_aux_dev(pf);
398 ice_free_rdma_qvector(pf);
400 pf->adev = NULL;
401 xa_erase(&ice_aux_id, pf->aux_idx);
407 * @pf: ptr to ice_pf
409 void ice_deinit_rdma(struct ice_pf *pf)
411 if (!ice_is_rdma_ena(pf))
414 ice_unplug_aux_dev(pf);
415 ice_free_rdma_qvector(pf);
416 xa_erase(&ice_aux_id, pf->aux_idx);