From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <dev-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id EA80A42624;
	Sat, 23 Sep 2023 15:35:21 +0200 (CEST)
Received: from mails.dpdk.org (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 6E89A402D3;
	Sat, 23 Sep 2023 15:35:15 +0200 (CEST)
Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com
 [67.231.156.173])
 by mails.dpdk.org (Postfix) with ESMTP id 69284402DD
 for <dev@dpdk.org>; Sat, 23 Sep 2023 15:35:14 +0200 (CEST)
Received: from pps.filterd (m0045851.ppops.net [127.0.0.1])
 by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id
 38NDVN8l021591; Sat, 23 Sep 2023 06:35:13 -0700
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;
 h=from : to : cc :
 subject : date : message-id : in-reply-to : references : mime-version :
 content-transfer-encoding : content-type; s=pfpt0220;
 bh=KwCTh4GrRRBpG2LZnLl59yDsCpY/t6p4P4bi7whsW78=;
 b=gr32IeT/soTuiqzSRi3y+1C8eqyABjqI679tmI6yE/UCkzs4rpONxAKTW6YAETcOhe4D
 yEzK9BC3VdoXTyA2qlpo8n635fDdE91XH66nBNYTFT+g3IYAY+nkZJ/YWiJgVFFaVT19
 8kdCi2KKVz1Lx5ou601HJd9BOTTmUsPQEfn+1MduLP/9xyO5hWvbKPrP7U/M7quL3dJl
 MMFBDV5sBlptQJdXhK4I5ysoUEBH8nhBjxhb0IB3n2iAom+H5eK9TVrqyPLFkEk1Wi7Z
 ti6o3i+KgJhMrO+P+upn+SnaCnqN/UaEPIAYrenxEQqignE3hMmi0OJaXyT9WP/xxbmq Hw== 
Received: from dc5-exch01.marvell.com ([199.233.59.181])
 by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3t9yhkr5ky-1
 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);
 Sat, 23 Sep 2023 06:35:13 -0700
Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com
 (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48;
 Sat, 23 Sep 2023 06:35:11 -0700
Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com
 (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend
 Transport; Sat, 23 Sep 2023 06:35:11 -0700
Received: from localhost.localdomain (unknown [10.28.36.157])
 by maili.marvell.com (Postfix) with ESMTP id 845473F7065;
 Sat, 23 Sep 2023 06:35:07 -0700 (PDT)
From: Amit Prakash Shukla <amitprakashs@marvell.com>
To: Jerin Jacob <jerinj@marvell.com>
CC: <dev@dpdk.org>, <fengchengwen@huawei.com>, <kevin.laatz@intel.com>,
 <bruce.richardson@intel.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>, <mb@smartsharesystems.com>,
 Amit Prakash Shukla <amitprakashs@marvell.com>
Subject: [PATCH v3 02/12] eventdev: api to get DMA adapter capabilities
Date: Sat, 23 Sep 2023 19:04:39 +0530
Message-ID: <20230923133449.3780841-3-amitprakashs@marvell.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20230923133449.3780841-1-amitprakashs@marvell.com>
References: <20230922201337.3347666-1-amitprakashs@marvell.com>
 <20230923133449.3780841-1-amitprakashs@marvell.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Content-Type: text/plain
X-Proofpoint-GUID: 7k_BKwSMKzeBwJf6LKwmiC_0PgdamePg
X-Proofpoint-ORIG-GUID: 7k_BKwSMKzeBwJf6LKwmiC_0PgdamePg
X-Proofpoint-Virus-Version: vendor=baseguard
 engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26
 definitions=2023-09-23_10,2023-09-21_01,2023-05-22_02
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: DPDK patches and discussions <dev.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
Errors-To: dev-bounces@dpdk.org

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 <amitprakashs@marvell.com>
---
 lib/eventdev/meson.build    |  2 +-
 lib/eventdev/rte_eventdev.c | 23 +++++++++++++++++++++++
 lib/eventdev/rte_eventdev.h |  2 +-
 lib/meson.build             |  2 +-
 4 files changed, 26 insertions(+), 3 deletions(-)

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)
 {
diff --git a/lib/eventdev/rte_eventdev.h b/lib/eventdev/rte_eventdev.h
index 026f7c367d..cef90aebf6 100644
--- a/lib/eventdev/rte_eventdev.h
+++ b/lib/eventdev/rte_eventdev.h
@@ -1503,7 +1503,7 @@ rte_event_crypto_adapter_caps_get(uint8_t dev_id, uint8_t cdev_id,
  *
  */
 int
-rte_event_dma_adapter_caps_get(uint8_t dev_id, int16_t dmadev_id, uint32_t *caps);
+rte_event_dma_adapter_caps_get(uint8_t dev_id, uint8_t dmadev_id, uint32_t *caps);
 
 /* Ethdev Tx adapter capability bitmap flags */
 #define RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT	0x1
diff --git a/lib/meson.build b/lib/meson.build
index 53155be8e9..f3191f10b6 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -33,6 +33,7 @@ libraries = [
         'compressdev',
         'cryptodev',
         'distributor',
+        'dmadev',
         'efd',
         'eventdev',
         'gpudev',
@@ -48,7 +49,6 @@ libraries = [
         'rawdev',
         'regexdev',
         'mldev',
-        'dmadev',
         'rib',
         'reorder',
         'sched',
-- 
2.25.1