Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7106FC10DCE for ; Wed, 18 Mar 2020 13:29:40 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 05E0E2076D for ; Wed, 18 Mar 2020 13:29:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05E0E2076D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id C1D1E1AFF; Wed, 18 Mar 2020 14:29:38 +0100 (CET) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id 260B5FEB for ; Wed, 18 Mar 2020 14:29:36 +0100 (CET) IronPort-SDR: vuQlpL2ssaSw9EpQqfvrzsWW5vM1fU/pygAdL+uorZHxlNa1gTZ4NrHDA7ceIRiZ1uciRclQYM wGub0OsDZuYw== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2020 06:29:35 -0700 IronPort-SDR: 91MP/BAsWAT4HMlzpEtbWM39PrrOOHujt/C5URTyR6fTwO8ikWLu/6lyRvITUxh5cKRu/wCWDH NtC6FP/y/JIw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,567,1574150400"; d="scan'208";a="263381982" Received: from mdrostx-mobl.ger.corp.intel.com ([10.104.125.79]) by orsmga002.jf.intel.com with ESMTP; 18 Mar 2020 06:29:33 -0700 From: Mariusz Drost To: radu.nicolau@intel.com, akhil.goyal@nxp.com Cc: dev@dpdk.org, Mariusz Drost Date: Wed, 18 Mar 2020 14:26:59 +0100 Message-Id: <20200318132659.1031-1-mariuszx.drost@intel.com> X-Mailer: git-send-email 2.23.0.windows.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH] examples/ipsec-secgw: enable cpu-crypto fallback X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Added cpu-crypto fallback option parsing as well as tests for it Signed-off-by: Mariusz Drost --- examples/ipsec-secgw/sa.c | 6 ++++-- examples/ipsec-secgw/test/common_defs.sh | 12 ++++++++++++ .../test/trs_aesgcm_inline_crypto_fallback_defs.sh | 7 ++++++- .../test/tun_aesgcm_inline_crypto_fallback_defs.sh | 7 ++++++- 4 files changed, 28 insertions(+), 4 deletions(-) diff --git a/examples/ipsec-secgw/sa.c b/examples/ipsec-secgw/sa.c index 4822d6bda..7c65f893a 100644 --- a/examples/ipsec-secgw/sa.c +++ b/examples/ipsec-secgw/sa.c @@ -669,9 +669,11 @@ parse_sa_tokens(char **tokens, uint32_t n_tokens, if (status->status < 0) return; fb = ipsec_get_fallback_session(rule); - if (strcmp(tokens[ti], "lookaside-none") == 0) { + if (strcmp(tokens[ti], "lookaside-none") == 0) fb->type = RTE_SECURITY_ACTION_TYPE_NONE; - } else { + else if (strcmp(tokens[ti], "cpu-crypto") == 0) + fb->type = RTE_SECURITY_ACTION_TYPE_CPU_CRYPTO; + else { APP_CHECK(0, status, "unrecognized fallback " "type %s.", tokens[ti]); return; diff --git a/examples/ipsec-secgw/test/common_defs.sh b/examples/ipsec-secgw/test/common_defs.sh index 6b6ae06f3..35cdd1c55 100644 --- a/examples/ipsec-secgw/test/common_defs.sh +++ b/examples/ipsec-secgw/test/common_defs.sh @@ -51,6 +51,13 @@ select_mode() SGW_CFG_XPRM="${SGW_CFG_XPRM} ${CRYPTO_PRIM_TYPE}" fi + # check if fallback type is needed + if [[ "${MODE}" == *fallback* ]]; then + if [[ -n "${CRYPTO_FLBK_TYPE}" ]]; then + echo "${CRYPTO_FLBK_TYPE} is enabled" + fi + fi + #make linux to generate fragmented packets if [[ -n "${MULTI_SEG_TEST}" && -n "${SGW_CMD_XPRM}" ]]; then echo "multi-segment test is enabled" @@ -58,6 +65,11 @@ select_mode() PING_LEN=5000 MTU_LEN=1500 else + if [[ -z "${MULTI_SEG_TEST}" && "${MODE}" == *fallback* ]]; then + echo "MULTI_SEG_TEST environment variable needs to be \ +set for ${MODE} test" + exit 127 + fi PING_LEN=${DEF_PING_LEN} MTU_LEN=${DEF_MTU_LEN} fi diff --git a/examples/ipsec-secgw/test/trs_aesgcm_inline_crypto_fallback_defs.sh b/examples/ipsec-secgw/test/trs_aesgcm_inline_crypto_fallback_defs.sh index f21b01d63..4e2ac0ead 100644 --- a/examples/ipsec-secgw/test/trs_aesgcm_inline_crypto_fallback_defs.sh +++ b/examples/ipsec-secgw/test/trs_aesgcm_inline_crypto_fallback_defs.sh @@ -3,4 +3,9 @@ . ${DIR}/trs_aesgcm_defs.sh -SGW_CFG_XPRM_IN='port_id 0 type inline-crypto-offload fallback lookaside-none' +if [[ -z "${CRYPTO_FLBK_TYPE}" ]]; then + CRYPTO_FLBK_TYPE="fallback lookaside-none" +fi + +SGW_CFG_XPRM_IN="port_id 0 type inline-crypto-offload ${CRYPTO_FLBK_TYPE}" + diff --git a/examples/ipsec-secgw/test/tun_aesgcm_inline_crypto_fallback_defs.sh b/examples/ipsec-secgw/test/tun_aesgcm_inline_crypto_fallback_defs.sh index 97b9431f4..d6bf40d83 100644 --- a/examples/ipsec-secgw/test/tun_aesgcm_inline_crypto_fallback_defs.sh +++ b/examples/ipsec-secgw/test/tun_aesgcm_inline_crypto_fallback_defs.sh @@ -3,4 +3,9 @@ . ${DIR}/tun_aesgcm_defs.sh -SGW_CFG_XPRM_IN='port_id 0 type inline-crypto-offload fallback lookaside-none' +if [[ -z "${CRYPTO_FLBK_TYPE}" ]]; then + CRYPTO_FLBK_TYPE="fallback lookaside-none" +fi + +SGW_CFG_XPRM_IN="port_id 0 type inline-crypto-offload ${CRYPTO_FLBK_TYPE}" + -- 2.17.1