Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/qat/qat_api/common/crypto/sym/lac_sym_api.c
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | |||||
#include "lac_sym_qat_hash_defs_lookup.h" | #include "lac_sym_qat_hash_defs_lookup.h" | ||||
#include "lac_sym_cb.h" | #include "lac_sym_cb.h" | ||||
#include "lac_buffer_desc.h" | #include "lac_buffer_desc.h" | ||||
#include "lac_sync.h" | #include "lac_sync.h" | ||||
#include "lac_hooks.h" | #include "lac_hooks.h" | ||||
#include "lac_sal_types_crypto.h" | #include "lac_sal_types_crypto.h" | ||||
#include "sal_service_state.h" | #include "sal_service_state.h" | ||||
#define IS_EXT_ALG_CHAIN_UNSUPPORTED( \ | #define IS_EXT_ALG_CHAIN_UNSUPPORTED(cipherAlgorithm, \ | ||||
cipherAlgorithm, hashAlgorithm, extAlgchainSupported) \ | hashAlgorithm, \ | ||||
extAlgchainSupported) \ | |||||
((((CPA_CY_SYM_CIPHER_ZUC_EEA3 == cipherAlgorithm || \ | ((((CPA_CY_SYM_CIPHER_ZUC_EEA3 == cipherAlgorithm || \ | ||||
CPA_CY_SYM_CIPHER_SNOW3G_UEA2 == cipherAlgorithm) && \ | CPA_CY_SYM_CIPHER_SNOW3G_UEA2 == cipherAlgorithm) && \ | ||||
CPA_CY_SYM_HASH_AES_CMAC == hashAlgorithm) || \ | CPA_CY_SYM_HASH_AES_CMAC == hashAlgorithm) || \ | ||||
((CPA_CY_SYM_CIPHER_NULL == cipherAlgorithm || \ | ((CPA_CY_SYM_CIPHER_NULL == cipherAlgorithm || \ | ||||
CPA_CY_SYM_CIPHER_AES_CTR == cipherAlgorithm || \ | CPA_CY_SYM_CIPHER_AES_CTR == cipherAlgorithm || \ | ||||
CPA_CY_SYM_CIPHER_ZUC_EEA3 == cipherAlgorithm) && \ | CPA_CY_SYM_CIPHER_ZUC_EEA3 == cipherAlgorithm) && \ | ||||
CPA_CY_SYM_HASH_SNOW3G_UIA2 == hashAlgorithm) || \ | CPA_CY_SYM_HASH_SNOW3G_UIA2 == hashAlgorithm) || \ | ||||
((CPA_CY_SYM_CIPHER_NULL == cipherAlgorithm || \ | ((CPA_CY_SYM_CIPHER_NULL == cipherAlgorithm || \ | ||||
CPA_CY_SYM_CIPHER_AES_CTR == cipherAlgorithm || \ | CPA_CY_SYM_CIPHER_AES_CTR == cipherAlgorithm || \ | ||||
CPA_CY_SYM_CIPHER_SNOW3G_UEA2 == cipherAlgorithm) && \ | CPA_CY_SYM_CIPHER_SNOW3G_UEA2 == cipherAlgorithm) && \ | ||||
CPA_CY_SYM_HASH_ZUC_EIA3 == hashAlgorithm)) && \ | CPA_CY_SYM_HASH_ZUC_EIA3 == hashAlgorithm)) && \ | ||||
!extAlgchainSupported) | !extAlgchainSupported) | ||||
/*** Local functions definitions ***/ | /*** Local functions definitions ***/ | ||||
static CpaStatus | static CpaStatus | ||||
LacSymPerform_BufferParamCheck(const CpaBufferList *const pSrcBuffer, | LacSymPerform_BufferParamCheck(const CpaBufferList *const pSrcBuffer, | ||||
const CpaBufferList *const pDstBuffer, | const CpaBufferList *const pDstBuffer, | ||||
const lac_session_desc_t *const pSessionDesc, | const lac_session_desc_t *const pSessionDesc, | ||||
const CpaCySymOpData *const pOpData); | const CpaCySymOpData *const pOpData); | ||||
void LacDp_WriteRingMsgFull(CpaCySymDpOpData *pRequest, | |||||
icp_qat_fw_la_bulk_req_t *pCurrentQatMsg); | |||||
void LacDp_WriteRingMsgOpt(CpaCySymDpOpData *pRequest, | |||||
icp_qat_fw_la_bulk_req_t *pCurrentQatMsg); | |||||
void getCtxSize(const CpaCySymSessionSetupData *pSessionSetupData, | void getCtxSize(const CpaCySymSessionSetupData *pSessionSetupData, | ||||
Cpa32U *pSessionCtxSizeInBytes); | Cpa32U *pSessionCtxSizeInBytes); | ||||
/** | /** | ||||
***************************************************************************** | ***************************************************************************** | ||||
* @ingroup LacSym | * @ingroup LacSym | ||||
* Generic bufferList callback function. | * Generic bufferList callback function. | ||||
* @description | * @description | ||||
▲ Show 20 Lines • Show All 58 Lines • ▼ Show 20 Lines | LacSymSession_ParamCheck(const CpaInstanceHandle instanceHandle, | ||||
/* Ensure cipher algorithm is correct and supported */ | /* Ensure cipher algorithm is correct and supported */ | ||||
if ((CPA_CY_SYM_OP_ALGORITHM_CHAINING == | if ((CPA_CY_SYM_OP_ALGORITHM_CHAINING == | ||||
pSessionSetupData->symOperation) || | pSessionSetupData->symOperation) || | ||||
(CPA_CY_SYM_OP_CIPHER == pSessionSetupData->symOperation)) { | (CPA_CY_SYM_OP_CIPHER == pSessionSetupData->symOperation)) { | ||||
/* Protect against value of cipher outside the bitmap | /* Protect against value of cipher outside the bitmap | ||||
* and check if cipher algorithm is correct | * and check if cipher algorithm is correct | ||||
*/ | */ | ||||
if ((pCipherSetupData->cipherAlgorithm >= | if (pCipherSetupData->cipherAlgorithm >= | ||||
CPA_CY_SYM_CIPHER_CAP_BITMAP_SIZE) || | CPA_CY_SYM_CIPHER_CAP_BITMAP_SIZE) { | ||||
(!CPA_BITMAP_BIT_TEST(capInfo.ciphers, | |||||
pCipherSetupData->cipherAlgorithm))) { | |||||
LAC_INVALID_PARAM_LOG("cipherAlgorithm"); | LAC_INVALID_PARAM_LOG("cipherAlgorithm"); | ||||
return CPA_STATUS_INVALID_PARAM; | return CPA_STATUS_INVALID_PARAM; | ||||
} | } | ||||
if (!CPA_BITMAP_BIT_TEST(capInfo.ciphers, | |||||
pCipherSetupData->cipherAlgorithm)) { | |||||
LAC_UNSUPPORTED_PARAM_LOG( | |||||
"UnSupported cipherAlgorithm"); | |||||
return CPA_STATUS_UNSUPPORTED; | |||||
} | } | ||||
} | |||||
/* Ensure hash algorithm is correct and supported */ | /* Ensure hash algorithm is correct and supported */ | ||||
if ((CPA_CY_SYM_OP_ALGORITHM_CHAINING == | if ((CPA_CY_SYM_OP_ALGORITHM_CHAINING == | ||||
pSessionSetupData->symOperation) || | pSessionSetupData->symOperation) || | ||||
(CPA_CY_SYM_OP_HASH == pSessionSetupData->symOperation)) { | (CPA_CY_SYM_OP_HASH == pSessionSetupData->symOperation)) { | ||||
/* Ensure SHAKE algorithms are not supported */ | |||||
if ((CPA_CY_SYM_HASH_SHAKE_128 == | |||||
pHashSetupData->hashAlgorithm) || | |||||
(CPA_CY_SYM_HASH_SHAKE_256 == | |||||
pHashSetupData->hashAlgorithm)) { | |||||
LAC_INVALID_PARAM_LOG( | |||||
"Hash algorithms SHAKE-128 and SHAKE-256 " | |||||
"are not supported."); | |||||
return CPA_STATUS_UNSUPPORTED; | |||||
} | |||||
/* Protect against value of hash outside the bitmap | /* Protect against value of hash outside the bitmap | ||||
* and check if hash algorithm is correct | * and check if hash algorithm is correct | ||||
*/ | */ | ||||
if ((pHashSetupData->hashAlgorithm >= | if (pHashSetupData->hashAlgorithm >= | ||||
CPA_CY_SYM_HASH_CAP_BITMAP_SIZE) || | CPA_CY_SYM_HASH_CAP_BITMAP_SIZE) { | ||||
(!CPA_BITMAP_BIT_TEST(capInfo.hashes, | |||||
pHashSetupData->hashAlgorithm))) { | |||||
LAC_INVALID_PARAM_LOG("hashAlgorithm"); | LAC_INVALID_PARAM_LOG("hashAlgorithm"); | ||||
return CPA_STATUS_INVALID_PARAM; | return CPA_STATUS_INVALID_PARAM; | ||||
} | } | ||||
if (!CPA_BITMAP_BIT_TEST(capInfo.hashes, | |||||
pHashSetupData->hashAlgorithm)) { | |||||
LAC_UNSUPPORTED_PARAM_LOG("UnSupported hashAlgorithm"); | |||||
return CPA_STATUS_UNSUPPORTED; | |||||
} | } | ||||
} | |||||
/* ensure CCM, GCM, Kasumi, Snow3G and ZUC cipher and hash algorithms | /* ensure CCM, GCM, Kasumi, Snow3G and ZUC cipher and hash algorithms | ||||
* are | * are selected together for Algorithm Chaining */ | ||||
* selected together for Algorithm Chaining */ | |||||
if (CPA_CY_SYM_OP_ALGORITHM_CHAINING == | if (CPA_CY_SYM_OP_ALGORITHM_CHAINING == | ||||
pSessionSetupData->symOperation) { | pSessionSetupData->symOperation) { | ||||
/* ensure both hash and cipher algorithms are POLY and CHACHA */ | /* ensure both hash and cipher algorithms are POLY and CHACHA */ | ||||
if (((CPA_CY_SYM_CIPHER_CHACHA == | if (((CPA_CY_SYM_CIPHER_CHACHA == | ||||
pCipherSetupData->cipherAlgorithm) && | pCipherSetupData->cipherAlgorithm) && | ||||
(CPA_CY_SYM_HASH_POLY != pHashSetupData->hashAlgorithm)) || | (CPA_CY_SYM_HASH_POLY != pHashSetupData->hashAlgorithm)) || | ||||
((CPA_CY_SYM_HASH_POLY == pHashSetupData->hashAlgorithm) && | ((CPA_CY_SYM_HASH_POLY == pHashSetupData->hashAlgorithm) && | ||||
(CPA_CY_SYM_CIPHER_CHACHA != | (CPA_CY_SYM_CIPHER_CHACHA != | ||||
▲ Show 20 Lines • Show All 229 Lines • ▼ Show 20 Lines | if (!((CPA_CY_SYM_OP_CIPHER != pSessionDesc->symOperation && | ||||
/* check MetaData !NULL */ | /* check MetaData !NULL */ | ||||
if (NULL == pDstBuffer->pPrivateMetaData) { | if (NULL == pDstBuffer->pPrivateMetaData) { | ||||
LAC_INVALID_PARAM_LOG( | LAC_INVALID_PARAM_LOG( | ||||
"Dest buffer MetaData cannot be NULL"); | "Dest buffer MetaData cannot be NULL"); | ||||
return CPA_STATUS_INVALID_PARAM; | return CPA_STATUS_INVALID_PARAM; | ||||
} | } | ||||
} | } | ||||
/* Check that src Buffer and dst Buffer Lengths are equal */ | /* Check that src Buffer and dst Buffer Lengths are equal */ | ||||
if (srcBufferLen != dstBufferLen) { | /* CCM output needs to be longer than input buffer for appending | ||||
* tag*/ | |||||
if (srcBufferLen != dstBufferLen && | |||||
pSessionDesc->cipherAlgorithm != | |||||
CPA_CY_SYM_CIPHER_AES_CCM) { | |||||
LAC_INVALID_PARAM_LOG( | LAC_INVALID_PARAM_LOG( | ||||
"Source and Dest buffer lengths need to be equal "); | "Source and Dest buffer lengths need to be equal "); | ||||
return CPA_STATUS_INVALID_PARAM; | return CPA_STATUS_INVALID_PARAM; | ||||
} | } | ||||
} | } | ||||
/* check for partial packet suport for the session operation */ | /* check for partial packet suport for the session operation */ | ||||
if (CPA_CY_SYM_PACKET_TYPE_FULL != pOpData->packetType) { | if (CPA_CY_SYM_PACKET_TYPE_FULL != pOpData->packetType) { | ||||
if (CPA_FALSE == pSessionDesc->isPartialSupported) { | if (CPA_FALSE == pSessionDesc->isPartialSupported) { | ||||
/* return out here to simplify cleanup */ | /* return out here to simplify cleanup */ | ||||
LAC_INVALID_PARAM_LOG( | LAC_INVALID_PARAM_LOG( | ||||
"Partial packets not supported for operation"); | "Partial packets not supported for operation"); | ||||
return CPA_STATUS_INVALID_PARAM; | return CPA_STATUS_INVALID_PARAM; | ||||
} else { | } else { | ||||
/* This function checks to see if the partial packet | /* This function checks to see if the partial packet | ||||
* sequence | * sequence is correct */ | ||||
* is correct */ | |||||
if (CPA_STATUS_SUCCESS != | if (CPA_STATUS_SUCCESS != | ||||
LacSym_PartialPacketStateCheck( | LacSym_PartialPacketStateCheck( | ||||
pOpData->packetType, | pOpData->packetType, | ||||
pSessionDesc->partialState)) { | pSessionDesc->partialState)) { | ||||
LAC_INVALID_PARAM_LOG("Partial packet Type"); | LAC_INVALID_PARAM_LOG("Partial packet Type"); | ||||
return CPA_STATUS_INVALID_PARAM; | return CPA_STATUS_INVALID_PARAM; | ||||
} | } | ||||
} | } | ||||
▲ Show 20 Lines • Show All 82 Lines • ▼ Show 20 Lines | LacSym_InitSession(const CpaInstanceHandle instanceHandle, | ||||
lac_session_desc_t *pSessionDesc = NULL; | lac_session_desc_t *pSessionDesc = NULL; | ||||
Cpa32U sessionCtxSizeInBytes = 0; | Cpa32U sessionCtxSizeInBytes = 0; | ||||
CpaPhysicalAddr physAddress = 0; | CpaPhysicalAddr physAddress = 0; | ||||
CpaPhysicalAddr physAddressAligned = 0; | CpaPhysicalAddr physAddressAligned = 0; | ||||
sal_service_t *pService = NULL; | sal_service_t *pService = NULL; | ||||
const CpaCySymCipherSetupData *pCipherSetupData = NULL; | const CpaCySymCipherSetupData *pCipherSetupData = NULL; | ||||
const CpaCySymHashSetupData *pHashSetupData = NULL; | const CpaCySymHashSetupData *pHashSetupData = NULL; | ||||
/* Instance param checking done by calling function */ | /* Instance param checking done by calling function */ | ||||
LAC_CHECK_NULL_PARAM(pSessionSetupData); | LAC_CHECK_NULL_PARAM(pSessionSetupData); | ||||
LAC_CHECK_NULL_PARAM(pSessionCtx); | LAC_CHECK_NULL_PARAM(pSessionCtx); | ||||
status = LacSymSession_ParamCheck(instanceHandle, pSessionSetupData); | status = LacSymSession_ParamCheck(instanceHandle, pSessionSetupData); | ||||
LAC_CHECK_STATUS(status); | LAC_CHECK_STATUS(status); | ||||
/* set the session priority for QAT AL*/ | /* set the session priority for QAT AL*/ | ||||
if ((CPA_CY_PRIORITY_HIGH == pSessionSetupData->sessionPriority) || | if ((CPA_CY_PRIORITY_HIGH == pSessionSetupData->sessionPriority) || | ||||
Show All 12 Lines | LacSym_InitSession(const CpaInstanceHandle instanceHandle, | ||||
/* Re-align the session structure to 64 byte alignment */ | /* Re-align the session structure to 64 byte alignment */ | ||||
physAddress = | physAddress = | ||||
LAC_OS_VIRT_TO_PHYS_EXTERNAL((*pService), | LAC_OS_VIRT_TO_PHYS_EXTERNAL((*pService), | ||||
(Cpa8U *)pSessionCtx + sizeof(void *)); | (Cpa8U *)pSessionCtx + sizeof(void *)); | ||||
if (0 == physAddress) { | if (0 == physAddress) { | ||||
LAC_LOG_ERROR( | LAC_LOG_ERROR( | ||||
"Unable to get the physical address of the session"); | "Unable to get the physical address of the session\n"); | ||||
return CPA_STATUS_FAIL; | return CPA_STATUS_FAIL; | ||||
} | } | ||||
physAddressAligned = | physAddressAligned = | ||||
LAC_ALIGN_POW2_ROUNDUP(physAddress, LAC_64BYTE_ALIGNMENT); | LAC_ALIGN_POW2_ROUNDUP(physAddress, LAC_64BYTE_ALIGNMENT); | ||||
pSessionDesc = (lac_session_desc_t *) | pSessionDesc = (lac_session_desc_t *) | ||||
/* Move the session pointer by the physical offset | /* Move the session pointer by the physical offset | ||||
Show All 34 Lines | LacSym_InitSession(const CpaInstanceHandle instanceHandle, | ||||
/* Set the Common Session Information */ | /* Set the Common Session Information */ | ||||
pSessionDesc->symOperation = pSessionSetupData->symOperation; | pSessionDesc->symOperation = pSessionSetupData->symOperation; | ||||
if (CPA_FALSE == isDPSession) { | if (CPA_FALSE == isDPSession) { | ||||
/* For asynchronous - use the user supplied callback | /* For asynchronous - use the user supplied callback | ||||
* for synchronous - use the internal synchronous callback */ | * for synchronous - use the internal synchronous callback */ | ||||
pSessionDesc->pSymCb = ((void *)NULL != (void *)pSymCb) ? | pSessionDesc->pSymCb = ((void *)NULL != (void *)pSymCb) ? | ||||
pSymCb : | pSymCb : | ||||
LacSync_GenBufListVerifyCb; | LacSync_GenBufListVerifyCb; | ||||
} | } | ||||
pSessionDesc->isDPSession = isDPSession; | pSessionDesc->isDPSession = isDPSession; | ||||
if ((CPA_CY_SYM_HASH_AES_GCM == pHashSetupData->hashAlgorithm) || | if ((CPA_CY_SYM_HASH_AES_GCM == pHashSetupData->hashAlgorithm) || | ||||
(CPA_CY_SYM_HASH_AES_GMAC == pHashSetupData->hashAlgorithm) || | (CPA_CY_SYM_HASH_AES_GMAC == pHashSetupData->hashAlgorithm) || | ||||
(CPA_CY_SYM_HASH_AES_CCM == pHashSetupData->hashAlgorithm) || | (CPA_CY_SYM_HASH_AES_CCM == pHashSetupData->hashAlgorithm) || | ||||
(CPA_CY_SYM_CIPHER_CHACHA == pCipherSetupData->cipherAlgorithm) || | (CPA_CY_SYM_CIPHER_CHACHA == pCipherSetupData->cipherAlgorithm) || | ||||
(CPA_CY_SYM_CIPHER_ARC4 == pCipherSetupData->cipherAlgorithm)) { | (CPA_CY_SYM_CIPHER_ARC4 == pCipherSetupData->cipherAlgorithm)) { | ||||
pSessionDesc->writeRingMsgFunc = LacDp_WriteRingMsgFull; | pSessionDesc->writeRingMsgFunc = LacDp_WriteRingMsgFull; | ||||
} else { | } else { | ||||
pSessionDesc->writeRingMsgFunc = LacDp_WriteRingMsgOpt; | pSessionDesc->writeRingMsgFunc = LacDp_WriteRingMsgOpt; | ||||
} | } | ||||
if (CPA_STATUS_SUCCESS == status) { | if (CPA_STATUS_SUCCESS == status) { | ||||
/* Session set up via API call (not internal one) */ | /* Session set up via API call (not internal one) */ | ||||
/* Services such as DRBG call the crypto api as part of their | /* Services such as DRBG call the crypto api as part of their | ||||
* service | * service hence the need to for the flag, it is needed to | ||||
* hence the need to for the flag, it is needed to distinguish | * distinguish between an internal and external session. | ||||
* between | |||||
* an internal and external session. | |||||
*/ | */ | ||||
pSessionDesc->internalSession = CPA_FALSE; | pSessionDesc->internalSession = CPA_FALSE; | ||||
status = LacAlgChain_SessionInit(instanceHandle, | status = LacAlgChain_SessionInit(instanceHandle, | ||||
pSessionSetupData, | pSessionSetupData, | ||||
pSessionDesc); | pSessionDesc); | ||||
} | } | ||||
return status; | return status; | ||||
Show All 28 Lines | cpaCySymRemoveSession(const CpaInstanceHandle instanceHandle_in, | ||||
pSessionDesc = LAC_SYM_SESSION_DESC_FROM_CTX_GET(pSessionCtx); | pSessionDesc = LAC_SYM_SESSION_DESC_FROM_CTX_GET(pSessionCtx); | ||||
LAC_CHECK_NULL_PARAM(pSessionDesc); | LAC_CHECK_NULL_PARAM(pSessionDesc); | ||||
if (CPA_TRUE == pSessionDesc->isDPSession) { | if (CPA_TRUE == pSessionDesc->isDPSession) { | ||||
/* | /* | ||||
* Based on one instance, we can initialize multiple sessions. | * Based on one instance, we can initialize multiple sessions. | ||||
* For example, we can initialize the session "X" and session | * For example, we can initialize the session "X" and session | ||||
* "Y" with | * "Y" with the same instance "A". If there is no operation | ||||
* the same instance "A". If there is no operation pending for | * pending for session "X", we can remove the session "X". | ||||
* session | |||||
* "X", we can remove the session "X". | |||||
* | * | ||||
* Now we only check the @pSessionDesc->pendingDpCbCount, if it | * Now we only check the @pSessionDesc->pendingDpCbCount, if it | ||||
* becomes | * becomes zero, we can remove the session. | ||||
* zero, we can remove the session. | |||||
* | * | ||||
* Why? | * Why? | ||||
* (1) We increase it in the cpaCySymDpEnqueueOp/ | * (1) We increase it in the cpaCySymDpEnqueueOp/ | ||||
* cpaCySymDpEnqueueOpBatch. | * cpaCySymDpEnqueueOpBatch. | ||||
* (2) We decrease it in the LacSymCb_ProcessCallback. | * (2) We decrease it in the LacSymCb_ProcessCallback. | ||||
* | * | ||||
* If the @pSessionDesc->pendingDpCbCount becomes zero, it means | * If the @pSessionDesc->pendingDpCbCount becomes zero, it means | ||||
* there is no operation pending for the session "X" anymore, so | * there is no operation pending for the session "X" anymore, so | ||||
* we can | * we can remove this session. Maybe there is still some | ||||
* remove this session. Maybe there is still some requests left | * requests left in the instance's ring | ||||
* in the | * (icp_adf_queueDataToSend() returns true), but the request | ||||
* instance's ring (icp_adf_queueDataToSend() returns true), but | * does not belong to "X", it belongs to session "Y". | ||||
* the | |||||
* request does not belong to "X", it belongs to session "Y". | |||||
*/ | */ | ||||
numPendingRequests = | numPendingRequests = | ||||
qatUtilsAtomicGet(&(pSessionDesc->u.pendingDpCbCount)); | qatUtilsAtomicGet(&(pSessionDesc->u.pendingDpCbCount)); | ||||
} else { | } else { | ||||
numPendingRequests = | numPendingRequests = | ||||
qatUtilsAtomicGet(&(pSessionDesc->u.pendingCbCount)); | qatUtilsAtomicGet(&(pSessionDesc->u.pendingCbCount)); | ||||
} | } | ||||
/* If there are pending requests */ | /* If there are pending requests */ | ||||
if (0 != numPendingRequests) { | if (0 != numPendingRequests) { | ||||
QAT_UTILS_LOG("There are %llu requests pending\n", | QAT_UTILS_LOG("There are %llu requests pending\n", | ||||
(unsigned long long)numPendingRequests); | (unsigned long long)numPendingRequests); | ||||
status = CPA_STATUS_RETRY; | status = CPA_STATUS_RETRY; | ||||
if (CPA_TRUE == pSessionDesc->isDPSession) { | if (CPA_TRUE == pSessionDesc->isDPSession) { | ||||
/* Need to update tail if messages queue on tx hi ring | /* Need to update tail if messages queue on tx hi ring | ||||
for | for data plane api */ | ||||
data plane api */ | |||||
icp_comms_trans_handle trans_handle = | icp_comms_trans_handle trans_handle = | ||||
((sal_crypto_service_t *)instanceHandle) | ((sal_crypto_service_t *)instanceHandle) | ||||
->trans_handle_sym_tx; | ->trans_handle_sym_tx; | ||||
if (CPA_TRUE == icp_adf_queueDataToSend(trans_handle)) { | if (CPA_TRUE == icp_adf_queueDataToSend(trans_handle)) { | ||||
/* process the remaining messages in the ring */ | /* process the remaining messages in the ring */ | ||||
QAT_UTILS_LOG("Submitting enqueued requests\n"); | QAT_UTILS_LOG("Submitting enqueued requests\n"); | ||||
/* | /* | ||||
* SalQatMsg_updateQueueTail | * SalQatMsg_updateQueueTail | ||||
*/ | */ | ||||
SalQatMsg_updateQueueTail(trans_handle); | SalQatMsg_updateQueueTail(trans_handle); | ||||
return status; | return status; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (CPA_STATUS_SUCCESS == status) { | if (CPA_STATUS_SUCCESS == status) { | ||||
if (CPA_STATUS_SUCCESS != | LAC_SPINLOCK_DESTROY(&pSessionDesc->requestQueueLock); | ||||
LAC_SPINLOCK_DESTROY(&pSessionDesc->requestQueueLock)) { | |||||
LAC_LOG_ERROR("Failed to destroy request queue lock"); | |||||
} | |||||
if (CPA_FALSE == pSessionDesc->isDPSession) { | if (CPA_FALSE == pSessionDesc->isDPSession) { | ||||
LAC_SYM_STAT_INC(numSessionsRemoved, instanceHandle); | LAC_SYM_STAT_INC(numSessionsRemoved, instanceHandle); | ||||
} | } | ||||
} else if (CPA_FALSE == pSessionDesc->isDPSession) { | } else if (CPA_FALSE == pSessionDesc->isDPSession) { | ||||
LAC_SYM_STAT_INC(numSessionErrors, instanceHandle); | LAC_SYM_STAT_INC(numSessionErrors, instanceHandle); | ||||
} | } | ||||
return status; | return status; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 364 Lines • Show Last 20 Lines |