From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 9304AA054F; Tue, 16 Mar 2021 12:15:04 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3EE7E2427B9; Tue, 16 Mar 2021 12:15:04 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id 06F582427AC for ; Tue, 16 Mar 2021 12:15:02 +0100 (CET) IronPort-SDR: pq/aiqMMCXB2uSQS8y9otqcPBArbgfnps3qR1B0D+fZeKAo3pLQAQLGFlHZZM1298P2nkwvmBz iFQPOAYZJtuQ== X-IronPort-AV: E=McAfee;i="6000,8403,9924"; a="189289982" X-IronPort-AV: E=Sophos;i="5.81,251,1610438400"; d="scan'208";a="189289982" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Mar 2021 04:15:01 -0700 IronPort-SDR: hFeVfYfG1AJmDHVRh2oVwichy+CSIJahZ6myon7f7h4j5A6QHGzXsq8Ew1hCW8fXeANClZVgr5 MaYQcOYDncpw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,251,1610438400"; d="scan'208";a="432987108" Received: from silpixa00400885.ir.intel.com ([10.243.23.122]) by fmsmga004.fm.intel.com with ESMTP; 16 Mar 2021 04:14:59 -0700 From: Fan Zhang To: dev@dpdk.org Cc: gakhil@marvell.com, Fan Zhang Date: Tue, 16 Mar 2021 11:14:55 +0000 Message-Id: <20210316111455.509633-1-roy.fan.zhang@intel.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] cryptodev: change raw data path dequeue API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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" This patch changes the experimental raw data path dequeue burst API. Originally the API enforces the user to provide callback function to get maximum dequeue count. This change gives the user one more option to pass directly the expected dequeue count. Signed-off-by: Fan Zhang --- app/test/test_cryptodev.c | 8 +------- doc/guides/rel_notes/release_21_05.rst | 2 ++ drivers/crypto/qat/qat_sym_hw_dp.c | 4 +++- lib/librte_cryptodev/rte_cryptodev.c | 5 +++-- lib/librte_cryptodev/rte_cryptodev.h | 8 ++++++++ 5 files changed, 17 insertions(+), 10 deletions(-) diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c index f91debc16..a91054742 100644 --- a/app/test/test_cryptodev.c +++ b/app/test/test_cryptodev.c @@ -162,12 +162,6 @@ ceil_byte_length(uint32_t num_bits) return (num_bits >> 3); } -static uint32_t -get_raw_dp_dequeue_count(void *user_data __rte_unused) -{ - return 1; -} - static void post_process_raw_dp_op(void *user_data, uint32_t index __rte_unused, uint8_t is_op_success) @@ -345,7 +339,7 @@ process_sym_raw_dp_op(uint8_t dev_id, uint16_t qp_id, n = n_success = 0; while (count++ < MAX_RAW_DEQUEUE_COUNT && n == 0) { n = rte_cryptodev_raw_dequeue_burst(ctx, - get_raw_dp_dequeue_count, post_process_raw_dp_op, + NULL, 1, post_process_raw_dp_op, (void **)&ret_op, 0, &n_success, &dequeue_status); if (dequeue_status < 0) { diff --git a/doc/guides/rel_notes/release_21_05.rst b/doc/guides/rel_notes/release_21_05.rst index 21dc6d234..b9ca0cc30 100644 --- a/doc/guides/rel_notes/release_21_05.rst +++ b/doc/guides/rel_notes/release_21_05.rst @@ -130,6 +130,8 @@ ABI Changes * No ABI change that would break compatibility with 20.11. +* cryptodev: the function ``rte_cryptodev_raw_dequeue_burst`` is added a + parameter ``max_nb_to_dequeue`` to give user a more flexible dequeue control. Known Issues ------------ diff --git a/drivers/crypto/qat/qat_sym_hw_dp.c b/drivers/crypto/qat/qat_sym_hw_dp.c index 01afb883e..e075f3ec2 100644 --- a/drivers/crypto/qat/qat_sym_hw_dp.c +++ b/drivers/crypto/qat/qat_sym_hw_dp.c @@ -707,6 +707,7 @@ qat_sym_dp_enqueue_chain_jobs(void *qp_data, uint8_t *drv_ctx, static __rte_always_inline uint32_t qat_sym_dp_dequeue_burst(void *qp_data, uint8_t *drv_ctx, rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count, + uint32_t max_nb_to_dequeue, rte_cryptodev_raw_post_dequeue_t post_dequeue, void **out_user_data, uint8_t is_user_data_array, uint32_t *n_success_jobs, int *return_status) @@ -736,7 +737,8 @@ qat_sym_dp_dequeue_burst(void *qp_data, uint8_t *drv_ctx, resp_opaque = (void *)(uintptr_t)resp->opaque_data; /* get the dequeue count */ - n = get_dequeue_count(resp_opaque); + n = get_dequeue_count != NULL ? get_dequeue_count(resp_opaque) : + max_nb_to_dequeue; if (unlikely(n == 0)) return 0; diff --git a/lib/librte_cryptodev/rte_cryptodev.c b/lib/librte_cryptodev/rte_cryptodev.c index 40f55a3cd..0c16b04f8 100644 --- a/lib/librte_cryptodev/rte_cryptodev.c +++ b/lib/librte_cryptodev/rte_cryptodev.c @@ -2232,13 +2232,14 @@ rte_cryptodev_raw_enqueue_done(struct rte_crypto_raw_dp_ctx *ctx, uint32_t rte_cryptodev_raw_dequeue_burst(struct rte_crypto_raw_dp_ctx *ctx, rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count, + uint32_t max_nb_to_dequeue, rte_cryptodev_raw_post_dequeue_t post_dequeue, void **out_user_data, uint8_t is_user_data_array, uint32_t *n_success_jobs, int *status) { return (*ctx->dequeue_burst)(ctx->qp_data, ctx->drv_ctx_data, - get_dequeue_count, post_dequeue, out_user_data, - is_user_data_array, n_success_jobs, status); + get_dequeue_count, max_nb_to_dequeue, post_dequeue, + out_user_data, is_user_data_array, n_success_jobs, status); } int diff --git a/lib/librte_cryptodev/rte_cryptodev.h b/lib/librte_cryptodev/rte_cryptodev.h index ae34f33f6..b2a125511 100644 --- a/lib/librte_cryptodev/rte_cryptodev.h +++ b/lib/librte_cryptodev/rte_cryptodev.h @@ -1546,6 +1546,9 @@ typedef void (*rte_cryptodev_raw_post_dequeue_t)(void *user_data, * @param drv_ctx Driver specific context data. * @param get_dequeue_count User provided callback function to * obtain dequeue operation count. + * @param max_nb_to_dequeue When get_dequeue_count is NULL this + * value is used to pass the maximum + * number of operations to be dequeued. * @param post_dequeue User provided callback function to * post-process a dequeued operation. * @param out_user_data User data pointer array to be retrieve @@ -1580,6 +1583,7 @@ typedef void (*rte_cryptodev_raw_post_dequeue_t)(void *user_data, typedef uint32_t (*cryptodev_sym_raw_dequeue_burst_t)(void *qp, uint8_t *drv_ctx, rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count, + uint32_t max_nb_to_dequeue, rte_cryptodev_raw_post_dequeue_t post_dequeue, void **out_user_data, uint8_t is_user_data_array, uint32_t *n_success, int *dequeue_status); @@ -1747,6 +1751,9 @@ rte_cryptodev_raw_enqueue_done(struct rte_crypto_raw_dp_ctx *ctx, * data. * @param get_dequeue_count User provided callback function to * obtain dequeue operation count. + * @param max_nb_to_dequeue When get_dequeue_count is NULL this + * value is used to pass the maximum + * number of operations to be dequeued. * @param post_dequeue User provided callback function to * post-process a dequeued operation. * @param out_user_data User data pointer array to be retrieve @@ -1782,6 +1789,7 @@ __rte_experimental uint32_t rte_cryptodev_raw_dequeue_burst(struct rte_crypto_raw_dp_ctx *ctx, rte_cryptodev_raw_get_dequeue_count_t get_dequeue_count, + uint32_t max_nb_to_dequeue, rte_cryptodev_raw_post_dequeue_t post_dequeue, void **out_user_data, uint8_t is_user_data_array, uint32_t *n_success, int *dequeue_status); -- 2.25.1