From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by dpdk.org (Postfix) with ESMTP id 5DC5C1C3AE for ; Thu, 5 Jul 2018 12:14:16 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 Jul 2018 03:14:16 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,311,1526367600"; d="scan'208";a="52772826" Received: from silpixa00399466.ir.intel.com (HELO silpixa00399466.ger.corp.intel.com) ([10.237.223.220]) by fmsmga008.fm.intel.com with ESMTP; 05 Jul 2018 03:14:13 -0700 From: Pablo de Lara To: declan.doherty@intel.com, akhil.goyal@nxp.com, shally.verma@caviumnetworks.com, ravi1.kumar@amd.com, jerin.jacob@caviumnetworks.com, roy.fan.zhang@intel.com, fiona.trahe@intel.com, tdu@semihalf.com, jianjay.zhou@huawei.com Cc: dev@dpdk.org, Pablo de Lara Date: Thu, 5 Jul 2018 03:08:02 +0100 Message-Id: <20180705020805.38308-14-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180705020805.38308-1-pablo.de.lara.guarch@intel.com> References: <20180608220234.10170-1-pablo.de.lara.guarch@intel.com> <20180705020805.38308-1-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH v5 13/16] cryptodev: replace mbuf scatter gather flag 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: , X-List-Received-Date: Thu, 05 Jul 2018 10:14:16 -0000 The current mbuf scatter gatter feature flag is too ambiguous, as it is not clear if input and/or output buffers can be scatter gather mbufs or not, plus if in-place and/or out-of-place is supported. Therefore, five new flags will replace this flag: - RTE_CRYPTODEV_FF_IN_PLACE_SGL - RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT - RTE_CRYPTODEV_FF_OOP_SGL_IN_FB_OUT - RTE_CRYPTODEV_FF_OOP_FB_IN_SGL_OUT - RTE_CRYPTODEV_FF_OOP_FB_IN_FB_OUT Signed-off-by: Pablo de Lara --- doc/guides/cryptodevs/features/aesni_gcm.ini | 3 +- doc/guides/cryptodevs/features/default.ini | 6 +++- doc/guides/cryptodevs/features/dpaa2_sec.ini | 6 +++- doc/guides/cryptodevs/features/dpaa_sec.ini | 6 +++- doc/guides/cryptodevs/features/null.ini | 2 +- doc/guides/cryptodevs/features/openssl.ini | 3 +- doc/guides/cryptodevs/features/qat.ini | 6 +++- doc/guides/cryptodevs/overview.rst | 32 ++++++++++++++----- doc/guides/rel_notes/deprecation.rst | 2 -- doc/guides/rel_notes/release_18_08.rst | 8 +++++ drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 3 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 6 +++- drivers/crypto/dpaa_sec/dpaa_sec.c | 6 +++- drivers/crypto/null/null_crypto_pmd.c | 2 +- drivers/crypto/openssl/rte_openssl_pmd.c | 3 +- drivers/crypto/qat/qat_sym_pmd.c | 6 +++- lib/librte_cryptodev/rte_cryptodev.c | 12 ++++++-- lib/librte_cryptodev/rte_cryptodev.h | 46 +++++++++++++++++++--------- test/test/test_cryptodev.c | 31 +++++++++++++------ test/test/test_cryptodev_blockcipher.c | 21 ++++++++++--- 20 files changed, 157 insertions(+), 53 deletions(-) diff --git a/doc/guides/cryptodevs/features/aesni_gcm.ini b/doc/guides/cryptodevs/features/aesni_gcm.ini index 920b6b6ac..65811e2fe 100644 --- a/doc/guides/cryptodevs/features/aesni_gcm.ini +++ b/doc/guides/cryptodevs/features/aesni_gcm.ini @@ -10,7 +10,8 @@ CPU AESNI = Y CPU SSE = Y CPU AVX = Y CPU AVX2 = Y -Mbuf scatter gather = Y +OOP SGL In FB Out = Y +OOP FB In FB Out = Y ; ; Supported crypto algorithms of the 'aesni_gcm' crypto driver. ; diff --git a/doc/guides/cryptodevs/features/default.ini b/doc/guides/cryptodevs/features/default.ini index 42783887a..82efe3e31 100644 --- a/doc/guides/cryptodevs/features/default.ini +++ b/doc/guides/cryptodevs/features/default.ini @@ -18,7 +18,11 @@ CPU AVX512 = CPU AESNI = CPU NEON = CPU ARM CE = -Mbuf scatter gather = +In Place SGL = +OOP SGL In SGL Out = +OOP SGL In FB Out = +OOP FB In SGL Out = +OOP FB In FB Out = ; ; Supported crypto algorithms of a default crypto driver. diff --git a/doc/guides/cryptodevs/features/dpaa2_sec.ini b/doc/guides/cryptodevs/features/dpaa2_sec.ini index 68c9960d8..5f23fde51 100644 --- a/doc/guides/cryptodevs/features/dpaa2_sec.ini +++ b/doc/guides/cryptodevs/features/dpaa2_sec.ini @@ -8,7 +8,11 @@ Symmetric crypto = Y Sym operation chaining = Y HW Accelerated = Y Protocol offload = Y -Mbuf scatter gather = Y +In Place SGL = Y +OOP SGL In SGL Out = Y +OOP SGL In FB Out = Y +OOP FB In SGL Out = Y +OOP FB In FB Out = Y ; ; Supported crypto algorithms of the 'dpaa2_sec' crypto driver. diff --git a/doc/guides/cryptodevs/features/dpaa_sec.ini b/doc/guides/cryptodevs/features/dpaa_sec.ini index 260fae728..521faeab6 100644 --- a/doc/guides/cryptodevs/features/dpaa_sec.ini +++ b/doc/guides/cryptodevs/features/dpaa_sec.ini @@ -8,7 +8,11 @@ Symmetric crypto = Y Sym operation chaining = Y HW Accelerated = Y Protocol offload = Y -Mbuf scatter gather = Y +In Place SGL = Y +OOP SGL In SGL Out = Y +OOP SGL In FB Out = Y +OOP FB In SGL Out = Y +OOP FB In FB Out = Y ; ; Supported crypto algorithms of the 'dpaa_sec' crypto driver. diff --git a/doc/guides/cryptodevs/features/null.ini b/doc/guides/cryptodevs/features/null.ini index a9e172da8..ecf5779ac 100644 --- a/doc/guides/cryptodevs/features/null.ini +++ b/doc/guides/cryptodevs/features/null.ini @@ -6,7 +6,7 @@ [Features] Symmetric crypto = Y Sym operation chaining = Y -Mbuf scatter gather = Y +In Place SGL = Y ; ; Supported crypto algorithms of the 'null' crypto driver. diff --git a/doc/guides/cryptodevs/features/openssl.ini b/doc/guides/cryptodevs/features/openssl.ini index 691565865..5f03166b9 100644 --- a/doc/guides/cryptodevs/features/openssl.ini +++ b/doc/guides/cryptodevs/features/openssl.ini @@ -6,7 +6,8 @@ [Features] Symmetric crypto = Y Sym operation chaining = Y -Mbuf scatter gather = Y +OOP SGL In FB Out = Y +OOP FB In FB Out = Y ; ; Supported crypto algorithms of the 'openssl' crypto driver. diff --git a/doc/guides/cryptodevs/features/qat.ini b/doc/guides/cryptodevs/features/qat.ini index 51ed5967f..ccfc042c6 100644 --- a/doc/guides/cryptodevs/features/qat.ini +++ b/doc/guides/cryptodevs/features/qat.ini @@ -7,7 +7,11 @@ Symmetric crypto = Y Sym operation chaining = Y HW Accelerated = Y -Mbuf scatter gather = Y +In Place SGL = Y +OOP SGL In SGL Out = Y +OOP SGL In FB Out = Y +OOP FB In SGL Out = Y +OOP FB In FB Out = Y ; ; Supported crypto algorithms of the 'qat' crypto driver. diff --git a/doc/guides/cryptodevs/overview.rst b/doc/guides/cryptodevs/overview.rst index 493cd5f55..cc9c0f5a6 100644 --- a/doc/guides/cryptodevs/overview.rst +++ b/doc/guides/cryptodevs/overview.rst @@ -11,14 +11,30 @@ Supported Feature Flags .. include:: overview_feature_table.txt -Note, the mbuf scatter gather feature (aka chained mbufs, scatter-gather-lists -or SGLs) indicate all following combinations are supported unless otherwise called -out in the Limitations section of each PMD. - -* In place operation, input buffer as multiple segments, same buffer used for output -* Out of place operation, input buffer as single segment and output as multiple segments -* Out of place operation, input buffer as multiple segments and output as single segment -* Out of place operation, input buffer as multiple segments and output as multiple segments +.. Note:: + + - "In Place SGL" feature flag stands for "In place Scatter-gather list", + which means that an input mbuf can consist of multiple segments, + being the operation in-place (input = output). + + - "OOP SGL In SGL Out" feature flag stands for + "Out-of-place Scatter-gather list Input, Scatter-gater list Output", + which means that the input and output mbufs can consist of multiple segments. + + - "OOP SGL In FB Out" feature flag stands for + "Out-of-place Scatter-gather list Input, Flat Buffers Output", + which means that the input mbuf can consist of multiple segments combined + with a single segment mbuf in the output. + + - "OOP FB In SGL Out" feature flag stands for + "Out-of-place Flat Buffers Input, Scatter-gather list Output", + which means that the output mbuf can consist of multiple segments combined + with a single segment mbuf in the input. + + - "OOP FB In FB Out" feature flag stands for + "Out-of-place Flat Buffers Input, Scatter-gather list Output", + which means that Out-of-place operation is supported, + with single segment input and output mbufs. Supported Cipher Algorithms diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst index 9a73b1d8e..62d635b74 100644 --- a/doc/guides/rel_notes/deprecation.rst +++ b/doc/guides/rel_notes/deprecation.rst @@ -105,5 +105,3 @@ Deprecation Notices ``rte_cryptodev_queue_pair_dettach_sym_session()`` will be deprecated from 18.05 and removed in 18.08, as there are no drivers doing anything useful with them. - - Some feature flags such as ``RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER`` are ambiguous, - so some will be replaced by more explicit flags. diff --git a/doc/guides/rel_notes/release_18_08.rst b/doc/guides/rel_notes/release_18_08.rst index e482d3d5f..9cf3ea3df 100644 --- a/doc/guides/rel_notes/release_18_08.rst +++ b/doc/guides/rel_notes/release_18_08.rst @@ -78,6 +78,14 @@ API Changes - ``rte_cryptodev_get_private_session_size`` is replaced with ``rte_cryptodev_sym_get_private_session_size`` +* cryptodev: Feature flag ``RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER`` is + replaced with the following more explicit flags: + - ``RTE_CRYPTODEV_FF_IN_PLACE_SGL`` + - ``RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT`` + - ``RTE_CRYPTODEV_FF_OOP_SGL_IN_FB_OUT`` + - ``RTE_CRYPTODEV_FF_OOP_FB_IN_SGL_OUT`` + - ``RTE_CRYPTODEV_FF_OOP_FB_IN_FB_OUT`` + ABI Changes ----------- diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c index 88307e0e7..ce740e97a 100644 --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c @@ -492,7 +492,8 @@ aesni_gcm_create(const char *name, dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | RTE_CRYPTODEV_FF_CPU_AESNI | - RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER; + RTE_CRYPTODEV_FF_OOP_SGL_IN_FB_OUT | + RTE_CRYPTODEV_FF_OOP_FB_IN_FB_OUT; switch (vector_mode) { case RTE_AESNI_GCM_SSE: diff --git a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c index 1b1c30d85..1dd8dab83 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -2762,7 +2762,11 @@ dpaa2_sec_dev_init(struct rte_cryptodev *cryptodev) RTE_CRYPTODEV_FF_HW_ACCELERATED | RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | RTE_CRYPTODEV_FF_SECURITY | - RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER; + RTE_CRYPTODEV_FF_IN_PLACE_SGL | + RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT | + RTE_CRYPTODEV_FF_OOP_SGL_IN_FB_OUT | + RTE_CRYPTODEV_FF_OOP_FB_IN_SGL_OUT | + RTE_CRYPTODEV_FF_OOP_FB_IN_FB_OUT; internals = cryptodev->data->dev_private; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index b96552c57..49ff7584e 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -2271,7 +2271,11 @@ dpaa_sec_dev_init(struct rte_cryptodev *cryptodev) RTE_CRYPTODEV_FF_HW_ACCELERATED | RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | RTE_CRYPTODEV_FF_SECURITY | - RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER; + RTE_CRYPTODEV_FF_IN_PLACE_SGL | + RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT | + RTE_CRYPTODEV_FF_OOP_SGL_IN_FB_OUT | + RTE_CRYPTODEV_FF_OOP_FB_IN_SGL_OUT | + RTE_CRYPTODEV_FF_OOP_FB_IN_FB_OUT; internals = cryptodev->data->dev_private; internals->max_nb_queue_pairs = RTE_DPAA_MAX_NB_SEC_QPS; diff --git a/drivers/crypto/null/null_crypto_pmd.c b/drivers/crypto/null/null_crypto_pmd.c index 07276833b..3d7caf1f1 100644 --- a/drivers/crypto/null/null_crypto_pmd.c +++ b/drivers/crypto/null/null_crypto_pmd.c @@ -176,7 +176,7 @@ cryptodev_null_create(const char *name, dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | - RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER; + RTE_CRYPTODEV_FF_IN_PLACE_SGL; internals = dev->data->dev_private; diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c index 1ccab4ab5..865f8a75e 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd.c +++ b/drivers/crypto/openssl/rte_openssl_pmd.c @@ -1660,7 +1660,8 @@ cryptodev_openssl_create(const char *name, dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | RTE_CRYPTODEV_FF_CPU_AESNI | - RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER; + RTE_CRYPTODEV_FF_OOP_SGL_IN_FB_OUT | + RTE_CRYPTODEV_FF_OOP_FB_IN_FB_OUT; /* Set vector instructions mode supported */ internals = dev->data->dev_private; diff --git a/drivers/crypto/qat/qat_sym_pmd.c b/drivers/crypto/qat/qat_sym_pmd.c index ee8633b85..33ac831fe 100644 --- a/drivers/crypto/qat/qat_sym_pmd.c +++ b/drivers/crypto/qat/qat_sym_pmd.c @@ -274,7 +274,11 @@ qat_sym_dev_create(struct qat_pci_device *qat_pci_dev) cryptodev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO | RTE_CRYPTODEV_FF_HW_ACCELERATED | RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING | - RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER; + RTE_CRYPTODEV_FF_IN_PLACE_SGL | + RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT | + RTE_CRYPTODEV_FF_OOP_SGL_IN_FB_OUT | + RTE_CRYPTODEV_FF_OOP_FB_IN_SGL_OUT | + RTE_CRYPTODEV_FF_OOP_FB_IN_FB_OUT; internals = cryptodev->data->dev_private; internals->qat_dev = qat_pci_dev; diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index 381330f3d..608db36c7 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -361,8 +361,16 @@ rte_cryptodev_get_feature_name(uint64_t flag) return "CPU_AESNI"; case RTE_CRYPTODEV_FF_HW_ACCELERATED: return "HW_ACCELERATED"; - case RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER: - return "MBUF_SCATTER_GATHER"; + case RTE_CRYPTODEV_FF_IN_PLACE_SGL: + return "IN_PLACE_SGL"; + case RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT: + return "OOP_SGL_IN_SGL_OUT"; + case RTE_CRYPTODEV_FF_OOP_SGL_IN_FB_OUT: + return "OOP_SGL_IN_FB_OUT"; + case RTE_CRYPTODEV_FF_OOP_FB_IN_SGL_OUT: + return "OOP_FB_IN_SGL_OUT"; + case RTE_CRYPTODEV_FF_OOP_FB_IN_FB_OUT: + return "OOP_FB_IN_FB_OUT"; case RTE_CRYPTODEV_FF_CPU_NEON: return "CPU_NEON"; case RTE_CRYPTODEV_FF_CPU_ARM_CE: diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h index cc219c722..7942527e8 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -292,31 +292,47 @@ rte_cryptodev_get_aead_algo_enum(enum rte_crypto_aead_algorithm *algo_enum, * * Keep these flags synchronised with rte_cryptodev_get_feature_name() */ -#define RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO (1ULL << 0) +#define RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO (1ULL << 0) /**< Symmetric crypto operations are supported */ -#define RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO (1ULL << 1) +#define RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO (1ULL << 1) /**< Asymmetric crypto operations are supported */ -#define RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING (1ULL << 2) +#define RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING (1ULL << 2) /**< Chaining symmetric crypto operations are supported */ -#define RTE_CRYPTODEV_FF_CPU_SSE (1ULL << 3) +#define RTE_CRYPTODEV_FF_CPU_SSE (1ULL << 3) /**< Utilises CPU SIMD SSE instructions */ -#define RTE_CRYPTODEV_FF_CPU_AVX (1ULL << 4) +#define RTE_CRYPTODEV_FF_CPU_AVX (1ULL << 4) /**< Utilises CPU SIMD AVX instructions */ -#define RTE_CRYPTODEV_FF_CPU_AVX2 (1ULL << 5) +#define RTE_CRYPTODEV_FF_CPU_AVX2 (1ULL << 5) /**< Utilises CPU SIMD AVX2 instructions */ -#define RTE_CRYPTODEV_FF_CPU_AESNI (1ULL << 6) +#define RTE_CRYPTODEV_FF_CPU_AESNI (1ULL << 6) /**< Utilises CPU AES-NI instructions */ -#define RTE_CRYPTODEV_FF_HW_ACCELERATED (1ULL << 7) -/**< Operations are off-loaded to an external hardware accelerator */ -#define RTE_CRYPTODEV_FF_CPU_AVX512 (1ULL << 8) +#define RTE_CRYPTODEV_FF_HW_ACCELERATED (1ULL << 7) +/**< Operations are off-loaded to an + * external hardware accelerator + */ +#define RTE_CRYPTODEV_FF_CPU_AVX512 (1ULL << 8) /**< Utilises CPU SIMD AVX512 instructions */ -#define RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER (1ULL << 9) -/**< Scatter-gather mbufs are supported */ -#define RTE_CRYPTODEV_FF_CPU_NEON (1ULL << 10) +#define RTE_CRYPTODEV_FF_IN_PLACE_SGL (1ULL << 9) +/**< In-place Scatter-gather (SGL) mbufs are supported */ +#define RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT (1ULL << 10) +/**< Out-of-place Scatter-gather (SGL) mbufs are + * supported in input and output + */ +#define RTE_CRYPTODEV_FF_OOP_SGL_IN_FB_OUT (1ULL << 11) +/**< Out-of-place Scatter-gather (SGL) mbufs are supported + * in input, combined with flat buffers (FB) in output + */ +#define RTE_CRYPTODEV_FF_OOP_FB_IN_SGL_OUT (1ULL << 12) +/**< Out-of-place Scatter-gather (SGL) mbufs are supported + * in output, combined with flat buffers (FB) in input + */ +#define RTE_CRYPTODEV_FF_OOP_FB_IN_FB_OUT (1ULL << 13) +/**< Out-of-place flat buffers (FB) are supported in input and output */ +#define RTE_CRYPTODEV_FF_CPU_NEON (1ULL << 14) /**< Utilises CPU NEON instructions */ -#define RTE_CRYPTODEV_FF_CPU_ARM_CE (1ULL << 11) +#define RTE_CRYPTODEV_FF_CPU_ARM_CE (1ULL << 15) /**< Utilises ARM CPU Cryptographic Extensions */ -#define RTE_CRYPTODEV_FF_SECURITY (1ULL << 12) +#define RTE_CRYPTODEV_FF_SECURITY (1ULL << 16) /**< Support Security Protocol Processing */ diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c index 73aadaced..e23eecb66 100644 --- a/test/test/test_cryptodev.c +++ b/test/test/test_cryptodev.c @@ -3160,8 +3160,11 @@ test_kasumi_encryption_sgl(const struct kasumi_test_data *tdata) struct rte_cryptodev_info dev_info; rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); - if (!(dev_info.feature_flags & RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER)) { - printf("Device doesn't support scatter-gather. " + + uint64_t feat_flags = dev_info.feature_flags; + + if (!(feat_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) { + printf("Device doesn't support in-place scatter-gather. " "Test Skipped.\n"); return 0; } @@ -3308,8 +3311,11 @@ test_kasumi_encryption_oop_sgl(const struct kasumi_test_data *tdata) struct rte_cryptodev_info dev_info; rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); - if (!(dev_info.feature_flags & RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER)) { - printf("Device doesn't support scatter-gather. " + + uint64_t feat_flags = dev_info.feature_flags; + if (!(feat_flags & RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT)) { + printf("Device doesn't support out-of-place scatter-gather " + "in both input and output mbufs. " "Test Skipped.\n"); return 0; } @@ -3659,8 +3665,12 @@ test_snow3g_encryption_oop_sgl(const struct snow3g_test_data *tdata) struct rte_cryptodev_info dev_info; rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); - if (!(dev_info.feature_flags & RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER)) { - printf("Device doesn't support scatter-gather. " + + uint64_t feat_flags = dev_info.feature_flags; + + if (!(feat_flags & RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT)) { + printf("Device doesn't support out-of-place scatter-gather " + "in both input and output mbufs. " "Test Skipped.\n"); return 0; } @@ -4493,10 +4503,13 @@ test_zuc_encryption_sgl(const struct wireless_test_data *tdata) return -ENOTSUP; rte_cryptodev_info_get(ts_params->valid_devs[0], &dev_info); - if (!(dev_info.feature_flags & RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER)) { - printf("Device doesn't support scatter-gather. " + + uint64_t feat_flags = dev_info.feature_flags; + + if (!(feat_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) { + printf("Device doesn't support in-place scatter-gather. " "Test Skipped.\n"); - return -ENOTSUP; + return 0; } plaintext_len = ceil_byte_length(tdata->plaintext.len); diff --git a/test/test/test_cryptodev_blockcipher.c b/test/test/test_cryptodev_blockcipher.c index 256a7daa2..712771605 100644 --- a/test/test/test_cryptodev_blockcipher.c +++ b/test/test/test_cryptodev_blockcipher.c @@ -77,12 +77,25 @@ test_blockcipher_one_case(const struct blockcipher_test_case *t, if (t->feature_mask & BLOCKCIPHER_TEST_FEATURE_SG) { rte_cryptodev_info_get(dev_id, &dev_info); - if (!(dev_info.feature_flags & - RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER)) { - printf("Device doesn't support scatter-gather. " + uint64_t feat_flags = dev_info.feature_flags; + uint64_t oop_flag = RTE_CRYPTODEV_FF_OOP_SGL_IN_FB_OUT; + + if (t->feature_mask && BLOCKCIPHER_TEST_FEATURE_OOP) { + if (!(feat_flags & oop_flag)) { + printf("Device doesn't support out-of-place " + "scatter-gather in input mbuf. " + "Test Skipped.\n"); + return 0; + } + } else { + if (!(feat_flags & RTE_CRYPTODEV_FF_IN_PLACE_SGL)) { + printf("Device doesn't support in-place " + "scatter-gather mbufs. " "Test Skipped.\n"); - return 0; + return 0; + } } + nb_segs = 3; } -- 2.14.4