From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 48E0D41FD0; Wed, 30 Aug 2023 17:52:36 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4392A4027F; Wed, 30 Aug 2023 17:52:36 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 03E004027A; Wed, 30 Aug 2023 17:52:34 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37U6P6L6004359; Wed, 30 Aug 2023 08:52:34 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=K2f66UT17VhQuV7Tkd5fzWq/PG0N9gQQyTwHMREtubM=; b=QdBcQGa3KrDFQXbxpJHbdgBvpYna4D44HnKXYCp37zNU02G5BdnUYg8eTxRBmNPZCic2 raWJ5M8cN66lwvDQS5CIqGgmFARoCWLORa8tnfXltEBu5Rp6wSoYkkVoj5qZuLIxejnc J/0PczAa/IdkentiXN5rd0d5UOvHFepEE9zgoAUEjJjckMoohrGbwk1NJKKvmc64OlPE vEcefbdQhZ1ObGCcjZHHNB/b4RRUeaVYDLuASiKV03KOvJrkrKnAYyw62+r4jAvWACdj Kjuqt1KuXZawfqSTVB0I7uu8LSoSC4FFSTAaH0Oi1B05P60ZdGJnaas8tcqjgPLYVqmV 2w== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3st0fysrye-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 30 Aug 2023 08:52:34 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Wed, 30 Aug 2023 08:52:32 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.48 via Frontend Transport; Wed, 30 Aug 2023 08:52:32 -0700 Received: from ml-host-33.caveonetworks.com (unknown [10.110.143.233]) by maili.marvell.com (Postfix) with ESMTP id 2047B3F707F; Wed, 30 Aug 2023 08:52:32 -0700 (PDT) From: Srikanth Yalavarthi To: Srikanth Yalavarthi , Anup Prabhu CC: , , , Subject: [PATCH v1 1/1] app/mldev: updates to device ops test Date: Wed, 30 Aug 2023 08:52:30 -0700 Message-ID: <20230830155230.30176-1-syalavarthi@marvell.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: DPq84dnmZ0sVesdCHsVGWyx36adTEhm2 X-Proofpoint-ORIG-GUID: DPq84dnmZ0sVesdCHsVGWyx36adTEhm2 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26 definitions=2023-08-30_12,2023-08-29_01,2023-05-22_02 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 Updated device_ops test to configure the device with user specific arguments. Fix handling unsupported values for queue_pairs and queue_size Fixes: c0e871657d6a ("app/mldev: support queue pairs and size") Cc: stable@dpdk.org Signed-off-by: Srikanth Yalavarthi --- app/test-mldev/test_common.c | 10 ++++++++++ app/test-mldev/test_device_ops.c | 18 ++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/app/test-mldev/test_common.c b/app/test-mldev/test_common.c index 3cf1362285b..357a85a3126 100644 --- a/app/test-mldev/test_common.c +++ b/app/test-mldev/test_common.c @@ -106,6 +106,16 @@ ml_test_opt_check(struct ml_options *opt) return -EINVAL; } + if (opt->queue_pairs == 0) { + ml_err("Invalid option, queue_pairs = %d", opt->queue_pairs); + return -EINVAL; + } + + if (opt->queue_size == 0) { + ml_err("Invalid option, queue_size = %d", opt->queue_size); + return -EINVAL; + } + return 0; } diff --git a/app/test-mldev/test_device_ops.c b/app/test-mldev/test_device_ops.c index 81b3ca18f36..dacc0232a2f 100644 --- a/app/test-mldev/test_device_ops.c +++ b/app/test-mldev/test_device_ops.c @@ -102,15 +102,17 @@ test_device_reconfigure(struct ml_test *test, struct ml_options *opt) if (ret != 0) return ret; - /* setup one queue pair with nb_desc = 1 */ - qp_conf.nb_desc = 1; - qp_conf.cb = NULL; + /* setup queue pairs with nb_user options */ + for (qp_id = 0; qp_id < opt->queue_pairs; qp_id++) { + qp_conf.nb_desc = opt->queue_size; + qp_conf.cb = NULL; - ret = rte_ml_dev_queue_pair_setup(opt->dev_id, qp_id, &qp_conf, opt->socket_id); - if (ret != 0) { - ml_err("Failed to setup ML device queue-pair, dev_id = %d, qp_id = %u\n", - opt->dev_id, qp_id); - goto error; + ret = rte_ml_dev_queue_pair_setup(opt->dev_id, qp_id, &qp_conf, opt->socket_id); + if (ret != 0) { + ml_err("Failed to setup ML device queue-pair, dev_id = %d, qp_id = %u\n", + opt->dev_id, qp_id); + goto error; + } } /* start device */ -- 2.41.0