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 C6413A0093; Thu, 21 Apr 2022 14:31:25 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E8144427FF; Thu, 21 Apr 2022 14:31:02 +0200 (CEST) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by mails.dpdk.org (Postfix) with ESMTP id 873D0427EA for ; Thu, 21 Apr 2022 14:30:59 +0200 (CEST) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 6A4162007B0; Thu, 21 Apr 2022 14:30:59 +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 084A42007CF; Thu, 21 Apr 2022 14:30:59 +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 0A21F180031D; Thu, 21 Apr 2022 20:30:57 +0800 (+08) From: nipun.gupta@nxp.com To: dev@dpdk.org Cc: thomas@monjalon.net, g.singh@nxp.com, hemant.agrawal@nxp.com, gakhil@marvell.com, Nipun Gupta Subject: [PATCH 4/6] dma/dpaa2: add PMD apis for additional configuration Date: Thu, 21 Apr 2022 18:00:52 +0530 Message-Id: <20220421123054.22442-5-nipun.gupta@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20220421123054.22442-1-nipun.gupta@nxp.com> References: <20220421123054.22442-1-nipun.gupta@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP 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 From: Nipun Gupta Add additional PMD APIs for DPAA2 QDMA driver for configuring RBP, Ultra Short format, and Scatter Gather support Signed-off-by: Nipun Gupta --- drivers/dma/dpaa2/dpaa2_qdma.c | 38 ++++++++++ drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h | 96 ++++++++++++++++++++++++++ drivers/dma/dpaa2/version.map | 6 ++ 3 files changed, 140 insertions(+) create mode 100644 drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h diff --git a/drivers/dma/dpaa2/dpaa2_qdma.c b/drivers/dma/dpaa2/dpaa2_qdma.c index 785d8aea7b..54db806736 100644 --- a/drivers/dma/dpaa2/dpaa2_qdma.c +++ b/drivers/dma/dpaa2/dpaa2_qdma.c @@ -7,7 +7,10 @@ #include #include #include + #include + +#include "rte_pmd_dpaa2_qdma.h" #include "dpaa2_qdma.h" #include "dpaa2_qdma_logs.h" /* Dynamic log type identifier */ @@ -71,6 +74,41 @@ dpaa2_qdma_configure(struct rte_dma_dev *dev, return 0; } +/* Enable FD in Ultra Short format */ +void +rte_dpaa2_qdma_vchan_fd_us_enable(int16_t dev_id, uint16_t vchan) +{ + struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; + struct dpaa2_dpdmai_dev *dpdmai_dev = obj->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + + qdma_dev->vqs[vchan].flags |= DPAA2_QDMA_VQ_FD_SHORT_FORMAT; +} + +/* Enable internal SG processing */ +void +rte_dpaa2_qdma_vchan_internal_sg_enable(int16_t dev_id, uint16_t vchan) +{ + struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; + struct dpaa2_dpdmai_dev *dpdmai_dev = obj->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + + qdma_dev->vqs[vchan].flags |= DPAA2_QDMA_VQ_FD_SG_FORMAT; +} + +/* Enable RBP */ +void +rte_dpaa2_qdma_vchan_rbp_enable(int16_t dev_id, uint16_t vchan, + struct rte_dpaa2_qdma_rbp *rbp_config) +{ + struct rte_dma_fp_object *obj = &rte_dma_fp_objs[dev_id]; + struct dpaa2_dpdmai_dev *dpdmai_dev = obj->dev_private; + struct qdma_device *qdma_dev = dpdmai_dev->qdma_dev; + + memcpy(&qdma_dev->vqs[vchan].rbp, rbp_config, + sizeof(struct rte_dpaa2_qdma_rbp)); +} + static int dpaa2_qdma_vchan_setup(struct rte_dma_dev *dev, uint16_t vchan, const struct rte_dma_vchan_conf *conf, diff --git a/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h b/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h new file mode 100644 index 0000000000..a75cdd7e36 --- /dev/null +++ b/drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h @@ -0,0 +1,96 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright 2021-2022 NXP + */ + +#ifndef _RTE_PMD_DPAA2_QDMA_H_ +#define _RTE_PMD_DPAA2_QDMA_H_ + +/** States if the source addresses is physical. */ +#define RTE_DPAA2_QDMA_JOB_SRC_PHY (1ULL << 30) + +/** States if the destination addresses is physical. */ +#define RTE_DPAA2_QDMA_JOB_DEST_PHY (1ULL << 31) + +struct rte_dpaa2_qdma_rbp { + uint32_t use_ultrashort:1; + uint32_t enable:1; + /** + * dportid: + * 0000 PCI-Express 1 + * 0001 PCI-Express 2 + * 0010 PCI-Express 3 + * 0011 PCI-Express 4 + * 0100 PCI-Express 5 + * 0101 PCI-Express 6 + */ + uint32_t dportid:4; + uint32_t dpfid:2; + uint32_t dvfid:6; + /*using route by port for destination */ + uint32_t drbp:1; + /** + * sportid: + * 0000 PCI-Express 1 + * 0001 PCI-Express 2 + * 0010 PCI-Express 3 + * 0011 PCI-Express 4 + * 0100 PCI-Express 5 + * 0101 PCI-Express 6 + */ + uint32_t sportid:4; + uint32_t spfid:2; + uint32_t svfid:6; + /* using route by port for source */ + uint32_t srbp:1; + uint32_t rsv:4; +}; + +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice. + * + * Enable FD in Ultra Short format on a channel. This API should be + * called before calling 'rte_dma_vchan_setup()' API. + * + * @param dev_id + * The identifier of the device. + * @param vchan + * The identifier of virtual DMA channel. + */ +__rte_experimental +void rte_dpaa2_qdma_vchan_fd_us_enable(int16_t dev_id, uint16_t vchan); + +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice. + * + * Enable internal SG processing on a channel. This API should be + * called before calling 'rte_dma_vchan_setup()' API. + * + * @param dev_id + * The identifier of the device. + * @param vchan + * The identifier of virtual DMA channel. + */ +__rte_experimental +void rte_dpaa2_qdma_vchan_internal_sg_enable(int16_t dev_id, uint16_t vchan); + +/** + * @warning + * @b EXPERIMENTAL: this API may change without prior notice. + * + * Enable Route-by-port on a channel. This API should be + * called before calling 'rte_dma_vchan_setup()' API. + * + * @param dev_id + * The identifier of the device. + * @param vchan + * The identifier of virtual DMA channel. + * @param rbp_config + * Configuration for route-by-port + */ +__rte_experimental +void rte_dpaa2_qdma_vchan_rbp_enable(int16_t dev_id, uint16_t vchan, + struct rte_dpaa2_qdma_rbp *rbp_config); + +#endif /* _RTE_PMD_DPAA2_QDMA_H_ */ diff --git a/drivers/dma/dpaa2/version.map b/drivers/dma/dpaa2/version.map index c2e0723b4c..3b3019267f 100644 --- a/drivers/dma/dpaa2/version.map +++ b/drivers/dma/dpaa2/version.map @@ -1,3 +1,9 @@ DPDK_22 { local: *; }; + +EXPERIMENTAL { + rte_dpaa2_qdma_vchan_fd_us_enable; + rte_dpaa2_qdma_vchan_internal_sg_enable; + rte_dpaa2_qdma_vchan_rbp_enable; +}; -- 2.17.1