[v1,1/1] app/mldev: updates to device ops test
Checks
Commit Message
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
> -----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>
> -----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>
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.
@@ -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;
}
@@ -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 */