Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/qat/qat_api/common/ctrl/sal_compression.c
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
#include "dc_datapath.h" | #include "dc_datapath.h" | ||||
#include "dc_stats.h" | #include "dc_stats.h" | ||||
#include "lac_sal.h" | #include "lac_sal.h" | ||||
#include "lac_sal_ctrl.h" | #include "lac_sal_ctrl.h" | ||||
#include "sal_string_parse.h" | #include "sal_string_parse.h" | ||||
#include "sal_service_state.h" | #include "sal_service_state.h" | ||||
#include "lac_buffer_desc.h" | #include "lac_buffer_desc.h" | ||||
#include "icp_qat_fw_comp.h" | #include "icp_qat_fw_comp.h" | ||||
#include "icp_qat_hw_20_comp_defs.h" | |||||
#include "icp_sal_versions.h" | #include "icp_sal_versions.h" | ||||
/* C string null terminator size */ | /* C string null terminator size */ | ||||
#define SAL_NULL_TERM_SIZE 1 | #define SAL_NULL_TERM_SIZE 1 | ||||
/* Type to access extended features bit fields */ | /* Type to access extended features bit fields */ | ||||
typedef struct dc_extended_features_s { | typedef struct dc_extended_features_s { | ||||
unsigned is_cnv : 1; /* Bit<0> */ | unsigned is_cnv : 1; /* Bit<0> */ | ||||
▲ Show 20 Lines • Show All 61 Lines • ▼ Show 20 Lines | SalCtrl_CompresionDebug(void *private_data, char *data, int size, int offset) | ||||
return 0; | return 0; | ||||
} | } | ||||
/* Initialise device specific information needed by compression service */ | /* Initialise device specific information needed by compression service */ | ||||
static CpaStatus | static CpaStatus | ||||
SalCtrl_CompressionInit_CompData(icp_accel_dev_t *device, | SalCtrl_CompressionInit_CompData(icp_accel_dev_t *device, | ||||
sal_compression_service_t *pCompService) | sal_compression_service_t *pCompService) | ||||
{ | { | ||||
int level = 0; | |||||
pCompService->comp_device_data.uniqueCompressionLevels[0] = CPA_FALSE; | |||||
switch (device->deviceType) { | switch (device->deviceType) { | ||||
case DEVICE_DH895XCC: | case DEVICE_DH895XCC: | ||||
case DEVICE_DH895XCCVF: | case DEVICE_DH895XCCVF: | ||||
pCompService->generic_service_info.integrityCrcCheck = | pCompService->generic_service_info.integrityCrcCheck = | ||||
CPA_FALSE; | CPA_FALSE; | ||||
pCompService->numInterBuffs = | pCompService->numInterBuffs = | ||||
DC_QAT_MAX_NUM_INTER_BUFFERS_6COMP_SLICES; | DC_QAT_MAX_NUM_INTER_BUFFERS_6COMP_SLICES; | ||||
pCompService->comp_device_data.minOutputBuffSize = | pCompService->comp_device_data.minOutputBuffSize = | ||||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Lines | case DEVICE_C62XVF: | ||||
pCompService->comp_device_data.oddByteDecompNobFinal = | pCompService->comp_device_data.oddByteDecompNobFinal = | ||||
CPA_FALSE; | CPA_FALSE; | ||||
pCompService->comp_device_data.oddByteDecompInterim = CPA_TRUE; | pCompService->comp_device_data.oddByteDecompInterim = CPA_TRUE; | ||||
pCompService->comp_device_data.translatorOverflow = CPA_FALSE; | pCompService->comp_device_data.translatorOverflow = CPA_FALSE; | ||||
pCompService->comp_device_data.useDevRam = | pCompService->comp_device_data.useDevRam = | ||||
ICP_QAT_FW_COMP_ENABLE_SECURE_RAM_USED_AS_INTMD_BUF; | ICP_QAT_FW_COMP_ENABLE_SECURE_RAM_USED_AS_INTMD_BUF; | ||||
pCompService->comp_device_data.inflateContextSize = | pCompService->comp_device_data.inflateContextSize = | ||||
DC_INFLATE_EH_CONTEXT_SIZE; | DC_INFLATE_EH_CONTEXT_SIZE; | ||||
pCompService->comp_device_data.highestHwCompressionDepth = | |||||
ICP_QAT_HW_COMPRESSION_DEPTH_16; | |||||
pCompService->comp_device_data.windowSizeMask = | pCompService->comp_device_data.windowSizeMask = | ||||
(1 << DC_16K_WINDOW_SIZE | 1 << DC_32K_WINDOW_SIZE); | (1 << DC_4K_WINDOW_SIZE | 1 << DC_8K_WINDOW_SIZE | | ||||
1 << DC_16K_WINDOW_SIZE | 1 << DC_32K_WINDOW_SIZE); | |||||
pCompService->comp_device_data.minOutputBuffSize = | pCompService->comp_device_data.minOutputBuffSize = | ||||
DC_DEST_BUFFER_STA_MIN_SIZE; | DC_DEST_BUFFER_STA_MIN_SIZE; | ||||
pCompService->comp_device_data.minOutputBuffSizeDynamic = | |||||
pCompService->comp_device_data.minOutputBuffSize; | |||||
pCompService->comp_device_data.enableDmm = | pCompService->comp_device_data.enableDmm = | ||||
ICP_QAT_HW_COMPRESSION_DELAYED_MATCH_ENABLED; | ICP_QAT_HW_COMPRESSION_DELAYED_MATCH_ENABLED; | ||||
pCompService->comp_device_data.cnvnrSupported = CPA_TRUE; | pCompService->comp_device_data.cnvnrSupported = CPA_TRUE; | ||||
for (level = CPA_DC_L1; level <= CPA_DC_L9; level++) { | |||||
switch (level) { | |||||
case CPA_DC_L1: | |||||
case CPA_DC_L2: | |||||
case CPA_DC_L3: | |||||
case CPA_DC_L4: | |||||
pCompService->comp_device_data | |||||
.uniqueCompressionLevels[level] = CPA_TRUE; | |||||
break; | break; | ||||
default: | |||||
pCompService->comp_device_data | |||||
.uniqueCompressionLevels[level] = CPA_FALSE; | |||||
break; | |||||
} | |||||
} | |||||
pCompService->comp_device_data.numCompressionLevels = | |||||
DC_NUM_COMPRESSION_LEVELS; | |||||
break; | |||||
case DEVICE_C4XXX: | case DEVICE_C4XXX: | ||||
case DEVICE_C4XXXVF: | case DEVICE_C4XXXVF: | ||||
pCompService->generic_service_info.integrityCrcCheck = CPA_TRUE; | pCompService->generic_service_info.integrityCrcCheck = CPA_TRUE; | ||||
pCompService->numInterBuffs = | pCompService->numInterBuffs = | ||||
DC_QAT_MAX_NUM_INTER_BUFFERS_24COMP_SLICES; | DC_QAT_MAX_NUM_INTER_BUFFERS_24COMP_SLICES; | ||||
pCompService->comp_device_data.minOutputBuffSize = | pCompService->comp_device_data.minOutputBuffSize = | ||||
DC_DEST_BUFFER_MIN_SIZE; | DC_DEST_BUFFER_MIN_SIZE; | ||||
pCompService->comp_device_data.oddByteDecompNobFinal = CPA_TRUE; | pCompService->comp_device_data.oddByteDecompNobFinal = CPA_TRUE; | ||||
Show All 11 Lines | pCompService->comp_device_data.enableDmm = | ||||
ICP_QAT_HW_COMPRESSION_DELAYED_MATCH_ENABLED; | ICP_QAT_HW_COMPRESSION_DELAYED_MATCH_ENABLED; | ||||
pCompService->comp_device_data.inflateContextSize = | pCompService->comp_device_data.inflateContextSize = | ||||
DC_INFLATE_EH_CONTEXT_SIZE; | DC_INFLATE_EH_CONTEXT_SIZE; | ||||
pCompService->comp_device_data.highestHwCompressionDepth = | pCompService->comp_device_data.highestHwCompressionDepth = | ||||
ICP_QAT_HW_COMPRESSION_DEPTH_128; | ICP_QAT_HW_COMPRESSION_DEPTH_128; | ||||
pCompService->comp_device_data.windowSizeMask = | pCompService->comp_device_data.windowSizeMask = | ||||
(1 << DC_16K_WINDOW_SIZE | 1 << DC_32K_WINDOW_SIZE); | (1 << DC_16K_WINDOW_SIZE | 1 << DC_32K_WINDOW_SIZE); | ||||
pCompService->comp_device_data.cnvnrSupported = CPA_TRUE; | pCompService->comp_device_data.cnvnrSupported = CPA_TRUE; | ||||
break; | |||||
case DEVICE_GEN4: | |||||
pCompService->generic_service_info.integrityCrcCheck = CPA_TRUE; | |||||
pCompService->numInterBuffs = 0; | |||||
pCompService->comp_device_data.minOutputBuffSize = | |||||
DC_DEST_BUFFER_STA_MIN_SIZE_GEN4; | |||||
pCompService->comp_device_data.minOutputBuffSizeDynamic = | |||||
DC_DEST_BUFFER_DYN_MIN_SIZE_GEN4; | |||||
pCompService->comp_device_data.oddByteDecompNobFinal = CPA_TRUE; | |||||
pCompService->comp_device_data.oddByteDecompInterim = CPA_FALSE; | |||||
pCompService->comp_device_data.translatorOverflow = CPA_TRUE; | |||||
pCompService->comp_device_data.useDevRam = | |||||
ICP_QAT_FW_COMP_ENABLE_SECURE_RAM_USED_AS_INTMD_BUF; | |||||
pCompService->comp_device_data.enableDmm = | |||||
ICP_QAT_HW_COMPRESSION_DELAYED_MATCH_ENABLED; | |||||
pCompService->comp_device_data.inflateContextSize = | |||||
DC_INFLATE_CONTEXT_SIZE; | |||||
pCompService->comp_device_data.highestHwCompressionDepth = | |||||
ICP_QAT_HW_COMP_20_SEARCH_DEPTH_LEVEL_9; | |||||
pCompService->comp_device_data.windowSizeMask = | |||||
(1 << DC_4K_WINDOW_SIZE | 1 << DC_8K_WINDOW_SIZE | | |||||
1 << DC_16K_WINDOW_SIZE | 1 << DC_32K_WINDOW_SIZE); | |||||
for (level = CPA_DC_L1; level <= CPA_DC_L9; level++) { | |||||
switch (level) { | |||||
case CPA_DC_L1: | |||||
case CPA_DC_L6: | |||||
case CPA_DC_L9: | |||||
pCompService->comp_device_data | |||||
.uniqueCompressionLevels[level] = CPA_TRUE; | |||||
break; | |||||
default: | |||||
pCompService->comp_device_data | |||||
.uniqueCompressionLevels[level] = CPA_FALSE; | |||||
break; | |||||
} | |||||
} | |||||
pCompService->comp_device_data.numCompressionLevels = | |||||
DC_NUM_COMPRESSION_LEVELS; | |||||
break; | break; | ||||
default: | default: | ||||
QAT_UTILS_LOG("Unknown device type! - %d.\n", | QAT_UTILS_LOG("Unknown device type! - %d.\n", | ||||
device->deviceType); | device->deviceType); | ||||
return CPA_STATUS_FAIL; | return CPA_STATUS_FAIL; | ||||
} | } | ||||
return CPA_STATUS_SUCCESS; | return CPA_STATUS_SUCCESS; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 1,318 Lines • Show Last 20 Lines |