All of lore.kernel.org
 help / color / mirror / Atom feed
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 <nipun.gupta@nxp.com>
Subject: [PATCH v2 4/6] dma/dpaa2: add PMD apis for additional configuration
Date: Thu,  5 May 2022 13:01:06 +0530	[thread overview]
Message-ID: <20220505073108.17112-5-nipun.gupta@nxp.com> (raw)
In-Reply-To: <20220505073108.17112-1-nipun.gupta@nxp.com>

From: Nipun Gupta <nipun.gupta@nxp.com>

Add additional PMD APIs for DPAA2 QDMA driver for configuring
RBP, Ultra Short format, and Scatter Gather support

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
---
 doc/api/doxy-api-index.md              |  1 +
 doc/api/doxy-api.conf.in               |  1 +
 drivers/dma/dpaa2/dpaa2_qdma.c         | 38 ++++++++++
 drivers/dma/dpaa2/meson.build          |  2 +
 drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h | 96 ++++++++++++++++++++++++++
 drivers/dma/dpaa2/version.map          |  6 ++
 6 files changed, 144 insertions(+)
 create mode 100644 drivers/dma/dpaa2/rte_pmd_dpaa2_qdma.h

diff --git a/doc/api/doxy-api-index.md b/doc/api/doxy-api-index.md
index 6c1ca981bc..4245b9635c 100644
--- a/doc/api/doxy-api-index.md
+++ b/doc/api/doxy-api-index.md
@@ -53,6 +53,7 @@ The public API headers are grouped by topics:
   [mlx5]               (@ref rte_pmd_mlx5.h),
   [dpaa2_mempool]      (@ref rte_dpaa2_mempool.h),
   [dpaa2_cmdif]        (@ref rte_pmd_dpaa2_cmdif.h),
+  [dpaa2_qdma]         (@ref rte_pmd_dpaa2_qdma.h),
   [crypto_scheduler]   (@ref rte_cryptodev_scheduler.h),
   [dlb2]               (@ref rte_pmd_dlb2.h),
   [ifpga]              (@ref rte_pmd_ifpga.h)
diff --git a/doc/api/doxy-api.conf.in b/doc/api/doxy-api.conf.in
index a73aac2410..93425e38eb 100644
--- a/doc/api/doxy-api.conf.in
+++ b/doc/api/doxy-api.conf.in
@@ -7,6 +7,7 @@ USE_MDFILE_AS_MAINPAGE  = @TOPDIR@/doc/api/doxy-api-index.md
 INPUT                   = @TOPDIR@/doc/api/doxy-api-index.md \
                           @TOPDIR@/drivers/bus/vdev \
                           @TOPDIR@/drivers/crypto/scheduler \
+                          @TOPDIR@/drivers/dma/dpaa2 \
                           @TOPDIR@/drivers/event/dlb2 \
                           @TOPDIR@/drivers/mempool/dpaa2 \
                           @TOPDIR@/drivers/net/ark \
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 <rte_dmadev.h>
 #include <rte_dmadev_pmd.h>
 #include <rte_kvargs.h>
+
 #include <mc/fsl_dpdmai.h>
+
+#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/meson.build b/drivers/dma/dpaa2/meson.build
index 2b82563e85..a99151e2a5 100644
--- a/drivers/dma/dpaa2/meson.build
+++ b/drivers/dma/dpaa2/meson.build
@@ -14,3 +14,5 @@ sources = files('dpaa2_qdma.c')
 if cc.has_argument('-Wno-pointer-arith')
     cflags += '-Wno-pointer-arith'
 endif
+
+headers = files('rte_pmd_dpaa2_qdma.h')
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


  parent reply	other threads:[~2022-05-05  7:31 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-21 12:30 [PATCH 0/6] move DPAA2 QDMA driver freom raw to dma nipun.gupta
2022-04-21 12:30 ` [PATCH 1/6] raw/dpaa2_qdma: remove dpaa2 QDMA driver from raw nipun.gupta
2022-04-21 12:30 ` [PATCH 2/6] dma/dpaa2: introduce DPAA2 DMA driver skeleton nipun.gupta
2022-04-21 12:30 ` [PATCH 3/6] dma/dpaa2: support basic operations nipun.gupta
2022-04-21 12:30 ` [PATCH 4/6] dma/dpaa2: add PMD apis for additional configuration nipun.gupta
2022-04-21 12:30 ` [PATCH 5/6] dma/dpaa2: support DMA operations nipun.gupta
2022-04-21 12:30 ` [PATCH 6/6] dma/dpaa2: support statistics nipun.gupta
2022-05-05  7:31 ` [PATCH v2 0/6] move DPAA2 QDMA driver freom raw to dma nipun.gupta
2022-05-05  7:31   ` [PATCH v2 1/6] raw/dpaa2_qdma: remove dpaa2 QDMA driver from raw nipun.gupta
2022-05-05  7:31   ` [PATCH v2 2/6] dma/dpaa2: introduce DPAA2 DMA driver skeleton nipun.gupta
2022-05-05  7:31   ` [PATCH v2 3/6] dma/dpaa2: support basic operations nipun.gupta
2022-05-05  7:31   ` nipun.gupta [this message]
2022-05-05  7:31   ` [PATCH v2 5/6] dma/dpaa2: support DMA operations nipun.gupta
2022-05-05  7:31   ` [PATCH v2 6/6] dma/dpaa2: support statistics nipun.gupta
2022-05-05  9:05 ` [PATCH v3 0/6] move DPAA2 QDMA driver freom raw to dma nipun.gupta
2022-05-05  9:05   ` [PATCH v3 1/6] raw/dpaa2_qdma: remove dpaa2 QDMA driver from raw nipun.gupta
2022-05-05  9:05   ` [PATCH v3 2/6] dma/dpaa2: introduce DPAA2 DMA driver skeleton nipun.gupta
2022-05-05  9:05   ` [PATCH v3 3/6] dma/dpaa2: support basic operations nipun.gupta
2022-05-05  9:05   ` [PATCH v3 4/6] dma/dpaa2: add PMD apis for additional configuration nipun.gupta
2022-05-05  9:05   ` [PATCH v3 5/6] dma/dpaa2: support DMA operations nipun.gupta
2022-05-05  9:05   ` [PATCH v3 6/6] dma/dpaa2: support statistics nipun.gupta
2022-05-26  6:00   ` [PATCH v3 0/6] move DPAA2 QDMA driver freom raw to dma Hemant Agrawal
2022-05-31 15:29     ` Thomas Monjalon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220505073108.17112-5-nipun.gupta@nxp.com \
    --to=nipun.gupta@nxp.com \
    --cc=G.Singh@nxp.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=thomas@monjalon.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.