Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions wolfcrypt/src/port/intel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ Note: If you have the older driver installed you may need to remove it or unload


```
wget https://01.org/sites/default/files/downloads/qat1.7.l.4.4.0-00023.tar.gz
curl -o qat1.7.l.4.5.0-00034.tar.gz https://01.org/sites/default/files/downloads/qat1.7.l.4.5.0-00034.tar.gz
mkdir QAT1.7
mv qat1.7.l.4.4.0-00023.tar.gz QAT1.7
mv qat1.7.l.4.5.0-00034.tar.gz QAT1.7
cd QAT1.7
tar -xvzf qat1.7.l.4.4.0-00023.tar.gz
tar -xvzf qat1.7.l.4.5.0-00034.tar.gz

./configure
make
Expand Down
3 changes: 1 addition & 2 deletions wolfcrypt/src/port/intel/quickassist.c
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ int IntelQaInit(void* threadId)
}

/* assign device id */
devId = (g_instCounter % g_numInstances);;
devId = (g_instCounter % g_numInstances);
g_instCounter++;

pthread_mutex_unlock(&g_Hwlock);
Expand Down Expand Up @@ -1685,7 +1685,6 @@ static void IntelQaRsaPublicFree(WC_ASYNC_DEV* dev)
XFREE(opData->inputData.pData, dev->heap, DYNAMIC_TYPE_ASYNC_NUMA);
opData->inputData.pData = NULL;
}
XMEMSET(opData->pPublicKey, 0, sizeof(CpaCyRsaPublicKey));
XMEMSET(opData, 0, sizeof(CpaCyRsaEncryptOpData));
}
if (outBuf) {
Expand Down
22 changes: 17 additions & 5 deletions wolfcrypt/src/port/intel/quickassist_mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,9 @@ typedef struct qaeMemHeader {
pthread_t threadId;
#endif
size_t size;
int count;
word16 count;
word16 isNuma:1;
word16 reservedBits:15; /* use for future bits */
word16 type;
word16 numa_page_offset; /* use QAE_NOT_NUMA_PAGE if not NUMA */
} ALIGN16 qaeMemHeader;
Expand Down Expand Up @@ -240,8 +242,6 @@ static WC_INLINE int qaeMemTypeIsNuma(int type)
case DYNAMIC_TYPE_ASYNC_NUMA:
case DYNAMIC_TYPE_ASYNC_NUMA64:
case DYNAMIC_TYPE_WOLF_BIGINT:
case DYNAMIC_TYPE_OUT_BUFFER:
case DYNAMIC_TYPE_IN_BUFFER:
case DYNAMIC_TYPE_PRIVATE_KEY:
case DYNAMIC_TYPE_PUBLIC_KEY:
case DYNAMIC_TYPE_AES_BUFFER:
Expand All @@ -256,7 +256,18 @@ static WC_INLINE int qaeMemTypeIsNuma(int type)
isNuma = 1;
break;
}
case DYNAMIC_TYPE_OUT_BUFFER:
case DYNAMIC_TYPE_IN_BUFFER:
{
#if !defined(WC_ASYNC_NO_CRYPT) && !defined(WC_ASYNC_NO_HASH)
isNuma = 1;
#else
isNuma = 0;
#endif
break;
}
default:
isNuma = 0;
break;
}
return isNuma;
Expand Down Expand Up @@ -351,7 +362,7 @@ static void _qaeMemFree(void *ptr, void* heap, int type
#endif

/* free type */
if (header->numa_page_offset != QAE_NOT_NUMA_PAGE) {
if (header->isNuma && header->numa_page_offset != QAE_NOT_NUMA_PAGE) {
#ifdef QAT_V2
qaeMemFreeNUMA(&ptr);
#else
Expand Down Expand Up @@ -397,7 +408,7 @@ static void* _qaeMemAlloc(size_t size, void* heap, int type
alignment, &page_offset);
#endif
}
if (ptr == NULL) {
else if (ptr == NULL) {
isNuma = 0;
ptr = malloc(size + sizeof(qaeMemHeader));
}
Expand All @@ -411,6 +422,7 @@ static void* _qaeMemAlloc(size_t size, void* heap, int type
header->size = size;
header->type = type;
header->count = 1;
header->isNuma = isNuma;
header->numa_page_offset = page_offset;
#ifdef USE_QAE_THREAD_LS
header->threadId = pthread_self();
Expand Down