From patchwork Wed Jul 31 06:13:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srikanth Yalavarthi X-Patchwork-Id: 142778 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7766E456FF; Wed, 31 Jul 2024 08:14:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 61398406BC; Wed, 31 Jul 2024 08:14:03 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 7FE1F406BC for ; Wed, 31 Jul 2024 08:13:41 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 46V3DPYw001739 for ; Tue, 30 Jul 2024 23:13:39 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h= cc:content-transfer-encoding:content-type:date:from:message-id :mime-version:subject:to; s=pfpt0220; bh=a2Shwy5TebNEUxXBfv2n3Kl I6WWRhtDv9tWz763dS3E=; b=HiwDdf/DIH+fhs56khT7APTaRWTC53J20T13vQI m/89dNbUEWQd9uJpaHh6Zpux5bF7NDH3gMjQPKfbe1BgfcToUpqlzZby4C79vcA/ VqOQcVARftVN+YJV7H8uKDllCZI3fCKX9aTOQJ/7/bMhZi+GnAKZDqkKYLGADKm3 Et407P+qU5hftAVQXnZPu4NK/pHghGIdVEpz8RldlVvEbXiY3Pa9bdkWxi3p9mt8 98Vtx2nbQH595xLIjoEbA4q6vzpHl5WtKkLGWBLeCIQPRv8eq/YHL6sqaXmkjnN1 X+zHjHgXq+N8PC8mhuTFWDGKYa3Z3zeQZ8pgglF94dH9j2A== Received: from dc5-exch05.marvell.com ([199.233.59.128]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 40qd64rjn1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 30 Jul 2024 23:13:39 -0700 (PDT) Received: from DC5-EXCH05.marvell.com (10.69.176.209) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.4; Tue, 30 Jul 2024 23:13:38 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH05.marvell.com (10.69.176.209) with Microsoft SMTP Server id 15.2.1544.4 via Frontend Transport; Tue, 30 Jul 2024 23:13:38 -0700 Received: from ml-host-33.sclab.marvell.com. (unknown [10.110.143.233]) by maili.marvell.com (Postfix) with ESMTP id 8DC7F5C68E1; Tue, 30 Jul 2024 23:13:38 -0700 (PDT) From: Srikanth Yalavarthi To: Srikanth Yalavarthi CC: , , , Subject: [PATCH v1 1/1] mldev: support get queue pair count Date: Tue, 30 Jul 2024 23:13:36 -0700 Message-ID: <20240731061336.8385-1-syalavarthi@marvell.com> X-Mailer: git-send-email 2.45.1 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: HRAmITDqfneP7ZcCS0mAe7DJrlV-yrPn X-Proofpoint-GUID: HRAmITDqfneP7ZcCS0mAe7DJrlV-yrPn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.28.16 definitions=2024-07-31_03,2024-07-30_01,2024-05-17_01 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Added API to get ML device queue-pair count. Signed-off-by: Srikanth Yalavarthi --- 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;