[v1,1/1] app/mldev: updates to device ops test

Message ID 20230830155230.30176-1-syalavarthi@marvell.com (mailing list archive)
State Accepted, archived
Delegated to: Thomas Monjalon
Headers
Series [v1,1/1] app/mldev: updates to device ops test |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/github-robot: build success github build: passed
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-unit-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS
ci/iol-unit-arm64-testing success Testing PASS
ci/iol-sample-apps-testing success Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/intel-Functional success Functional PASS

Commit Message

Srikanth Yalavarthi Aug. 30, 2023, 3:52 p.m. UTC
  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 <syalavarthi@marvell.com>
---
 app/test-mldev/test_common.c     | 10 ++++++++++
 app/test-mldev/test_device_ops.c | 18 ++++++++++--------
 2 files changed, 20 insertions(+), 8 deletions(-)
  

Comments

Anup Prabhu Oct. 3, 2023, 3:47 p.m. UTC | #1
> -----Original Message-----
> From: Srikanth Yalavarthi <syalavarthi@marvell.com>
> Sent: Wednesday, August 30, 2023 9:23 PM
> To: Srikanth Yalavarthi <syalavarthi@marvell.com>; Anup Prabhu
> <aprabhu@marvell.com>
> Cc: dev@dpdk.org; Shivah Shankar Shankar Narayan Rao
> <sshankarnara@marvell.com>; Prince Takkar <ptakkar@marvell.com>;
> stable@dpdk.org
> Subject: [PATCH v1 1/1] app/mldev: updates to device ops test
> 
> 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 <syalavarthi@marvell.com>
Acked-by: Anup Prabhu <aprabhu@marvell.com>
  
Shivah Shankar Shankar Narayan Rao Oct. 5, 2023, 9:15 a.m. UTC | #2
> -----Original Message-----
> From: Srikanth Yalavarthi <syalavarthi@marvell.com>
> Sent: Wednesday, August 30, 2023 9:23 PM
> To: Srikanth Yalavarthi <syalavarthi@marvell.com>; Anup Prabhu
> <aprabhu@marvell.com>
> Cc: dev@dpdk.org; Shivah Shankar Shankar Narayan Rao
> <sshankarnara@marvell.com>; Prince Takkar <ptakkar@marvell.com>;
> stable@dpdk.org
> Subject: [PATCH v1 1/1] app/mldev: updates to device ops test
> 
> 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 <syalavarthi@marvell.com>
Acked-by: Shivah Shankar S <sshankarnara@marvell.com>
  
Thomas Monjalon Nov. 14, 2023, 9:21 p.m. UTC | #3
03/10/2023 17:47, Anup Prabhu:
> From: Srikanth Yalavarthi <syalavarthi@marvell.com>
> > 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 <syalavarthi@marvell.com>
> Acked-by: Anup Prabhu <aprabhu@marvell.com>

Applied, thanks.
  

Patch

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 */