DPDK patches and discussions
 help / color / mirror / Atom feed
From: Srikanth Yalavarthi <syalavarthi@marvell.com>
To: Srikanth Yalavarthi <syalavarthi@marvell.com>
Cc: <dev@dpdk.org>, <sshankarnara@marvell.com>, <aprabhu@marvell.com>,
	<ptakkar@marvell.com>
Subject: [PATCH v1 1/1] mldev: support get queue pair count
Date: Tue, 30 Jul 2024 23:13:36 -0700	[thread overview]
Message-ID: <20240731061336.8385-1-syalavarthi@marvell.com> (raw)

Added API to get ML device queue-pair count.

Signed-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>
---
 lib/mldev/rte_mldev.c | 15 +++++++++++++++
 lib/mldev/rte_mldev.h | 13 +++++++++++++
 lib/mldev/version.map |  1 +
 3 files changed, 29 insertions(+)

diff --git a/lib/mldev/rte_mldev.c b/lib/mldev/rte_mldev.c
index 196b1850e65..37d71aebc92 100644
--- a/lib/mldev/rte_mldev.c
+++ b/lib/mldev/rte_mldev.c
@@ -365,6 +365,21 @@ rte_ml_dev_stop(int16_t dev_id)
 	return ret;
 }
 
+uint16_t
+rte_ml_dev_queue_pair_count(int16_t dev_id)
+{
+	struct rte_ml_dev *dev;
+
+	if (!rte_ml_dev_is_valid_dev(dev_id)) {
+		RTE_MLDEV_LOG(ERR, "Invalid dev_id = %d", dev_id);
+		return -EINVAL;
+	}
+
+	dev = rte_ml_dev_pmd_get_dev(dev_id);
+
+	return dev->data->nb_queue_pairs;
+}
+
 int
 rte_ml_dev_queue_pair_setup(int16_t dev_id, uint16_t queue_pair_id,
 			    const struct rte_ml_dev_qp_conf *qp_conf, int socket_id)
diff --git a/lib/mldev/rte_mldev.h b/lib/mldev/rte_mldev.h
index 634af3d5e1a..767f8c2593b 100644
--- a/lib/mldev/rte_mldev.h
+++ b/lib/mldev/rte_mldev.h
@@ -317,6 +317,19 @@ struct rte_ml_dev_qp_conf {
 	 */
 };
 
+/**
+ * Get the number of queue pairs on a specific ML device.
+ *
+ * @param dev_id
+ *   The identifier of the device.
+ *
+ * @return
+ *   - The number of configured queue pairs.
+ */
+__rte_experimental
+uint16_t
+rte_ml_dev_queue_pair_count(int16_t dev_id);
+
 /**
  * Set up a queue pair for a device. This should only be called when the device is stopped.
  *
diff --git a/lib/mldev/version.map b/lib/mldev/version.map
index 84bdd6c3004..acf6395b4aa 100644
--- a/lib/mldev/version.map
+++ b/lib/mldev/version.map
@@ -11,6 +11,7 @@ EXPERIMENTAL {
 	rte_ml_dev_init;
 	rte_ml_dev_is_valid_dev;
 	rte_ml_dev_logtype;
+	rte_ml_dev_queue_pair_count;
 	rte_ml_dev_queue_pair_setup;
 	rte_ml_dev_selftest;
 	rte_ml_dev_socket_id;
-- 
2.45.1


             reply	other threads:[~2024-07-31  6:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-31  6:13 Srikanth Yalavarthi [this message]
2024-10-17 21:03 ` 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=20240731061336.8385-1-syalavarthi@marvell.com \
    --to=syalavarthi@marvell.com \
    --cc=aprabhu@marvell.com \
    --cc=dev@dpdk.org \
    --cc=ptakkar@marvell.com \
    --cc=sshankarnara@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).