diff --git a/sys/dev/qat/qat_api/qat_kernel/src/lac_adf_interface_freebsd.c b/sys/dev/qat/qat_api/qat_kernel/src/lac_adf_interface_freebsd.c index 7669e21eeaa1..fc75178946c4 100644 --- a/sys/dev/qat/qat_api/qat_kernel/src/lac_adf_interface_freebsd.c +++ b/sys/dev/qat/qat_api/qat_kernel/src/lac_adf_interface_freebsd.c @@ -1,424 +1,426 @@ /* SPDX-License-Identifier: BSD-3-Clause */ /* Copyright(c) 2007-2022 Intel Corporation */ /* $FreeBSD$ */ #include "adf_cfg.h" #include "cpa.h" #include "icp_accel_devices.h" #include "adf_common_drv.h" +#include "icp_adf_accel_mgr.h" +#include "icp_adf_cfg.h" #include "icp_adf_debug.h" #include "icp_adf_init.h" #include "lac_sal_ctrl.h" static subservice_registation_handle_t *salService = NULL; static struct service_hndl adfService = { 0 }; static icp_accel_dev_t *adfDevices = NULL; static icp_accel_dev_t *adfDevicesHead = NULL; struct mtx *adfDevicesLock; /* * Need to keep track of what device is currently in reset state */ static char accel_dev_reset_stat[ADF_MAX_DEVICES] = { 0 }; /* * Need to keep track of what device is currently in error state */ static char accel_dev_error_stat[ADF_MAX_DEVICES] = { 0 }; /* * Need to preserve sal handle during restart */ static void *accel_dev_sal_hdl_ptr[ADF_MAX_DEVICES] = { 0 }; static icp_accel_dev_t * create_adf_dev_structure(struct adf_accel_dev *accel_dev) { icp_accel_dev_t *adf = NULL; struct adf_hw_device_data *hw_data = accel_dev->hw_device; adf = malloc(sizeof(*adf), M_QAT, M_WAITOK); memset(adf, 0, sizeof(*adf)); adf->accelId = accel_dev->accel_id; adf->pAccelName = (char *)hw_data->dev_class->name; adf->deviceType = (device_type_t)hw_data->dev_class->type; strlcpy(adf->deviceName, hw_data->dev_class->name, sizeof(adf->deviceName)); adf->accelCapabilitiesMask = hw_data->accel_capabilities_mask; adf->sku = hw_data->get_sku(hw_data); adf->accel_dev = accel_dev; accel_dev->lac_dev = adf; return adf; } /* * adf_event_handler * Handle device init/uninit/start/stop event */ static CpaStatus adf_event_handler(struct adf_accel_dev *accel_dev, enum adf_event event) { CpaStatus status = CPA_STATUS_FAIL; icp_accel_dev_t *adf = NULL; if (!adf_cfg_sec_find(accel_dev, ADF_KERNEL_SAL_SEC)) { return CPA_STATUS_SUCCESS; } if (event == ADF_EVENT_INIT) { adf = create_adf_dev_structure(accel_dev); if (NULL == adf) { return CPA_STATUS_FAIL; } if (accel_dev_sal_hdl_ptr[accel_dev->accel_id]) { adf->pSalHandle = accel_dev_sal_hdl_ptr[accel_dev->accel_id]; accel_dev_sal_hdl_ptr[accel_dev->accel_id] = NULL; } qatUtilsMutexLock(&adfDevicesLock, QAT_UTILS_WAIT_FOREVER); ICP_ADD_ELEMENT_TO_END_OF_LIST(adf, adfDevices, adfDevicesHead); qatUtilsMutexUnlock(&adfDevicesLock); } else { adf = accel_dev->lac_dev; } if (event == ADF_EVENT_START) { adf->dcExtendedFeatures = accel_dev->hw_device->extended_dc_capabilities; } if (event == ADF_EVENT_RESTARTING) { accel_dev_reset_stat[accel_dev->accel_id] = 1; accel_dev_sal_hdl_ptr[accel_dev->accel_id] = adf->pSalHandle; } if (event == ADF_EVENT_RESTARTED) { accel_dev_reset_stat[accel_dev->accel_id] = 0; accel_dev_error_stat[accel_dev->accel_id] = 0; } status = salService->subserviceEventHandler(adf, (icp_adf_subsystemEvent_t)event, NULL); if (event == ADF_EVENT_ERROR) { accel_dev_error_stat[accel_dev->accel_id] = 1; } if ((status == CPA_STATUS_SUCCESS && event == ADF_EVENT_SHUTDOWN) || (status != CPA_STATUS_SUCCESS && event == ADF_EVENT_INIT)) { qatUtilsMutexLock(&adfDevicesLock, QAT_UTILS_WAIT_FOREVER); ICP_REMOVE_ELEMENT_FROM_LIST(adf, adfDevices, adfDevicesHead); qatUtilsMutexUnlock(&adfDevicesLock); accel_dev->lac_dev = NULL; free(adf, M_QAT); } if (status == CPA_STATUS_SUCCESS && event == ADF_EVENT_START) { qatUtilsMutexLock(&adfDevicesLock, QAT_UTILS_WAIT_FOREVER); adf->adfSubsystemStatus = 1; qatUtilsMutexUnlock(&adfDevicesLock); } if ((status == CPA_STATUS_SUCCESS && event == ADF_EVENT_STOP) || (status == CPA_STATUS_RETRY && event == ADF_EVENT_STOP)) { qatUtilsMutexLock(&adfDevicesLock, QAT_UTILS_WAIT_FOREVER); adf->adfSubsystemStatus = 0; qatUtilsMutexUnlock(&adfDevicesLock); status = CPA_STATUS_SUCCESS; } return status; } /* * icp_adf_subsystemRegister * adapter function from SAL to adf driver * call adf_service_register from adf driver directly with same * parameters */ CpaStatus icp_adf_subsystemRegister( subservice_registation_handle_t *sal_service_reg_handle) { if (salService != NULL) return CPA_STATUS_FAIL; salService = sal_service_reg_handle; adfService.name = sal_service_reg_handle->subsystem_name; adfService.event_hld = adf_event_handler; if (adf_service_register(&adfService) == 0) { return CPA_STATUS_SUCCESS; } else { salService = NULL; return CPA_STATUS_FAIL; } } /* * icp_adf_subsystemUnegister * adapter function from SAL to adf driver */ CpaStatus icp_adf_subsystemUnregister( subservice_registation_handle_t *sal_service_reg_handle) { if (adf_service_unregister(&adfService) == 0) { salService = NULL; return CPA_STATUS_SUCCESS; } else { return CPA_STATUS_FAIL; } } /* * icp_adf_cfgGetParamValue * get parameter value from section @section with key @param */ CpaStatus icp_adf_cfgGetParamValue(icp_accel_dev_t *adf, const char *section, const char *param, char *value) { if (adf_cfg_get_param_value(adf->accel_dev, section, param, value) == 0) { return CPA_STATUS_SUCCESS; } else { return CPA_STATUS_FAIL; } } CpaBoolean icp_adf_is_dev_in_reset(icp_accel_dev_t *accel_dev) { return (CpaBoolean)accel_dev_reset_stat[accel_dev->accelId]; } CpaStatus icp_adf_debugAddDir(icp_accel_dev_t *adf, debug_dir_info_t *dir_info) { return CPA_STATUS_SUCCESS; } void icp_adf_debugRemoveDir(debug_dir_info_t *dir_info) { } CpaStatus icp_adf_debugAddFile(icp_accel_dev_t *adf, debug_file_info_t *file_info) { return CPA_STATUS_SUCCESS; } void icp_adf_debugRemoveFile(debug_file_info_t *file_info) { } /* * icp_adf_getAccelDevByAccelId * return acceleration device with id @accelId */ icp_accel_dev_t * icp_adf_getAccelDevByAccelId(Cpa32U accelId) { icp_accel_dev_t *adf = NULL; qatUtilsMutexLock(&adfDevicesLock, QAT_UTILS_WAIT_FOREVER); adf = adfDevicesHead; while (adf != NULL && adf->accelId != accelId) adf = adf->pNext; qatUtilsMutexUnlock(&adfDevicesLock); return adf; } /* * icp_amgr_getNumInstances * Return the number of acceleration devices it the system. */ CpaStatus icp_amgr_getNumInstances(Cpa16U *pNumInstances) { icp_accel_dev_t *adf = NULL; Cpa16U count = 0; qatUtilsMutexLock(&adfDevicesLock, QAT_UTILS_WAIT_FOREVER); for (adf = adfDevicesHead; adf != NULL; adf = adf->pNext) count++; qatUtilsMutexUnlock(&adfDevicesLock); *pNumInstances = count; return CPA_STATUS_SUCCESS; } /* * icp_amgr_getAccelDevByCapabilities * Returns a started accel device that implements * the capabilities specified in capabilitiesMask. */ CpaStatus icp_amgr_getAccelDevByCapabilities(Cpa32U capabilitiesMask, icp_accel_dev_t **pAccel_devs, Cpa16U *pNumInstances) { icp_accel_dev_t *adf = NULL; *pNumInstances = 0; qatUtilsMutexLock(&adfDevicesLock, QAT_UTILS_WAIT_FOREVER); for (adf = adfDevicesHead; adf != NULL; adf = adf->pNext) { if (adf->accelCapabilitiesMask & capabilitiesMask) { if (adf->adfSubsystemStatus) { pAccel_devs[0] = adf; *pNumInstances = 1; qatUtilsMutexUnlock(&adfDevicesLock); return CPA_STATUS_SUCCESS; } } } qatUtilsMutexUnlock(&adfDevicesLock); return CPA_STATUS_FAIL; } /* * icp_amgr_getAllAccelDevByEachCapabilities * Returns table of accel devices that are started and implement * each of the capabilities specified in capabilitiesMask. */ CpaStatus icp_amgr_getAllAccelDevByEachCapability(Cpa32U capabilitiesMask, icp_accel_dev_t **pAccel_devs, Cpa16U *pNumInstances) { icp_accel_dev_t *adf = NULL; *pNumInstances = 0; qatUtilsMutexLock(&adfDevicesLock, QAT_UTILS_WAIT_FOREVER); for (adf = adfDevicesHead; adf != NULL; adf = adf->pNext) { Cpa32U enabled_caps = adf->accelCapabilitiesMask & capabilitiesMask; if (enabled_caps == capabilitiesMask) { if (adf->adfSubsystemStatus) { pAccel_devs[(*pNumInstances)++] = (icp_accel_dev_t *)adf; } } } qatUtilsMutexUnlock(&adfDevicesLock); return CPA_STATUS_SUCCESS; } /* * icp_amgr_getAllAccelDevByCapabilities * Fetches accel devices based on the capability * and returns the count of the device */ CpaStatus icp_amgr_getAllAccelDevByCapabilities(Cpa32U capabilitiesMask, icp_accel_dev_t **pAccel_devs, Cpa16U *pNumInstances) { icp_accel_dev_t *adf = NULL; Cpa16U i = 0; qatUtilsMutexLock(&adfDevicesLock, QAT_UTILS_WAIT_FOREVER); for (adf = adfDevicesHead; adf != NULL; adf = adf->pNext) { if (adf->accelCapabilitiesMask & capabilitiesMask) { if (adf->adfSubsystemStatus) { pAccel_devs[i++] = adf; } } } qatUtilsMutexUnlock(&adfDevicesLock); *pNumInstances = i; return CPA_STATUS_SUCCESS; } /* * icp_amgr_getAccelDevCapabilities * Returns accel devices capabilities specified in capabilitiesMask. * * Returns: * CPA_STATUS_SUCCESS on success * CPA_STATUS_FAIL on failure */ CpaStatus icp_amgr_getAccelDevCapabilities(icp_accel_dev_t *accel_dev, Cpa32U *pCapabilitiesMask) { ICP_CHECK_FOR_NULL_PARAM(accel_dev); ICP_CHECK_FOR_NULL_PARAM(pCapabilitiesMask); *pCapabilitiesMask = accel_dev->accelCapabilitiesMask; return CPA_STATUS_SUCCESS; } /* * icp_qa_dev_get * * Description: * Function increments the device usage counter. * * Returns: void */ void icp_qa_dev_get(icp_accel_dev_t *pDev) { ICP_CHECK_FOR_NULL_PARAM_VOID(pDev); adf_dev_get(pDev->accel_dev); } /* * icp_qa_dev_put * * Description: * Function decrements the device usage counter. * * Returns: void */ void icp_qa_dev_put(icp_accel_dev_t *pDev) { ICP_CHECK_FOR_NULL_PARAM_VOID(pDev); adf_dev_put(pDev->accel_dev); } Cpa16U icp_adf_get_busAddress(Cpa16U packageId) { Cpa16U busAddr = 0xFFFF; icp_accel_dev_t *adf = NULL; qatUtilsMutexLock(&adfDevicesLock, QAT_UTILS_WAIT_FOREVER); for (adf = adfDevicesHead; adf != NULL; adf = adf->pNext) { if (adf->accelId == packageId) { busAddr = pci_get_bus(accel_to_pci_dev(adf->accel_dev)) << 8 | pci_get_slot(accel_to_pci_dev(adf->accel_dev)) << 3 | pci_get_function(accel_to_pci_dev(adf->accel_dev)); break; } } qatUtilsMutexUnlock(&adfDevicesLock); return busAddr; } CpaBoolean icp_adf_isSubsystemStarted(subservice_registation_handle_t *subsystem_hdl) { if (subsystem_hdl == salService) return CPA_TRUE; else return CPA_FALSE; } CpaBoolean icp_adf_is_dev_in_error(icp_accel_dev_t *accel_dev) { return (CpaBoolean)accel_dev_error_stat[accel_dev->accelId]; } diff --git a/sys/dev/qat/qat_api/qat_kernel/src/qat_transport.c b/sys/dev/qat/qat_api/qat_kernel/src/qat_transport.c index f8aa6e0ac3e3..739cd026eedf 100644 --- a/sys/dev/qat/qat_api/qat_kernel/src/qat_transport.c +++ b/sys/dev/qat/qat_api/qat_kernel/src/qat_transport.c @@ -1,426 +1,429 @@ /* SPDX-License-Identifier: BSD-3-Clause */ /* Copyright(c) 2007-2022 Intel Corporation */ /* $FreeBSD$ */ #include "adf_transport_access_macros.h" #include "adf_transport_internal.h" #include "cpa.h" #include "icp_adf_init.h" +#include "icp_adf_transport.h" +#include "icp_adf_poll.h" #include "icp_adf_transport_dp.h" +#include "icp_sal_poll.h" /* * adf_modulo * result = data % ( 2 ^ shift ) */ static inline Cpa32U adf_modulo(Cpa32U data, Cpa32U shift) { Cpa32U div = data >> shift; Cpa32U mult = div << shift; return data - mult; } /* * icp_adf_transCreateHandle * crete transport handle for a service * call adf_create_ring from adf driver directly with same parameters */ CpaStatus icp_adf_transCreateHandle(icp_accel_dev_t *adf, icp_transport_type trans_type, const char *section, const uint32_t accel_nr, const uint32_t bank_nr, const char *service_name, const icp_adf_ringInfoService_t info, icp_trans_callback callback, icp_resp_deliv_method resp, const uint32_t num_msgs, const uint32_t msg_size, icp_comms_trans_handle *trans_handle) { CpaStatus status; int error; ICP_CHECK_FOR_NULL_PARAM(trans_handle); ICP_CHECK_FOR_NULL_PARAM(adf); error = adf_create_ring(adf->accel_dev, section, bank_nr, num_msgs, msg_size, service_name, callback, ((resp == ICP_RESP_TYPE_IRQ) ? 0 : 1), (struct adf_etr_ring_data **)trans_handle); if (!error) status = CPA_STATUS_SUCCESS; else status = CPA_STATUS_FAIL; return status; } /* * icp_adf_transReinitHandle * Reinitialize transport handle for a service */ CpaStatus icp_adf_transReinitHandle(icp_accel_dev_t *adf, icp_transport_type trans_type, const char *section, const uint32_t accel_nr, const uint32_t bank_nr, const char *service_name, const icp_adf_ringInfoService_t info, icp_trans_callback callback, icp_resp_deliv_method resp, const uint32_t num_msgs, const uint32_t msg_size, icp_comms_trans_handle *trans_handle) { return CPA_STATUS_SUCCESS; } /* * icp_adf_transReleaseHandle * destroy a transport handle, call adf_remove_ring from adf driver directly */ CpaStatus icp_adf_transReleaseHandle(icp_comms_trans_handle trans_handle) { struct adf_etr_ring_data *ring = trans_handle; ICP_CHECK_FOR_NULL_PARAM(ring); adf_remove_ring(ring); return CPA_STATUS_SUCCESS; } /* * icp_adf_transResetHandle * clean a transport handle, call adf_remove_ring from adf driver directly */ CpaStatus icp_adf_transResetHandle(icp_comms_trans_handle trans_handle) { return CPA_STATUS_SUCCESS; } /* * icp_adf_transGetRingNum * get ring number from a transport handle */ CpaStatus icp_adf_transGetRingNum(icp_comms_trans_handle trans_handle, uint32_t *ringNum) { struct adf_etr_ring_data *ring = trans_handle; ICP_CHECK_FOR_NULL_PARAM(ring); ICP_CHECK_FOR_NULL_PARAM(ringNum); *ringNum = (uint32_t)(ring->ring_number); return CPA_STATUS_SUCCESS; } /* * icp_adf_transPutMsg * send a request to transport handle * call adf_send_message from adf driver directly */ CpaStatus icp_adf_transPutMsg(icp_comms_trans_handle trans_handle, uint32_t *inBuf, uint32_t bufLen) { struct adf_etr_ring_data *ring = trans_handle; CpaStatus status = CPA_STATUS_FAIL; int error = EFAULT; ICP_CHECK_FOR_NULL_PARAM(ring); error = adf_send_message(ring, inBuf); if (EAGAIN == error) status = CPA_STATUS_RETRY; else if (0 == error) status = CPA_STATUS_SUCCESS; else status = CPA_STATUS_FAIL; return status; } CpaStatus icp_adf_getInflightRequests(icp_comms_trans_handle trans_handle, Cpa32U *maxInflightRequests, Cpa32U *numInflightRequests) { struct adf_etr_ring_data *ring = trans_handle; ICP_CHECK_FOR_NULL_PARAM(ring); ICP_CHECK_FOR_NULL_PARAM(maxInflightRequests); ICP_CHECK_FOR_NULL_PARAM(numInflightRequests); /* * XXX: The qat_direct version of this routine returns max - 1, not * the absolute max. */ *numInflightRequests = (*(uint32_t *)ring->inflights); *maxInflightRequests = ADF_MAX_INFLIGHTS(ring->ring_size, ring->msg_size); return CPA_STATUS_SUCCESS; } CpaStatus icp_adf_dp_getInflightRequests(icp_comms_trans_handle trans_handle, Cpa32U *maxInflightRequests, Cpa32U *numInflightRequests) { ICP_CHECK_FOR_NULL_PARAM(trans_handle); ICP_CHECK_FOR_NULL_PARAM(maxInflightRequests); ICP_CHECK_FOR_NULL_PARAM(numInflightRequests); return icp_adf_getInflightRequests(trans_handle, maxInflightRequests, numInflightRequests); } /* * This function allows the user to poll the response ring. The * ring number to be polled is supplied by the user via the * trans handle for that ring. The trans_hnd is a pointer * to an array of trans handles. This ring is * only polled if it contains data. * This method is used as an alternative to the reading messages * via the ISR method. * This function will return RETRY if the ring is empty. */ CpaStatus icp_adf_pollInstance(icp_comms_trans_handle *trans_hnd, Cpa32U num_transHandles, Cpa32U response_quota) { Cpa32U resp_total = 0; Cpa32U num_resp; struct adf_etr_ring_data *ring = NULL; struct adf_etr_bank_data *bank = NULL; Cpa32U i; ICP_CHECK_FOR_NULL_PARAM(trans_hnd); for (i = 0; i < num_transHandles; i++) { ring = trans_hnd[i]; if (!ring) continue; bank = ring->bank; /* If the ring in question is empty try the next ring.*/ if (!bank || !bank->ring_mask) { continue; } num_resp = adf_handle_response(ring, response_quota); resp_total += num_resp; } /* If any of the rings in the instance had data and was polled * return SUCCESS. */ if (resp_total) return CPA_STATUS_SUCCESS; else return CPA_STATUS_RETRY; } /* * This function allows the user to check the response ring. The * ring number to be polled is supplied by the user via the * trans handle for that ring. The trans_hnd is a pointer * to an array of trans handles. * This function now is a empty function. */ CpaStatus icp_adf_check_RespInstance(icp_comms_trans_handle *trans_hnd, Cpa32U num_transHandles) { return CPA_STATUS_SUCCESS; } /* * icp_sal_pollBank * poll bank with id bank_number inside acceleration device with id @accelId */ CpaStatus icp_sal_pollBank(Cpa32U accelId, Cpa32U bank_number, Cpa32U response_quota) { int ret; ret = adf_poll_bank(accelId, bank_number, response_quota); if (!ret) return CPA_STATUS_SUCCESS; else if (EAGAIN == ret) return CPA_STATUS_RETRY; return CPA_STATUS_FAIL; } /* * icp_sal_pollAllBanks * poll all banks inside acceleration device with id @accelId */ CpaStatus icp_sal_pollAllBanks(Cpa32U accelId, Cpa32U response_quota) { int ret = 0; ret = adf_poll_all_banks(accelId, response_quota); if (!ret) return CPA_STATUS_SUCCESS; else if (ret == EAGAIN) return CPA_STATUS_RETRY; return CPA_STATUS_FAIL; } /* * icp_adf_getQueueMemory * Data plane support function - returns the pointer to next message on the ring * or NULL if there is not enough space. */ void icp_adf_getQueueMemory(icp_comms_trans_handle trans_handle, Cpa32U numberRequests, void **pCurrentQatMsg) { struct adf_etr_ring_data *ring = trans_handle; Cpa64U flight; ICP_CHECK_FOR_NULL_PARAM_VOID(ring); /* Check if there is enough space in the ring */ flight = atomic_add_return(numberRequests, ring->inflights); if (flight > ADF_MAX_INFLIGHTS(ring->ring_size, ring->msg_size)) { atomic_sub(numberRequests, ring->inflights); *pCurrentQatMsg = NULL; return; } /* We have enough space - get the address of next message */ *pCurrentQatMsg = (void *)((uintptr_t)ring->base_addr + ring->tail); } /* * icp_adf_getSingleQueueAddr * Data plane support function - returns the pointer to next message on the ring * or NULL if there is not enough space - it also updates the shadow tail copy. */ void icp_adf_getSingleQueueAddr(icp_comms_trans_handle trans_handle, void **pCurrentQatMsg) { struct adf_etr_ring_data *ring = trans_handle; Cpa64U flight; ICP_CHECK_FOR_NULL_PARAM_VOID(ring); ICP_CHECK_FOR_NULL_PARAM_VOID(pCurrentQatMsg); /* Check if there is enough space in the ring */ flight = atomic_add_return(1, ring->inflights); if (flight > ADF_MAX_INFLIGHTS(ring->ring_size, ring->msg_size)) { atomic_dec(ring->inflights); *pCurrentQatMsg = NULL; return; } /* We have enough space - get the address of next message */ *pCurrentQatMsg = (void *)((uintptr_t)ring->base_addr + ring->tail); /* Update the shadow tail */ ring->tail = adf_modulo(ring->tail + ADF_MSG_SIZE_TO_BYTES(ring->msg_size), ADF_RING_SIZE_MODULO(ring->ring_size)); } /* * icp_adf_getQueueNext * Data plane support function - increments the tail pointer and returns * the pointer to next message on the ring. */ void icp_adf_getQueueNext(icp_comms_trans_handle trans_handle, void **pCurrentQatMsg) { struct adf_etr_ring_data *ring = trans_handle; ICP_CHECK_FOR_NULL_PARAM_VOID(ring); ICP_CHECK_FOR_NULL_PARAM_VOID(pCurrentQatMsg); /* Increment tail to next message */ ring->tail = adf_modulo(ring->tail + ADF_MSG_SIZE_TO_BYTES(ring->msg_size), ADF_RING_SIZE_MODULO(ring->ring_size)); /* Get the address of next message */ *pCurrentQatMsg = (void *)((uintptr_t)ring->base_addr + ring->tail); } /* * icp_adf_updateQueueTail * Data plane support function - Writes the tail shadow copy to the device. */ void icp_adf_updateQueueTail(icp_comms_trans_handle trans_handle) { struct adf_etr_ring_data *ring = trans_handle; ICP_CHECK_FOR_NULL_PARAM_VOID(ring); WRITE_CSR_RING_TAIL(ring->bank->csr_addr, ring->bank->bank_number, ring->ring_number, ring->tail); ring->csr_tail_offset = ring->tail; } /* * icp_adf_pollQueue * Data plane support function - Poll messages from the queue. */ CpaStatus icp_adf_pollQueue(icp_comms_trans_handle trans_handle, Cpa32U response_quota) { Cpa32U num_resp; struct adf_etr_ring_data *ring = trans_handle; ICP_CHECK_FOR_NULL_PARAM(ring); num_resp = adf_handle_response(ring, response_quota); if (num_resp) return CPA_STATUS_SUCCESS; else return CPA_STATUS_RETRY; } /* * icp_adf_queueDataToSend * Data-plane support function - Indicates if there is data on the ring to be * sent. This should only be called on request rings. If the function returns * true then it is ok to call icp_adf_updateQueueTail() function on this ring. */ CpaBoolean icp_adf_queueDataToSend(icp_comms_trans_handle trans_handle) { struct adf_etr_ring_data *ring = trans_handle; if (ring->tail != ring->csr_tail_offset) return CPA_TRUE; else return CPA_FALSE; } /* * This icp API won't be supported in kernel space currently */ CpaStatus icp_adf_transGetFdForHandle(icp_comms_trans_handle trans_hnd, int *fd) { return CPA_STATUS_UNSUPPORTED; }