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 25944A0C43; Mon, 11 Oct 2021 14:43:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7EBEC41109; Mon, 11 Oct 2021 14:43:53 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id E2AD8410FC for ; Mon, 11 Oct 2021 14:43:51 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19BBgP6Y002410; Mon, 11 Oct 2021 05:43:46 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=MhmDNfyj7h4S3tihQu5I2+RaDoi2kss3+WAjjxgk8So=; b=C9y/D6UY1Cv87WOc3cDFCtML+m4dwLcVt7zGP43ofU4Jk3ry9zITz22tGASJTaI3FBSn 7x0UkI4AYg95VV9Fl9N5zbwcrYhZLokU9w4SihqDfiMzEwNiQDwuGGYevNwuqXx8KKJo q6Bxi7sGcIEeLr5nAMN0Q01VZ9zmPYnQsd3UULztsfRGmEyHyogQeXZKW32EARlcUhGH u5mZ2XvoRIept6tPjhgk5eWdEbn/pSLA677+L+iXdJckNpZtip+CATlsfhgD6SY2u4z4 jR+WfVkxGcbPwSyYCUJJmgaIYulU74k2i0eRsK5O3pW1q6IUNdAIEibG1nZKd44sBooo Lw== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com with ESMTP id 3bmaa5tb1y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Mon, 11 Oct 2021 05:43:46 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Mon, 11 Oct 2021 05:43:45 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Mon, 11 Oct 2021 05:43:44 -0700 Received: from localhost.localdomain (unknown [10.28.36.185]) by maili.marvell.com (Postfix) with ESMTP id B71463F707B; Mon, 11 Oct 2021 05:43:39 -0700 (PDT) From: Akhil Goyal To: CC: , , , , , , , , , , , , , , , , , , , Akhil Goyal Date: Mon, 11 Oct 2021 18:13:08 +0530 Message-ID: <20211011124309.4066491-5-gakhil@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20211011124309.4066491-1-gakhil@marvell.com> References: <20210829125139.2173235-1-gakhil@marvell.com> <20211011124309.4066491-1-gakhil@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: m0Ukl-VY-iF3ujA-mEFLaqFxVrmrfuuk X-Proofpoint-ORIG-GUID: m0Ukl-VY-iF3ujA-mEFLaqFxVrmrfuuk X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-10-11_04,2021-10-07_02,2020-04-07_01 Subject: [dpdk-dev] [PATCH v2 4/5] cryptodev: update fast path APIs to use new flat array 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" Rework fast-path cryptodev functions to use rte_crypto_fp_ops[]. While it is an API/ABI breakage, this change is intended to be transparent for both users (no changes in user app is required) and PMD developers (no changes in PMD is required). Signed-off-by: Akhil Goyal --- lib/cryptodev/rte_cryptodev.h | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h index ce0dca72be..739ad529e5 100644 --- a/lib/cryptodev/rte_cryptodev.h +++ b/lib/cryptodev/rte_cryptodev.h @@ -1832,13 +1832,18 @@ static inline uint16_t rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, uint16_t nb_ops) { - struct rte_cryptodev *dev = &rte_cryptodevs[dev_id]; + struct rte_crypto_fp_ops *fp_ops; + void *qp; rte_cryptodev_trace_dequeue_burst(dev_id, qp_id, (void **)ops, nb_ops); - nb_ops = (*dev->dequeue_burst) - (dev->data->queue_pairs[qp_id], ops, nb_ops); + + fp_ops = &rte_crypto_fp_ops[dev_id]; + qp = fp_ops->qp.data[qp_id]; + + nb_ops = fp_ops->dequeue_burst(qp, ops, nb_ops); + #ifdef RTE_CRYPTO_CALLBACKS - if (unlikely(dev->deq_cbs != NULL)) { + if (unlikely(fp_ops->qp.deq_cb != NULL)) { struct rte_cryptodev_cb_rcu *list; struct rte_cryptodev_cb *cb; @@ -1848,7 +1853,7 @@ rte_cryptodev_dequeue_burst(uint8_t dev_id, uint16_t qp_id, * cb and cb->fn/cb->next, __ATOMIC_ACQUIRE memory order is * not required. */ - list = &dev->deq_cbs[qp_id]; + list = (struct rte_cryptodev_cb_rcu *)&fp_ops->qp.deq_cb[qp_id]; rte_rcu_qsbr_thread_online(list->qsbr, 0); cb = __atomic_load_n(&list->next, __ATOMIC_RELAXED); @@ -1899,10 +1904,13 @@ static inline uint16_t rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id, struct rte_crypto_op **ops, uint16_t nb_ops) { - struct rte_cryptodev *dev = &rte_cryptodevs[dev_id]; + struct rte_crypto_fp_ops *fp_ops; + void *qp; + fp_ops = &rte_crypto_fp_ops[dev_id]; + qp = fp_ops->qp.data[qp_id]; #ifdef RTE_CRYPTO_CALLBACKS - if (unlikely(dev->enq_cbs != NULL)) { + if (unlikely(fp_ops->qp.enq_cb != NULL)) { struct rte_cryptodev_cb_rcu *list; struct rte_cryptodev_cb *cb; @@ -1912,7 +1920,7 @@ rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id, * cb and cb->fn/cb->next, __ATOMIC_ACQUIRE memory order is * not required. */ - list = &dev->enq_cbs[qp_id]; + list = (struct rte_cryptodev_cb_rcu *)&fp_ops->qp.enq_cb[qp_id]; rte_rcu_qsbr_thread_online(list->qsbr, 0); cb = __atomic_load_n(&list->next, __ATOMIC_RELAXED); @@ -1927,8 +1935,7 @@ rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id, #endif rte_cryptodev_trace_enqueue_burst(dev_id, qp_id, (void **)ops, nb_ops); - return (*dev->enqueue_burst)( - dev->data->queue_pairs[qp_id], ops, nb_ops); + return fp_ops->enqueue_burst(qp, ops, nb_ops); } -- 2.25.1