Added a new eventdev API rte_event_dma_adapter_caps_get(), to get
DMA adapter capabilities supported by the driver.

Signed-off-by: Amit Prakash Shukla <amitpraka...@marvell.com>
---
 lib/eventdev/meson.build    |  2 +-
 lib/eventdev/rte_eventdev.c | 23 +++++++++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/lib/eventdev/meson.build b/lib/eventdev/meson.build
index 21347f7c4c..b46bbbc9aa 100644
--- a/lib/eventdev/meson.build
+++ b/lib/eventdev/meson.build
@@ -43,5 +43,5 @@ driver_sdk_headers += files(
         'event_timer_adapter_pmd.h',
 )
 
-deps += ['ring', 'ethdev', 'hash', 'mempool', 'mbuf', 'timer', 'cryptodev']
+deps += ['ring', 'ethdev', 'hash', 'mempool', 'mbuf', 'timer', 'cryptodev', 
'dmadev']
 deps += ['telemetry']
diff --git a/lib/eventdev/rte_eventdev.c b/lib/eventdev/rte_eventdev.c
index 6ab4524332..60509c6efb 100644
--- a/lib/eventdev/rte_eventdev.c
+++ b/lib/eventdev/rte_eventdev.c
@@ -20,6 +20,7 @@
 #include <rte_errno.h>
 #include <ethdev_driver.h>
 #include <rte_cryptodev.h>
+#include <rte_dmadev.h>
 #include <cryptodev_pmd.h>
 #include <rte_telemetry.h>
 
@@ -224,6 +225,28 @@ rte_event_eth_tx_adapter_caps_get(uint8_t dev_id, uint16_t 
eth_port_id,
                        : 0;
 }
 
+int
+rte_event_dma_adapter_caps_get(uint8_t dev_id, uint8_t dma_dev_id, uint32_t 
*caps)
+{
+       struct rte_eventdev *dev;
+
+       RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
+       if (!rte_dma_is_valid(dma_dev_id))
+               return -EINVAL;
+
+       dev = &rte_eventdevs[dev_id];
+
+       if (caps == NULL)
+               return -EINVAL;
+
+       *caps = 0;
+
+       if (dev->dev_ops->dma_adapter_caps_get)
+               return (*dev->dev_ops->dma_adapter_caps_get)(dev, dma_dev_id, 
caps);
+
+       return 0;
+}
+
 static inline int
 event_dev_queue_config(struct rte_eventdev *dev, uint8_t nb_queues)
 {
-- 
2.25.1

Reply via email to