[v3,03/26] app/test-bbdev: remove use of ethdev queue count value

Message ID 20240814104933.14062-4-bruce.richardson@intel.com (mailing list archive)
State Changes Requested, archived
Delegated to: Thomas Monjalon
Headers
Series add meson config options for queues per port |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Bruce Richardson Aug. 14, 2024, 10:49 a.m. UTC
Replace the use of RTE_MAX_QUEUES_PER_PORT, which is intended as an
ethdev define, with the limit from the bbdev library.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 app/test-bbdev/test_bbdev.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
  

Comments

David Marchand Sept. 19, 2024, 1:36 p.m. UTC | #1
On Wed, Aug 14, 2024 at 12:50 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> Replace the use of RTE_MAX_QUEUES_PER_PORT, which is intended as an
> ethdev define, with the limit from the bbdev library.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> Acked-by: Morten Brørup <mb@smartsharesystems.com>

Cc: Maxime

> ---
>  app/test-bbdev/test_bbdev.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/app/test-bbdev/test_bbdev.c b/app/test-bbdev/test_bbdev.c
> index 0bbce6ca92..2e626efd74 100644
> --- a/app/test-bbdev/test_bbdev.c
> +++ b/app/test-bbdev/test_bbdev.c
> @@ -297,7 +297,7 @@ test_bbdev_configure_stop_queue(void)
>                         "Failed test for rte_bbdev_queue_stop "
>                         "invalid dev_id ");
>
> -       TEST_ASSERT_FAIL(rte_bbdev_queue_stop(dev_id, RTE_MAX_QUEUES_PER_PORT),
> +       TEST_ASSERT_FAIL(rte_bbdev_queue_stop(dev_id, RTE_BBDEV_DEFAULT_MAX_NB_QUEUES),

According to lib/bbdev/rte_bbdev_pmd.h:

/** Suggested value for SW based devices */
#define RTE_BBDEV_DEFAULT_MAX_NB_QUEUES RTE_MAX_LCORE

So it is not clear to me that this is a safe maximum value.

I would instead pass a queue id which is >= devinfo.num_queues.


>                         "Failed test for rte_bbdev_queue_stop "
>                         "invalid queue_id ");
>
> @@ -1176,7 +1176,7 @@ test_bbdev_invalid_driver(void)
>                         "invalid dev_id ");
>
>         TEST_ASSERT_FAIL(rte_bbdev_queue_info_get(dev_id,
> -                       RTE_MAX_QUEUES_PER_PORT, &qinfo),
> +                       RTE_BBDEV_DEFAULT_MAX_NB_QUEUES, &qinfo),

Idem.

>                         "Failed test for rte_bbdev_info_get: "
>                         "invalid queue_id ");
>
  

Patch

diff --git a/app/test-bbdev/test_bbdev.c b/app/test-bbdev/test_bbdev.c
index 0bbce6ca92..2e626efd74 100644
--- a/app/test-bbdev/test_bbdev.c
+++ b/app/test-bbdev/test_bbdev.c
@@ -297,7 +297,7 @@  test_bbdev_configure_stop_queue(void)
 			"Failed test for rte_bbdev_queue_stop "
 			"invalid dev_id ");
 
-	TEST_ASSERT_FAIL(rte_bbdev_queue_stop(dev_id, RTE_MAX_QUEUES_PER_PORT),
+	TEST_ASSERT_FAIL(rte_bbdev_queue_stop(dev_id, RTE_BBDEV_DEFAULT_MAX_NB_QUEUES),
 			"Failed test for rte_bbdev_queue_stop "
 			"invalid queue_id ");
 
@@ -1176,7 +1176,7 @@  test_bbdev_invalid_driver(void)
 			"invalid dev_id ");
 
 	TEST_ASSERT_FAIL(rte_bbdev_queue_info_get(dev_id,
-			RTE_MAX_QUEUES_PER_PORT, &qinfo),
+			RTE_BBDEV_DEFAULT_MAX_NB_QUEUES, &qinfo),
 			"Failed test for rte_bbdev_info_get: "
 			"invalid queue_id ");