/* Inter-Driver Communication */ #include"ice.h" #include"ice_lib.h" #include"ice_dcb_lib.h"
static DEFINE_XARRAY_ALLOC1(ice_aux_id);
/** * ice_get_auxiliary_drv - retrieve iidc_rdma_core_auxiliary_drv struct * @cdev: pointer to iidc_rdma_core_dev_info struct * * This function has to be called with a device_lock on the * cdev->adev.dev to avoid race conditions. * * Return: pointer to the matched auxiliary driver struct
*/ staticstruct iidc_rdma_core_auxiliary_drv *
ice_get_auxiliary_drv(struct iidc_rdma_core_dev_info *cdev)
{ struct auxiliary_device *adev;
adev = cdev->adev; if (!adev || !adev->dev.driver) return NULL;
/** * ice_rdma_request_reset - accept request from RDMA to perform a reset * @cdev: pointer to iidc_rdma_core_dev_info struct * @reset_type: type of reset * * Return: Zero on success, error code on failure
*/ int ice_rdma_request_reset(struct iidc_rdma_core_dev_info *cdev, enum iidc_rdma_reset_type reset_type)
{ enum ice_reset_req reset; struct ice_pf *pf;
if (WARN_ON(!cdev)) return -EINVAL;
pf = pci_get_drvdata(cdev->pdev);
switch (reset_type) { case IIDC_FUNC_RESET:
reset = ICE_RESET_PFR; break; case IIDC_DEV_RESET:
reset = ICE_RESET_CORER; break; default: return -EINVAL;
}
/** * ice_rdma_update_vsi_filter - update main VSI filters for RDMA * @cdev: pointer to iidc_rdma_core_dev_info struct * @vsi_id: VSI HW idx to update filter on * @enable: bool whether to enable or disable filters * * Return: Zero on success, error code on failure
*/ int ice_rdma_update_vsi_filter(struct iidc_rdma_core_dev_info *cdev,
u16 vsi_id, bool enable)
{ struct ice_vsi *vsi; struct ice_pf *pf; int status;
if (WARN_ON(!cdev)) return -EINVAL;
pf = pci_get_drvdata(cdev->pdev);
vsi = ice_find_vsi(pf, vsi_id); if (!vsi) return -EINVAL;
status = ice_cfg_rdma_fltr(&pf->hw, vsi->idx, enable); if (status) {
dev_err(ice_pf_to_dev(pf), "Failed to %sable RDMA filtering\n",
enable ? "en" : "dis");
} else { if (enable)
vsi->info.q_opt_flags |= ICE_AQ_VSI_Q_OPT_PE_FLTR_EN; else
vsi->info.q_opt_flags &= ~ICE_AQ_VSI_Q_OPT_PE_FLTR_EN;
}
/** * ice_adev_release - function to be mapped to AUX dev's release op * @dev: pointer to device to free
*/ staticvoid ice_adev_release(struct device *dev)
{ struct iidc_rdma_core_auxiliary_dev *iadev;
/** * ice_init_rdma - initializes PF for RDMA use * @pf: ptr to ice_pf
*/ int ice_init_rdma(struct ice_pf *pf)
{ struct iidc_rdma_priv_dev_info *privd; struct device *dev = &pf->pdev->dev; struct iidc_rdma_core_dev_info *cdev; int ret;
if (!ice_is_rdma_ena(pf)) {
dev_warn(dev, "RDMA is not supported on this device\n"); return 0;
}
cdev = kzalloc(sizeof(*cdev), GFP_KERNEL); if (!cdev) return -ENOMEM;
pf->cdev_info = cdev;
privd = kzalloc(sizeof(*privd), GFP_KERNEL); if (!privd) {
ret = -ENOMEM; goto err_privd_alloc;
}
privd->pf_id = pf->hw.pf_id;
ret = xa_alloc(&ice_aux_id, &pf->aux_idx, NULL, XA_LIMIT(1, INT_MAX),
GFP_KERNEL); if (ret) {
dev_err(dev, "Failed to allocate device ID for AUX driver\n");
ret = -ENOMEM; goto err_alloc_xa;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.