From: Amit Prakash Shukla <amitprakashs@marvell.com>
To: Chengwen Feng <fengchengwen@huawei.com>,
Kevin Laatz <kevin.laatz@intel.com>,
Bruce Richardson <bruce.richardson@intel.com>
Cc: <dev@dpdk.org>, <jerinj@marvell.com>, <mb@smartsharesystems.com>,
<conor.walsh@intel.com>, <vattunuru@marvell.com>,
<g.singh@nxp.com>, <sachin.saxena@oss.nxp.com>,
<hemant.agrawal@nxp.com>, <cheng1.jiang@intel.com>,
<ndabilpuram@marvell.com>, <anoobj@marvell.com>,
Amit Prakash Shukla <amitprakashs@marvell.com>
Subject: [RFC PATCH v2] dmadev: offload to free source buffer
Date: Thu, 10 Aug 2023 22:23:14 +0530 [thread overview]
Message-ID: <20230810165314.2238725-1-amitprakashs@marvell.com> (raw)
In-Reply-To: <20230809060835.2030833-1-amitprakashs@marvell.com>
This changeset adds support in DMA library to free source DMA buffer by
hardware. On a supported hardware, application can pass on the mempool
information as part of vchan config when the DMA transfer direction is
configured as RTE_DMA_DIR_MEM_TO_DEV.
Signed-off-by: Amit Prakash Shukla <amitprakashs@marvell.com>
---
v2:
- Added note related to mempool.
lib/dmadev/rte_dmadev.h | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/lib/dmadev/rte_dmadev.h b/lib/dmadev/rte_dmadev.h
index e61d71959e..f4879d9fd8 100644
--- a/lib/dmadev/rte_dmadev.h
+++ b/lib/dmadev/rte_dmadev.h
@@ -278,6 +278,13 @@ int16_t rte_dma_next_dev(int16_t start_dev_id);
#define RTE_DMA_CAPA_OPS_COPY_SG RTE_BIT64(33)
/** Support fill operation. */
#define RTE_DMA_CAPA_OPS_FILL RTE_BIT64(34)
+/** Support for source buffer free for mem to dev transfer.
+ *
+ * @note Even though the DMA driver has this capability, it may not support all
+ * mempool drivers. If the mempool is not supported by the DMA driver,
+ * rte_dma_vchan_setup() will fail.
+ **/
+#define RTE_DMA_CAPA_MEM_TO_DEV_SOURCE_BUFFER_FREE RTE_BIT64(35)
/**@}*/
/**
@@ -582,6 +589,19 @@ struct rte_dma_vchan_conf {
* @see struct rte_dma_port_param
*/
struct rte_dma_port_param dst_port;
+ /** mempool from which source buffer is allocated. mempool info is used
+ * for freeing source buffer by hardware when configured direction is
+ * RTE_DMA_DIR_MEM_TO_DEV. To free the source buffer by hardware,
+ * RTE_DMA_OP_FLAG_FREE_SBUF must be set while calling rte_dma_copy and
+ * rte_dma_copy_sg().
+ *
+ * @note If the mempool is not supported by the DMA driver,
+ * rte_dma_vchan_setup() will fail.
+ *
+ * @see RTE_DMA_OP_FLAG_FREE_SBUF
+ */
+ struct rte_mempool *mem_to_dev_src_buf_pool;
+
};
/**
@@ -819,6 +839,13 @@ struct rte_dma_sge {
* capability bit for this, driver should not return error if this flag was set.
*/
#define RTE_DMA_OP_FLAG_LLC RTE_BIT64(2)
+/** Mem to dev source buffer free flag.
+ * Used for freeing source DMA buffer by hardware when the transfer direction is
+ * configured as RTE_DMA_DIR_MEM_TO_DEV.
+ *
+ * @see struct rte_dma_vchan_conf::mem_to_dev_src_buf_pool
+ */
+#define RTE_DMA_OP_FLAG_FREE_SBUF RTE_BIT64(3)
/**@}*/
/**
--
2.25.1
next prev parent reply other threads:[~2023-08-10 16:53 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-09 6:08 [RFC PATCH] " Amit Prakash Shukla
2023-08-09 9:07 ` Morten Brørup
2023-08-09 14:27 ` Amit Prakash Shukla
2023-08-09 14:48 ` Morten Brørup
2023-08-09 18:11 ` Amit Prakash Shukla
2023-08-10 9:32 ` Morten Brørup
2023-08-10 10:27 ` Amit Prakash Shukla
2023-08-10 11:35 ` Morten Brørup
2023-08-10 12:11 ` Amit Prakash Shukla
2023-08-10 16:53 ` Amit Prakash Shukla [this message]
2023-08-10 18:20 ` [RFC PATCH v2] " Morten Brørup
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=20230810165314.2238725-1-amitprakashs@marvell.com \
--to=amitprakashs@marvell.com \
--cc=anoobj@marvell.com \
--cc=bruce.richardson@intel.com \
--cc=cheng1.jiang@intel.com \
--cc=conor.walsh@intel.com \
--cc=dev@dpdk.org \
--cc=fengchengwen@huawei.com \
--cc=g.singh@nxp.com \
--cc=hemant.agrawal@nxp.com \
--cc=jerinj@marvell.com \
--cc=kevin.laatz@intel.com \
--cc=mb@smartsharesystems.com \
--cc=ndabilpuram@marvell.com \
--cc=sachin.saxena@oss.nxp.com \
--cc=vattunuru@marvell.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).