[v3,01/26] cryptodev: remove use of ethdev max queues definition

Message ID 20240814104933.14062-2-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
The number of queue pairs supported by cryptodev should not be dependent
on the number of ethdev Rx or Tx queues, so add a new define for
cryptodev specifically.

Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
Acked-by: Morten Brørup <mb@smartsharesystems.com>
---
 config/rte_config.h           | 1 +
 lib/cryptodev/cryptodev_pmd.c | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)
  

Comments

David Marchand Sept. 19, 2024, 1:16 p.m. UTC | #1
On Wed, Aug 14, 2024 at 12:50 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
>
> The number of queue pairs supported by cryptodev should not be dependent
> on the number of ethdev Rx or Tx queues, so add a new define for
> cryptodev specifically.
>
> Signed-off-by: Bruce Richardson <bruce.richardson@intel.com>
> Acked-by: Morten Brørup <mb@smartsharesystems.com>
> ---
>  config/rte_config.h           | 1 +
>  lib/cryptodev/cryptodev_pmd.c | 4 ++--
>  2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/config/rte_config.h b/config/rte_config.h
> index dd7bb0d35b..d67ff77c71 100644
> --- a/config/rte_config.h
> +++ b/config/rte_config.h
> @@ -71,6 +71,7 @@
>
>  /* cryptodev defines */
>  #define RTE_CRYPTO_MAX_DEVS 64
> +#define RTE_CRYPTO_MAX_QPS_PER_DEV 256

Cc: Akhil.

Before this patch, the dummy_cb array could hold 1024 entries, so I
wonder if this is enough / what the reason is to go to 256.

Additionnally, should we check
rte_cryptodev_pmd_init_params->max_nb_queue_pairs in
rte_cryptodev_pmd_create() ?

>  #define RTE_CRYPTODEV_NAME_LEN 64
>  #define RTE_CRYPTO_CALLBACKS 1
>
> diff --git a/lib/cryptodev/cryptodev_pmd.c b/lib/cryptodev/cryptodev_pmd.c
> index 87ced122b4..d3263bd907 100644
> --- a/lib/cryptodev/cryptodev_pmd.c
> +++ b/lib/cryptodev/cryptodev_pmd.c
> @@ -212,8 +212,8 @@ dummy_crypto_dequeue_burst(__rte_unused void *qp,
>  void
>  cryptodev_fp_ops_reset(struct rte_crypto_fp_ops *fp_ops)
>  {
> -       static struct rte_cryptodev_cb_rcu dummy_cb[RTE_MAX_QUEUES_PER_PORT];
> -       static void *dummy_data[RTE_MAX_QUEUES_PER_PORT];
> +       static struct rte_cryptodev_cb_rcu dummy_cb[RTE_CRYPTO_MAX_QPS_PER_DEV];
> +       static void *dummy_data[RTE_CRYPTO_MAX_QPS_PER_DEV];
>         static const struct rte_crypto_fp_ops dummy = {
>                 .enqueue_burst = dummy_crypto_enqueue_burst,
>                 .dequeue_burst = dummy_crypto_dequeue_burst,
> --
> 2.43.0
>
  

Patch

diff --git a/config/rte_config.h b/config/rte_config.h
index dd7bb0d35b..d67ff77c71 100644
--- a/config/rte_config.h
+++ b/config/rte_config.h
@@ -71,6 +71,7 @@ 
 
 /* cryptodev defines */
 #define RTE_CRYPTO_MAX_DEVS 64
+#define RTE_CRYPTO_MAX_QPS_PER_DEV 256
 #define RTE_CRYPTODEV_NAME_LEN 64
 #define RTE_CRYPTO_CALLBACKS 1
 
diff --git a/lib/cryptodev/cryptodev_pmd.c b/lib/cryptodev/cryptodev_pmd.c
index 87ced122b4..d3263bd907 100644
--- a/lib/cryptodev/cryptodev_pmd.c
+++ b/lib/cryptodev/cryptodev_pmd.c
@@ -212,8 +212,8 @@  dummy_crypto_dequeue_burst(__rte_unused void *qp,
 void
 cryptodev_fp_ops_reset(struct rte_crypto_fp_ops *fp_ops)
 {
-	static struct rte_cryptodev_cb_rcu dummy_cb[RTE_MAX_QUEUES_PER_PORT];
-	static void *dummy_data[RTE_MAX_QUEUES_PER_PORT];
+	static struct rte_cryptodev_cb_rcu dummy_cb[RTE_CRYPTO_MAX_QPS_PER_DEV];
+	static void *dummy_data[RTE_CRYPTO_MAX_QPS_PER_DEV];
 	static const struct rte_crypto_fp_ops dummy = {
 		.enqueue_burst = dummy_crypto_enqueue_burst,
 		.dequeue_burst = dummy_crypto_dequeue_burst,