- # check if fallback type is needed
- if [[ "${MODE}" == *fallback* ]]; then
- if [[ -n "${CRYPTO_FLBK_TYPE}" ]]; then
- echo "${CRYPTO_FLBK_TYPE} is enabled"
+ # check if fallback should be enabled
+ if [[ -n "${SGW_CRYPTO_FLBK}" ]] && [[ -n ${SGW_CFG_XPRM_IN} ]] \
+ && [[ "${SGW_MODE}" == "library" ]] \
+ && [[ "${SGW_CRYPTO_FLBK}" == "cpu-crypto" \
+ || "${SGW_CRYPTO_FLBK}" == "lookaside-none" ]]; then
+ CRYPTO_DEV=""
+ SGW_CFG_XPRM_IN="${SGW_CFG_XPRM_IN} fallback ${SGW_CRYPTO_FLBK}"
+ SGW_CFG_XPRM_OUT=""
+ echo "[enabled] crypto fallback ${SGW_CRYPTO_FLBK} mode"
+ else
+ if [[ -n "${SGW_CRYPTO_FLBK}" \
+ && "${SGW_CRYPTO}" != "inline" ]]; then
+ echo "SGW_CRYPTO variable needs to be set to \
+\"inline\" for ${SGW_CRYPTO_FLBK} fallback setting"
+ exit 127
+ elif [[ -n "${SGW_CRYPTO_FLBK}" \
+ && "${SGW_MODE}" != "library" ]]; then
+ echo "SGW_MODE variable needs to be set to \
+\"library\" for ${SGW_CRYPTO_FLBK} fallback setting"
+ exit 127
+ fi
+ echo "[disabled] crypto fallback mode"
+ fi
+
+ # select sync/async mode
+ if [[ -n "${CRYPTO_PRIM_TYPE}" && -n "${DPDK_MODE}" ]]; then
+ echo "[enabled] crypto primary type - ${CRYPTO_PRIM_TYPE}"
+ SGW_CFG_XPRM_IN="${SGW_CFG_XPRM_IN} type ${CRYPTO_PRIM_TYPE}"
+ SGW_CFG_XPRM_OUT="${SGW_CFG_XPRM_OUT} type ${CRYPTO_PRIM_TYPE}"
+ else
+ if [[ -n "${CRYPTO_PRIM_TYPE}" \
+ && "${SGW_MODE}" != "library" ]]; then
+ echo "SGW_MODE variable needs to be set to \
+\"library\" for ${CRYPTO_PRIM_TYPE} crypto primary type setting"
+ exit 127