From: Srikanth Yalavarthi <syalavarthi@marvell.com>
To: Srikanth Yalavarthi <syalavarthi@marvell.com>,
Anup Prabhu <aprabhu@marvell.com>
Cc: <dev@dpdk.org>, <sshankarnara@marvell.com>, <ptakkar@marvell.com>,
<stable@dpdk.org>
Subject: [PATCH v1 1/1] app/mldev: updates to device ops test
Date: Wed, 30 Aug 2023 08:52:30 -0700 [thread overview]
Message-ID: <20230830155230.30176-1-syalavarthi@marvell.com> (raw)
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(-)
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
next reply other threads:[~2023-08-30 15:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-30 15:52 Srikanth Yalavarthi [this message]
2023-10-03 15:47 ` Anup Prabhu
2023-11-14 21:21 ` Thomas Monjalon
2023-10-05 9:15 ` Shivah Shankar Shankar Narayan Rao
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=20230830155230.30176-1-syalavarthi@marvell.com \
--to=syalavarthi@marvell.com \
--cc=aprabhu@marvell.com \
--cc=dev@dpdk.org \
--cc=ptakkar@marvell.com \
--cc=sshankarnara@marvell.com \
--cc=stable@dpdk.org \
/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).