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 0C548A0548; Mon, 27 Sep 2021 15:26:29 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BE61541144; Mon, 27 Sep 2021 15:25:35 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id 9CD6640E3C for ; Mon, 27 Sep 2021 15:25:24 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 7EAF02007D9; Mon, 27 Sep 2021 15:25:24 +0200 (CEST) Received: from aprdc01srsp001v.ap-rdc01.nxp.com (aprdc01srsp001v.ap-rdc01.nxp.com [165.114.16.16]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 47113201116; Mon, 27 Sep 2021 15:25:24 +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 A275B183AD0B; Mon, 27 Sep 2021 21:25:23 +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 18:55:17 +0530 Message-Id: <20210927132519.19264-10-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210927132519.19264-1-nipun.gupta@nxp.com> References: <20210927122650.30881-1-nipun.gupta@nxp.com> <20210927132519.19264-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v1 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..6b7b51747e 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