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 7759FA0548; Mon, 27 Sep 2021 14:27:53 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 81BF641139; Mon, 27 Sep 2021 14:27:06 +0200 (CEST) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id 880FF40E3C for ; Mon, 27 Sep 2021 14:26:56 +0200 (CEST) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 681611A1E68; Mon, 27 Sep 2021 14:26:56 +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 2EC751A13F8; Mon, 27 Sep 2021 14:26:56 +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 7B989183AD26; Mon, 27 Sep 2021 20:26:55 +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: Mon, 27 Sep 2021 17:56:48 +0530 Message-Id: <20210927122650.30881-10-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210927122650.30881-1-nipun.gupta@nxp.com> References: <20210927122650.30881-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH 09/11] 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 c961e18d67..2048c2c514 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 %ld, Got: %ld", + 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 %ld, Got: %ld", + 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