From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by dpdk.org (Postfix) with ESMTP id 6A27D1D03B for ; Sat, 9 Jun 2018 00:02:33 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jun 2018 15:02:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,491,1520924400"; d="scan'208";a="61618479" Received: from silpixa00399464.ir.intel.com (HELO silpixa00399464.ger.corp.intel.com) ([10.237.222.157]) by fmsmga004.fm.intel.com with ESMTP; 08 Jun 2018 15:02:30 -0700 From: Pablo de Lara To: declan.doherty@intel.com, akhil.goyal@nxp.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: Fri, 8 Jun 2018 23:02:34 +0100 Message-Id: <20180608220234.10170-7-pablo.de.lara.guarch@intel.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180608220234.10170-1-pablo.de.lara.guarch@intel.com> References: <20180608220234.10170-1-pablo.de.lara.guarch@intel.com> Subject: [dpdk-dev] [PATCH 6/6] 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: Fri, 08 Jun 2018 22:02:34 -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. Therefore, two new flags will replace this flag: RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_IN and RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_OUT. Signed-off-by: Pablo de Lara --- doc/guides/rel_notes/deprecation.rst | 2 - doc/guides/rel_notes/release_18_08.rst | 4 ++ drivers/crypto/aesni_gcm/aesni_gcm_pmd.c | 2 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 2 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 3 +- drivers/crypto/null/null_crypto_pmd.c | 3 +- drivers/crypto/openssl/rte_openssl_pmd.c | 2 +- drivers/crypto/qat/rte_qat_cryptodev.c | 3 +- lib/librte_cryptodev/rte_cryptodev.c | 6 ++- lib/librte_cryptodev/rte_cryptodev.h | 12 +++--- test/test/test_cryptodev.c | 41 ++++++++++++++------- test/test/test_cryptodev_blockcipher.c | 11 ++++-- 12 files changed, 59 insertions(+), 32 deletions(-) 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 0624f3701..89b84846c 100644 --- a/doc/guides/rel_notes/release_18_08.rst +++ b/doc/guides/rel_notes/release_18_08.rst @@ -72,6 +72,10 @@ 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 more explicit``RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_IN`` + and ``RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_OUT`` flags. + ABI Changes ----------- diff --git a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c index cd5b1952b..aa795cbbc 100644 --- a/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c +++ b/drivers/crypto/aesni_gcm/aesni_gcm_pmd.c @@ -492,7 +492,7 @@ 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_MBUF_SCATTER_GATHER_IN; 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 471ad1cbb..cadfeddeb 100644 --- a/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +++ b/drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c @@ -2762,7 +2762,7 @@ 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_MBUF_SCATTER_GATHER_IN; internals = cryptodev->data->dev_private; internals->max_nb_sessions = RTE_DPAA2_SEC_PMD_MAX_NB_SESSIONS; diff --git a/drivers/crypto/dpaa_sec/dpaa_sec.c b/drivers/crypto/dpaa_sec/dpaa_sec.c index e7ae33c5e..54540d7f6 100644 --- a/drivers/crypto/dpaa_sec/dpaa_sec.c +++ b/drivers/crypto/dpaa_sec/dpaa_sec.c @@ -2270,7 +2270,8 @@ 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_MBUF_SCATTER_GATHER_IN | + RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_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 a8499cf94..d9dc22e0f 100644 --- a/drivers/crypto/null/null_crypto_pmd.c +++ b/drivers/crypto/null/null_crypto_pmd.c @@ -177,7 +177,8 @@ 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_MBUF_SCATTER_GATHER_IN | + RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_OUT; internals = dev->data->dev_private; diff --git a/drivers/crypto/openssl/rte_openssl_pmd.c b/drivers/crypto/openssl/rte_openssl_pmd.c index 965cab9f2..6878baa4c 100644 --- a/drivers/crypto/openssl/rte_openssl_pmd.c +++ b/drivers/crypto/openssl/rte_openssl_pmd.c @@ -1660,7 +1660,7 @@ 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_MBUF_SCATTER_GATHER_IN; /* Set vector instructions mode supported */ internals = dev->data->dev_private; diff --git a/drivers/crypto/qat/rte_qat_cryptodev.c b/drivers/crypto/qat/rte_qat_cryptodev.c index bb109f8ba..4f1ba5f30 100644 --- a/drivers/crypto/qat/rte_qat_cryptodev.c +++ b/drivers/crypto/qat/rte_qat_cryptodev.c @@ -89,7 +89,8 @@ crypto_qat_create(const char *name, struct rte_pci_device *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_MBUF_SCATTER_GATHER_IN | + RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_OUT; internals = cryptodev->data->dev_private; switch (pci_dev->id.device_id) { diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index 40e249e79..b180d4c84 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -361,8 +361,10 @@ 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_MBUF_SCATTER_GATHER_IN: + return "MBUF_INPUT_SCATTER_GATHER"; + case RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_OUT: + return "MBUF_OUTPUT_SCATTER_GATHER"; 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 8e8a59522..bfb52e7f2 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -345,13 +345,15 @@ rte_cryptodev_get_aead_algo_enum(enum rte_crypto_aead_algorithm *algo_enum, /**< 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_MBUF_SCATTER_GATHER_IN (1ULL << 9) +/**< Scatter-gather input mbufs are supported */ +#define RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_OUT (1ULL << 10) +/**< Scatter-gather output mbufs are supported */ +#define RTE_CRYPTODEV_FF_CPU_NEON (1ULL << 11) /**< Utilises CPU NEON instructions */ -#define RTE_CRYPTODEV_FF_CPU_ARM_CE (1ULL << 11) +#define RTE_CRYPTODEV_FF_CPU_ARM_CE (1ULL << 12) /**< Utilises ARM CPU Cryptographic Extensions */ -#define RTE_CRYPTODEV_FF_SECURITY (1ULL << 12) +#define RTE_CRYPTODEV_FF_SECURITY (1ULL << 13) /**< Support Security Protocol Processing */ diff --git a/test/test/test_cryptodev.c b/test/test/test_cryptodev.c index 2c687bd7c..627c3b1b3 100644 --- a/test/test/test_cryptodev.c +++ b/test/test/test_cryptodev.c @@ -3152,9 +3152,13 @@ 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. " - "Test Skipped.\n"); + + uint64_t feat_flags = dev_info.feature_flags; + + if (!(feat_flags & RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_IN) || + !(feat_flags & RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_OUT)) { + printf("Device doesn't support scatter-gather in both input " + "and output mbufs. Test Skipped.\n"); return 0; } @@ -3300,9 +3304,12 @@ 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. " - "Test Skipped.\n"); + + uint64_t feat_flags = dev_info.feature_flags; + if (!(feat_flags & RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_IN) || + !(feat_flags & RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_OUT)) { + printf("Device doesn't support scatter-gather in both input " + "and output mbufs. Test Skipped.\n"); return 0; } @@ -3651,9 +3658,13 @@ 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. " - "Test Skipped.\n"); + + uint64_t feat_flags = dev_info.feature_flags; + + if (!(feat_flags & RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_IN) || + !(feat_flags & RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_OUT)) { + printf("Device doesn't support scatter-gather in both input " + "and output mbufs. Test Skipped.\n"); return 0; } @@ -4485,10 +4496,14 @@ 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. " - "Test Skipped.\n"); - return -ENOTSUP; + + uint64_t feat_flags = dev_info.feature_flags; + + if (!(feat_flags & RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_IN) || + !(feat_flags & RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_OUT)) { + printf("Device doesn't support scatter-gather in both input " + "and output mbufs. Test Skipped.\n"); + 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..7a56171e9 100644 --- a/test/test/test_cryptodev_blockcipher.c +++ b/test/test/test_cryptodev_blockcipher.c @@ -77,10 +77,13 @@ 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. " - "Test Skipped.\n"); + uint64_t feat_flags = dev_info.feature_flags; + + if (!(feat_flags & RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_IN) || + !(feat_flags & + RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER_OUT)) { + printf("Device doesn't support scatter-gather in both input " + "and output mbufs. Test Skipped.\n"); return 0; } nb_segs = 3; -- 2.17.0