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 C42DFA0C41; Wed, 6 Oct 2021 14:11:23 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7432641447; Wed, 6 Oct 2021 14:10:35 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id B85E1410F2 for ; Wed, 6 Oct 2021 14:10:27 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 95FB41A239B; Wed, 6 Oct 2021 14:10:27 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 5EE891A04F6; Wed, 6 Oct 2021 14:10:27 +0200 (CEST) Received: from lsv03274.swis.in-blr01.nxp.com (lsv03274.swis.in-blr01.nxp.com [92.120.147.114]) by aprdc01srsp001v.ap-rdc01.nxp.com (Postfix) with ESMTP id BD27E183AC94; Wed, 6 Oct 2021 20:10:26 +0800 (+08) From: nipun.gupta@nxp.com To: dev@dpdk.org Cc: thomas@monjalon.net, ferruh.yigit@intel.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com, Nipun Gupta Date: Wed, 6 Oct 2021 17:40:20 +0530 Message-Id: <20211006121022.27119-9-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211006121022.27119-1-nipun.gupta@nxp.com> References: <20210927122650.30881-1-nipun.gupta@nxp.com> <20211006121022.27119-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2 08/10] raw/dpaa2_qdma: use correct params for config and queue setup 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" From: Nipun Gupta RAW configure and Queue setup APIs support size parameter for configure. This patch supports the same for DPAA2 QDMA PMD APIs Signed-off-by: Nipun Gupta --- drivers/raw/dpaa2_qdma/dpaa2_qdma.c | 12 +++++++++--- drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h | 8 ++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c index 7b80370b36..5d82e132b7 100644 --- a/drivers/raw/dpaa2_qdma/dpaa2_qdma.c +++ b/drivers/raw/dpaa2_qdma/dpaa2_qdma.c @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018-2020 NXP + * Copyright 2018-2021 NXP */ #include @@ -1146,8 +1146,11 @@ dpaa2_qdma_configure(const struct rte_rawdev *rawdev, DPAA2_QDMA_FUNC_TRACE(); - if (config_size != sizeof(*qdma_config)) + if (config_size != sizeof(*qdma_config)) { + DPAA2_QDMA_ERR("Config size mismatch. Expected %" PRIu64 + ", Got: %" PRIu64, sizeof(*qdma_config), config_size); return -EINVAL; + } /* In case QDMA device is not in stopped state, return -EBUSY */ if (qdma_dev->state == 1) { @@ -1247,8 +1250,11 @@ dpaa2_qdma_queue_setup(struct rte_rawdev *rawdev, DPAA2_QDMA_FUNC_TRACE(); - if (conf_size != sizeof(*q_config)) + if (conf_size != sizeof(*q_config)) { + DPAA2_QDMA_ERR("Config size mismatch. Expected %" PRIu64 + ", Got: %" PRIu64, sizeof(*q_config), conf_size); return -EINVAL; + } rte_spinlock_lock(&qdma_dev->lock); diff --git a/drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h b/drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h index cc1ac25451..1314474271 100644 --- a/drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h +++ b/drivers/raw/dpaa2_qdma/rte_pmd_dpaa2_qdma.h @@ -1,5 +1,5 @@ /* SPDX-License-Identifier: BSD-3-Clause - * Copyright 2018-2020 NXP + * Copyright 2018-2021 NXP */ #ifndef __RTE_PMD_DPAA2_QDMA_H__ @@ -177,13 +177,13 @@ struct rte_qdma_queue_config { #define rte_qdma_info rte_rawdev_info #define rte_qdma_start(id) rte_rawdev_start(id) #define rte_qdma_reset(id) rte_rawdev_reset(id) -#define rte_qdma_configure(id, cf) rte_rawdev_configure(id, cf) +#define rte_qdma_configure(id, cf, sz) rte_rawdev_configure(id, cf, sz) #define rte_qdma_dequeue_buffers(id, buf, num, ctxt) \ rte_rawdev_dequeue_buffers(id, buf, num, ctxt) #define rte_qdma_enqueue_buffers(id, buf, num, ctxt) \ rte_rawdev_enqueue_buffers(id, buf, num, ctxt) -#define rte_qdma_queue_setup(id, qid, cfg) \ - rte_rawdev_queue_setup(id, qid, cfg) +#define rte_qdma_queue_setup(id, qid, cfg, sz) \ + rte_rawdev_queue_setup(id, qid, cfg, sz) /*TODO introduce per queue stats API in rawdew */ /** -- 2.17.1