cryptodev: remove max number of sessions parameter
authorPablo de Lara <pablo.de.lara.guarch@intel.com>
Thu, 5 Jul 2018 02:07:58 +0000 (03:07 +0100)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Wed, 11 Jul 2018 01:57:24 +0000 (03:57 +0200)
Most crypto PMDs do not have a limitation
of the number of the sessions that can be handled
internally. The value that was set before was not
actually used at all, since the sessions are created
at the application level.
Therefore, this value is not parsed from the initial
crypto parameters anymore and it is set to 0,
meaning that there is no actual limit.

Signed-off-by: Pablo de Lara <pablo.de.lara.guarch@intel.com>
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
42 files changed:
config/common_base
config/rte_config.h
doc/guides/cryptodevs/dpaa2_sec.rst
doc/guides/cryptodevs/dpaa_sec.rst
doc/guides/prog_guide/cryptodev_lib.rst
drivers/crypto/aesni_gcm/aesni_gcm_pmd.c
drivers/crypto/aesni_gcm/aesni_gcm_pmd_ops.c
drivers/crypto/aesni_gcm/aesni_gcm_pmd_private.h
drivers/crypto/aesni_mb/rte_aesni_mb_pmd.c
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_ops.c
drivers/crypto/aesni_mb/rte_aesni_mb_pmd_private.h
drivers/crypto/armv8/rte_armv8_pmd.c
drivers/crypto/armv8/rte_armv8_pmd_ops.c
drivers/crypto/armv8/rte_armv8_pmd_private.h
drivers/crypto/ccp/ccp_pmd_ops.c
drivers/crypto/ccp/ccp_pmd_private.h
drivers/crypto/ccp/rte_ccp_pmd.c
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
drivers/crypto/dpaa2_sec/dpaa2_sec_priv.h
drivers/crypto/dpaa_sec/dpaa_sec.h
drivers/crypto/kasumi/rte_kasumi_pmd.c
drivers/crypto/kasumi/rte_kasumi_pmd_ops.c
drivers/crypto/kasumi/rte_kasumi_pmd_private.h
drivers/crypto/null/null_crypto_pmd.c
drivers/crypto/null/null_crypto_pmd_ops.c
drivers/crypto/null/null_crypto_pmd_private.h
drivers/crypto/openssl/rte_openssl_pmd.c
drivers/crypto/openssl/rte_openssl_pmd_ops.c
drivers/crypto/openssl/rte_openssl_pmd_private.h
drivers/crypto/qat/qat_sym_pmd.c
drivers/crypto/qat/qat_sym_pmd.h
drivers/crypto/scheduler/scheduler_pmd.c
drivers/crypto/scheduler/scheduler_pmd_ops.c
drivers/crypto/snow3g/rte_snow3g_pmd.c
drivers/crypto/snow3g/rte_snow3g_pmd_ops.c
drivers/crypto/snow3g/rte_snow3g_pmd_private.h
drivers/crypto/virtio/virtio_cryptodev.c
drivers/crypto/zuc/rte_zuc_pmd.c
drivers/crypto/zuc/rte_zuc_pmd_ops.c
drivers/crypto/zuc/rte_zuc_pmd_private.h
lib/librte_cryptodev/rte_cryptodev_pmd.c
lib/librte_cryptodev/rte_cryptodev_pmd.h

index b69b2da..e4241db 100644 (file)
@@ -470,14 +470,12 @@ CONFIG_RTE_LIBRTE_PMD_ARMV8_CRYPTO_DEBUG=n
 # Compile NXP DPAA2 crypto sec driver for CAAM HW
 #
 CONFIG_RTE_LIBRTE_PMD_DPAA2_SEC=n
-CONFIG_RTE_DPAA2_SEC_PMD_MAX_NB_SESSIONS=2048
 
 #
 # NXP DPAA caam - crypto driver
 #
 CONFIG_RTE_LIBRTE_PMD_DPAA_SEC=n
 CONFIG_RTE_LIBRTE_DPAA_MAX_CRYPTODEV=4
-CONFIG_RTE_DPAA_SEC_PMD_MAX_NB_SESSIONS=2048
 
 #
 # Compile PMD for QuickAssist based devices
@@ -496,11 +494,6 @@ CONFIG_RTE_LIBRTE_PMD_VIRTIO_CRYPTO=y
 # Number of maximum virtio crypto devices
 #
 CONFIG_RTE_MAX_VIRTIO_CRYPTO=32
-#
-# Number of sessions to create in the session memory pool
-# on a single virtio crypto device.
-#
-CONFIG_RTE_VIRTIO_CRYPTO_PMD_MAX_NB_SESSIONS=1024
 
 #
 # Compile PMD for AESNI backed device
index 0ba0ead..8a3432a 100644 (file)
 #define RTE_PMD_QAT_MAX_PCI_DEVICES 48
 
 /* virtio crypto defines */
-#define RTE_VIRTIO_CRYPTO_PMD_MAX_NB_SESSIONS 1024
 #define RTE_MAX_VIRTIO_CRYPTO 32
 
-/* DPAA2_SEC */
-#define RTE_DPAA2_SEC_PMD_MAX_NB_SESSIONS 2048
-
-/* DPAA_SEC */
-#define RTE_DPAA_SEC_PMD_MAX_NB_SESSIONS 2048
-
 /* DPAA SEC max cryptodev devices*/
 #define RTE_LIBRTE_DPAA_MAX_CRYPTODEV  4
 
index 86d0a8d..9191704 100644 (file)
@@ -199,11 +199,6 @@ Please note that enabling debugging options may affect system performance.
   By default it is only enabled in defconfig_arm64-dpaa2-* config.
   Toggle compilation of the ``librte_pmd_dpaa2_sec`` driver.
 
-* ``CONFIG_RTE_DPAA2_SEC_PMD_MAX_NB_SESSIONS``
-  By default it is set as 2048 in defconfig_arm64-dpaa2-* config.
-  It indicates Number of sessions to create in the session memory pool
-  on a single DPAA2 SEC device.
-
 Installations
 -------------
 To compile the DPAA2_SEC PMD for Linux arm64 gcc target, run the
index a6283c7..dd68389 100644 (file)
@@ -144,11 +144,6 @@ Please note that enabling debugging options may affect system performance.
   By default it is only enabled in defconfig_arm64-dpaa-* config.
   Toggle compilation of the ``librte_pmd_dpaa_sec`` driver.
 
-* ``CONFIG_RTE_DPAA_SEC_PMD_MAX_NB_SESSIONS``
-  By default it is set as 2048 in defconfig_arm64-dpaa-* config.
-  It indicates Number of sessions to create in the session memory pool
-  on a single DPAA SEC device.
-
 Installations
 -------------
 To compile the DPAA_SEC PMD for Linux arm64 gcc target, run the
index d02bb75..d2a74a3 100644 (file)
@@ -41,7 +41,7 @@ From the command line using the --vdev EAL option
 
 .. code-block:: console
 
-   --vdev  'crypto_aesni_mb0,max_nb_queue_pairs=2,max_nb_sessions=1024,socket_id=0'
+   --vdev  'crypto_aesni_mb0,max_nb_queue_pairs=2,socket_id=0'
 
 .. Note::
 
@@ -57,12 +57,11 @@ Our using the rte_vdev_init API within the application code.
 .. code-block:: c
 
    rte_vdev_init("crypto_aesni_mb",
-                     "max_nb_queue_pairs=2,max_nb_sessions=1024,socket_id=0")
+                     "max_nb_queue_pairs=2,socket_id=0")
 
 All virtual Crypto devices support the following initialization parameters:
 
 * ``max_nb_queue_pairs`` - maximum number of queue pairs supported by the device.
-* ``max_nb_sessions`` - maximum number of sessions supported by the device
 * ``socket_id`` - socket on which to allocate the device resources on.
 
 
index d196826..88307e0 100644 (file)
@@ -513,7 +513,6 @@ aesni_gcm_create(const char *name,
        internals->vector_mode = vector_mode;
 
        internals->max_nb_queue_pairs = init_params->max_nb_queue_pairs;
-       internals->max_nb_sessions = init_params->max_nb_sessions;
 
        return 0;
 }
@@ -525,8 +524,7 @@ aesni_gcm_probe(struct rte_vdev_device *vdev)
                "",
                sizeof(struct aesni_gcm_private),
                rte_socket_id(),
-               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS,
-               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS
+               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS
        };
        const char *name;
        const char *input_args;
@@ -568,7 +566,6 @@ RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_AESNI_GCM_PMD, aesni_gcm_pmd_drv);
 RTE_PMD_REGISTER_ALIAS(CRYPTODEV_NAME_AESNI_GCM_PMD, cryptodev_aesni_gcm_pmd);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_GCM_PMD,
        "max_nb_queue_pairs=<int> "
-       "max_nb_sessions=<int> "
        "socket_id=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(aesni_gcm_crypto_drv, aesni_gcm_pmd_drv.driver,
                cryptodev_driver_id);
index eacbdc0..1f4edc0 100644 (file)
@@ -143,7 +143,8 @@ aesni_gcm_pmd_info_get(struct rte_cryptodev *dev,
                dev_info->capabilities = aesni_gcm_pmd_capabilities;
 
                dev_info->max_nb_queue_pairs = internals->max_nb_queue_pairs;
-               dev_info->sym.max_nb_sessions = internals->max_nb_sessions;
+               /* No limit of number of sessions */
+               dev_info->sym.max_nb_sessions = 0;
        }
 }
 
index 2b9c251..0bcd4fa 100644 (file)
@@ -26,8 +26,6 @@ struct aesni_gcm_private {
        /**< Vector mode */
        unsigned max_nb_queue_pairs;
        /**< Max number of queue pairs supported by device */
-       unsigned max_nb_sessions;
-       /**< Max number of sessions supported by device */
 };
 
 struct aesni_gcm_qp {
index 9ae2b54..17ac43f 100644 (file)
@@ -885,7 +885,6 @@ cryptodev_aesni_mb_create(const char *name,
 
        internals->vector_mode = vector_mode;
        internals->max_nb_queue_pairs = init_params->max_nb_queue_pairs;
-       internals->max_nb_sessions = init_params->max_nb_sessions;
 
        return 0;
 }
@@ -897,8 +896,7 @@ cryptodev_aesni_mb_probe(struct rte_vdev_device *vdev)
                "",
                sizeof(struct aesni_mb_private),
                rte_socket_id(),
-               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS,
-               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS
+               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS
        };
        const char *name, *args;
        int retval;
@@ -947,7 +945,6 @@ RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_AESNI_MB_PMD, cryptodev_aesni_mb_pmd_drv);
 RTE_PMD_REGISTER_ALIAS(CRYPTODEV_NAME_AESNI_MB_PMD, cryptodev_aesni_mb_pmd);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_AESNI_MB_PMD,
        "max_nb_queue_pairs=<int> "
-       "max_nb_sessions=<int> "
        "socket_id=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(aesni_mb_crypto_drv,
                cryptodev_aesni_mb_pmd_drv.driver,
index 6a96d50..6cd4134 100644 (file)
@@ -387,7 +387,8 @@ aesni_mb_pmd_info_get(struct rte_cryptodev *dev,
                dev_info->feature_flags = dev->feature_flags;
                dev_info->capabilities = aesni_mb_pmd_capabilities;
                dev_info->max_nb_queue_pairs = internals->max_nb_queue_pairs;
-               dev_info->sym.max_nb_sessions = internals->max_nb_sessions;
+               /* No limit of number of sessions */
+               dev_info->sym.max_nb_sessions = 0;
        }
 }
 
index bad2a87..91fd740 100644 (file)
@@ -113,8 +113,6 @@ struct aesni_mb_private {
        /**< CPU vector instruction set mode */
        unsigned max_nb_queue_pairs;
        /**< Max number of queue pairs supported by device */
-       unsigned max_nb_sessions;
-       /**< Max number of sessions supported by device */
 };
 
 /** AESNI Multi buffer queue pair */
index fbb08f7..db0d8a2 100644 (file)
@@ -779,7 +779,6 @@ cryptodev_armv8_crypto_create(const char *name,
        internals = dev->data->dev_private;
 
        internals->max_nb_qpairs = init_params->max_nb_queue_pairs;
-       internals->max_nb_sessions = init_params->max_nb_sessions;
 
        return 0;
 
@@ -800,8 +799,7 @@ cryptodev_armv8_crypto_init(struct rte_vdev_device *vdev)
                "",
                sizeof(struct armv8_crypto_private),
                rte_socket_id(),
-               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS,
-               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS
+               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS
        };
        const char *name;
        const char *input_args;
@@ -848,7 +846,6 @@ RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_ARMV8_PMD, armv8_crypto_pmd_drv);
 RTE_PMD_REGISTER_ALIAS(CRYPTODEV_NAME_ARMV8_PMD, cryptodev_armv8_pmd);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_ARMV8_PMD,
        "max_nb_queue_pairs=<int> "
-       "max_nb_sessions=<int> "
        "socket_id=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(armv8_crypto_drv, armv8_crypto_pmd_drv.driver,
                cryptodev_driver_id);
index c64aef0..b654f75 100644 (file)
@@ -154,7 +154,8 @@ armv8_crypto_pmd_info_get(struct rte_cryptodev *dev,
                dev_info->feature_flags = dev->feature_flags;
                dev_info->capabilities = armv8_crypto_pmd_capabilities;
                dev_info->max_nb_queue_pairs = internals->max_nb_qpairs;
-               dev_info->sym.max_nb_sessions = internals->max_nb_sessions;
+               /* No limit of number of sessions */
+               dev_info->sym.max_nb_sessions = 0;
        }
 }
 
index b8966e9..7feb021 100644 (file)
@@ -106,8 +106,6 @@ typedef void (*crypto_key_sched_t)(uint8_t *, const uint8_t *);
 struct armv8_crypto_private {
        unsigned int max_nb_qpairs;
        /**< Max number of queue pairs */
-       unsigned int max_nb_sessions;
-       /**< Max number of sessions */
 };
 
 /** ARMv8 crypto queue pair */
index 80b75cc..dbe545c 100644 (file)
@@ -624,7 +624,8 @@ ccp_pmd_info_get(struct rte_cryptodev *dev,
                if (internals->auth_opt == 1)
                        dev_info->capabilities = ccp_crypto_cap_complete;
                dev_info->max_nb_queue_pairs = internals->max_nb_qpairs;
-               dev_info->sym.max_nb_sessions = internals->max_nb_sessions;
+               /* No limit of number of sessions */
+               dev_info->sym.max_nb_sessions = 0;
        }
 }
 
index f449804..79752f6 100644 (file)
@@ -40,7 +40,6 @@
 /* private data structure for each CCP crypto device */
 struct ccp_private {
        unsigned int max_nb_qpairs;     /**< Max number of queue pairs */
-       unsigned int max_nb_sessions;   /**< Max number of sessions */
        uint8_t crypto_num_dev;         /**< Number of working crypto devices */
        bool auth_opt;                  /**< Authentication offload option */
        struct ccp_device *last_dev;    /**< Last working crypto device */
index 2061f46..d70640f 100644 (file)
@@ -30,14 +30,12 @@ struct ccp_pmd_init_params {
 #define CCP_CRYPTODEV_PARAM_NAME               ("name")
 #define CCP_CRYPTODEV_PARAM_SOCKET_ID          ("socket_id")
 #define CCP_CRYPTODEV_PARAM_MAX_NB_QP          ("max_nb_queue_pairs")
-#define CCP_CRYPTODEV_PARAM_MAX_NB_SESS                ("max_nb_sessions")
 #define CCP_CRYPTODEV_PARAM_AUTH_OPT           ("ccp_auth_opt")
 
 const char *ccp_pmd_valid_params[] = {
        CCP_CRYPTODEV_PARAM_NAME,
        CCP_CRYPTODEV_PARAM_SOCKET_ID,
        CCP_CRYPTODEV_PARAM_MAX_NB_QP,
-       CCP_CRYPTODEV_PARAM_MAX_NB_SESS,
        CCP_CRYPTODEV_PARAM_AUTH_OPT,
 };
 
@@ -124,13 +122,6 @@ ccp_pmd_parse_input_args(struct ccp_pmd_init_params *params,
                if (ret < 0)
                        goto free_kvlist;
 
-               ret = rte_kvargs_process(kvlist,
-                                        CCP_CRYPTODEV_PARAM_MAX_NB_SESS,
-                                        &parse_integer_arg,
-                                        &params->def_p.max_nb_sessions);
-               if (ret < 0)
-                       goto free_kvlist;
-
                ret = rte_kvargs_process(kvlist,
                                         CCP_CRYPTODEV_PARAM_SOCKET_ID,
                                         &parse_integer_arg,
@@ -334,7 +325,6 @@ cryptodev_ccp_create(const char *name,
        internals = dev->data->dev_private;
 
        internals->max_nb_qpairs = init_params->def_p.max_nb_queue_pairs;
-       internals->max_nb_sessions = init_params->def_p.max_nb_sessions;
        internals->auth_opt = init_params->auth_opt;
        internals->crypto_num_dev = cryptodev_cnt;
 
@@ -359,8 +349,7 @@ cryptodev_ccp_probe(struct rte_vdev_device *vdev)
                        "",
                        sizeof(struct ccp_private),
                        rte_socket_id(),
-                       CCP_PMD_MAX_QUEUE_PAIRS,
-                       RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS
+                       CCP_PMD_MAX_QUEUE_PAIRS
                },
                .auth_opt = CCP_PMD_AUTH_OPT_CCP,
        };
@@ -382,8 +371,6 @@ cryptodev_ccp_probe(struct rte_vdev_device *vdev)
                init_params.def_p.socket_id);
        RTE_LOG(INFO, PMD, "Max number of queue pairs = %d\n",
                init_params.def_p.max_nb_queue_pairs);
-       RTE_LOG(INFO, PMD, "Max number of sessions = %d\n",
-               init_params.def_p.max_nb_sessions);
        RTE_LOG(INFO, PMD, "Authentication offload to %s\n",
                ((init_params.auth_opt == 0) ? "CCP" : "CPU"));
 
@@ -404,7 +391,6 @@ static struct cryptodev_driver ccp_crypto_drv;
 RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_CCP_PMD, cryptodev_ccp_pmd_drv);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_CCP_PMD,
        "max_nb_queue_pairs=<int> "
-       "max_nb_sessions=<int> "
        "socket_id=<int> "
        "ccp_auth_opt=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(ccp_crypto_drv, cryptodev_ccp_pmd_drv.driver,
index 56fa969..bc091c5 100644 (file)
@@ -2626,7 +2626,8 @@ dpaa2_sec_dev_infos_get(struct rte_cryptodev *dev,
                info->max_nb_queue_pairs = internals->max_nb_queue_pairs;
                info->feature_flags = dev->feature_flags;
                info->capabilities = dpaa2_sec_capabilities;
-               info->sym.max_nb_sessions = internals->max_nb_sessions;
+               /* No limit of number of sessions */
+               info->sym.max_nb_sessions = 0;
                info->driver_id = cryptodev_driver_id;
        }
 }
@@ -2786,7 +2787,6 @@ dpaa2_sec_dev_init(struct rte_cryptodev *cryptodev)
                        RTE_CRYPTODEV_FF_MBUF_SCATTER_GATHER;
 
        internals = cryptodev->data->dev_private;
-       internals->max_nb_sessions = RTE_DPAA2_SEC_PMD_MAX_NB_SESSIONS;
 
        /*
         * For secondary processes, we don't initialise any further as primary
index a9d83eb..d015be1 100644 (file)
@@ -23,8 +23,6 @@ struct dpaa2_sec_dev_private {
        uint16_t token; /**< Token required by DPxxx objects */
        unsigned int max_nb_queue_pairs;
        /**< Max number of queue pairs supported by device */
-       unsigned int max_nb_sessions;
-       /**< Max number of sessions supported by device */
 };
 
 struct dpaa2_sec_qp {
index e15e373..ac6c00a 100644 (file)
@@ -26,6 +26,7 @@
 #define CTX_POOL_NUM_BUFS      32000
 #define CTX_POOL_BUF_SIZE      sizeof(struct dpaa_sec_op_ctx)
 #define CTX_POOL_CACHE_SIZE    512
+#define RTE_DPAA_SEC_PMD_MAX_NB_SESSIONS 2048
 
 #define DIR_ENC                 1
 #define DIR_DEC                 0
index 0e783ed..9eb43b2 100644 (file)
@@ -559,7 +559,6 @@ cryptodev_kasumi_create(const char *name,
        internals = dev->data->dev_private;
 
        internals->max_nb_queue_pairs = init_params->max_nb_queue_pairs;
-       internals->max_nb_sessions = init_params->max_nb_sessions;
 
        return 0;
 init_error:
@@ -577,8 +576,7 @@ cryptodev_kasumi_probe(struct rte_vdev_device *vdev)
                "",
                sizeof(struct kasumi_private),
                rte_socket_id(),
-               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS,
-               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS
+               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS
        };
        const char *name;
        const char *input_args;
@@ -621,7 +619,6 @@ RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_KASUMI_PMD, cryptodev_kasumi_pmd_drv);
 RTE_PMD_REGISTER_ALIAS(CRYPTODEV_NAME_KASUMI_PMD, cryptodev_kasumi_pmd);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_KASUMI_PMD,
        "max_nb_queue_pairs=<int> "
-       "max_nb_sessions=<int> "
        "socket_id=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(kasumi_crypto_drv,
                cryptodev_kasumi_pmd_drv.driver, cryptodev_driver_id);
index d087eab..5593238 100644 (file)
@@ -126,7 +126,8 @@ kasumi_pmd_info_get(struct rte_cryptodev *dev,
        if (dev_info != NULL) {
                dev_info->driver_id = dev->driver_id;
                dev_info->max_nb_queue_pairs = internals->max_nb_queue_pairs;
-               dev_info->sym.max_nb_sessions = internals->max_nb_sessions;
+               /* No limit of number of sessions */
+               dev_info->sym.max_nb_sessions = 0;
                dev_info->feature_flags = dev->feature_flags;
                dev_info->capabilities = kasumi_pmd_capabilities;
        }
index 102334e..488777c 100644 (file)
@@ -24,8 +24,6 @@ int kasumi_logtype_driver;
 struct kasumi_private {
        unsigned max_nb_queue_pairs;
        /**< Max number of queue pairs supported by device */
-       unsigned max_nb_sessions;
-       /**< Max number of sessions supported by device */
 };
 
 /** KASUMI buffer queue pair */
index 8699f12..0727683 100644 (file)
@@ -181,7 +181,6 @@ cryptodev_null_create(const char *name,
        internals = dev->data->dev_private;
 
        internals->max_nb_qpairs = init_params->max_nb_queue_pairs;
-       internals->max_nb_sessions = init_params->max_nb_sessions;
 
        return 0;
 }
@@ -194,8 +193,7 @@ cryptodev_null_probe(struct rte_vdev_device *dev)
                "",
                sizeof(struct null_crypto_private),
                rte_socket_id(),
-               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS,
-               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS
+               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS
        };
        const char *name, *args;
        int retval;
@@ -245,7 +243,6 @@ RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_NULL_PMD, cryptodev_null_pmd_drv);
 RTE_PMD_REGISTER_ALIAS(CRYPTODEV_NAME_NULL_PMD, cryptodev_null_pmd);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_NULL_PMD,
        "max_nb_queue_pairs=<int> "
-       "max_nb_sessions=<int> "
        "socket_id=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(null_crypto_drv, cryptodev_null_pmd_drv.driver,
                cryptodev_driver_id);
index 9a78e91..55778a2 100644 (file)
@@ -121,7 +121,8 @@ null_crypto_pmd_info_get(struct rte_cryptodev *dev,
        if (dev_info != NULL) {
                dev_info->driver_id = dev->driver_id;
                dev_info->max_nb_queue_pairs = internals->max_nb_qpairs;
-               dev_info->sym.max_nb_sessions = internals->max_nb_sessions;
+               /* No limit of number of sessions */
+               dev_info->sym.max_nb_sessions = 0;
                dev_info->feature_flags = dev->feature_flags;
                dev_info->capabilities = null_crypto_pmd_capabilities;
        }
index 190b88d..d5905af 100644 (file)
@@ -19,7 +19,6 @@ int null_logtype_driver;
 /** private data structure for each NULL crypto device */
 struct null_crypto_private {
        unsigned max_nb_qpairs;         /**< Max number of queue pairs */
-       unsigned max_nb_sessions;       /**< Max number of sessions */
 };
 
 /** NULL crypto queue pair */
index bfdfcdd..1ccab4a 100644 (file)
@@ -1666,7 +1666,6 @@ cryptodev_openssl_create(const char *name,
        internals = dev->data->dev_private;
 
        internals->max_nb_qpairs = init_params->max_nb_queue_pairs;
-       internals->max_nb_sessions = init_params->max_nb_sessions;
 
        return 0;
 
@@ -1686,8 +1685,7 @@ cryptodev_openssl_probe(struct rte_vdev_device *vdev)
                "",
                sizeof(struct openssl_private),
                rte_socket_id(),
-               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS,
-               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS
+               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS
        };
        const char *name;
        const char *input_args;
@@ -1731,7 +1729,6 @@ RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_OPENSSL_PMD,
        cryptodev_openssl_pmd_drv);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_OPENSSL_PMD,
        "max_nb_queue_pairs=<int> "
-       "max_nb_sessions=<int> "
        "socket_id=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(openssl_crypto_drv,
                cryptodev_openssl_pmd_drv.driver, cryptodev_driver_id);
index 488afcf..a1a2d99 100644 (file)
@@ -547,7 +547,8 @@ openssl_pmd_info_get(struct rte_cryptodev *dev,
                dev_info->feature_flags = dev->feature_flags;
                dev_info->capabilities = openssl_pmd_capabilities;
                dev_info->max_nb_queue_pairs = internals->max_nb_qpairs;
-               dev_info->sym.max_nb_sessions = internals->max_nb_sessions;
+               /* No limit of number of sessions */
+               dev_info->sym.max_nb_sessions = 0;
        }
 }
 
index 051fb20..29fcb76 100644 (file)
@@ -49,8 +49,6 @@ enum openssl_auth_mode {
 struct openssl_private {
        unsigned int max_nb_qpairs;
        /**< Max number of queue pairs */
-       unsigned int max_nb_sessions;
-       /**< Max number of sessions */
 };
 
 /** OPENSSL crypto queue pair */
index 0bc042a..84dd5be 100644 (file)
@@ -72,8 +72,9 @@ static void qat_sym_dev_info_get(struct rte_cryptodev *dev,
                        qat_qps_per_service(sym_hw_qps, QAT_SERVICE_SYMMETRIC);
                info->feature_flags = dev->feature_flags;
                info->capabilities = internals->qat_dev_capabilities;
-               info->sym.max_nb_sessions = QAT_SYM_PMD_MAX_NB_SESSIONS;
                info->driver_id = cryptodev_qat_driver_id;
+               /* No limit of number of sessions */
+               info->sym.max_nb_sessions = 0;
        }
 }
 
@@ -243,8 +244,7 @@ qat_sym_dev_create(struct qat_pci_device *qat_pci_dev)
        struct rte_cryptodev_pmd_init_params init_params = {
                        .name = "",
                        .socket_id = qat_pci_dev->pci_dev->device.numa_node,
-                       .private_data_size = sizeof(struct qat_sym_dev_private),
-                       .max_nb_sessions = QAT_SYM_PMD_MAX_NB_SESSIONS
+                       .private_data_size = sizeof(struct qat_sym_dev_private)
        };
        char name[RTE_CRYPTODEV_NAME_MAX_LEN];
        struct rte_cryptodev *cryptodev;
index 439aeb9..d343285 100644 (file)
@@ -14,7 +14,6 @@
 
 /**< Intel(R) QAT Symmetric Crypto PMD device name */
 #define CRYPTODEV_NAME_QAT_SYM_PMD     crypto_qat
-#define QAT_SYM_PMD_MAX_NB_SESSIONS    2048
 
 extern uint8_t cryptodev_qat_driver_id;
 
index 5489e9e..6c5c01d 100644 (file)
@@ -31,7 +31,6 @@ struct scheduler_init_params {
 #define RTE_CRYPTODEV_VDEV_MODE                        ("mode")
 #define RTE_CRYPTODEV_VDEV_ORDERING            ("ordering")
 #define RTE_CRYPTODEV_VDEV_MAX_NB_QP_ARG       ("max_nb_queue_pairs")
-#define RTE_CRYPTODEV_VDEV_MAX_NB_SESS_ARG     ("max_nb_sessions")
 #define RTE_CRYPTODEV_VDEV_SOCKET_ID           ("socket_id")
 #define RTE_CRYPTODEV_VDEV_COREMASK            ("coremask")
 #define RTE_CRYPTODEV_VDEV_CORELIST            ("corelist")
@@ -42,7 +41,6 @@ const char *scheduler_valid_params[] = {
        RTE_CRYPTODEV_VDEV_MODE,
        RTE_CRYPTODEV_VDEV_ORDERING,
        RTE_CRYPTODEV_VDEV_MAX_NB_QP_ARG,
-       RTE_CRYPTODEV_VDEV_MAX_NB_SESS_ARG,
        RTE_CRYPTODEV_VDEV_SOCKET_ID,
        RTE_CRYPTODEV_VDEV_COREMASK,
        RTE_CRYPTODEV_VDEV_CORELIST
@@ -406,13 +404,6 @@ scheduler_parse_init_params(struct scheduler_init_params *params,
                if (ret < 0)
                        goto free_kvlist;
 
-               ret = rte_kvargs_process(kvlist,
-                               RTE_CRYPTODEV_VDEV_MAX_NB_SESS_ARG,
-                               &parse_integer_arg,
-                               &params->def_p.max_nb_sessions);
-               if (ret < 0)
-                       goto free_kvlist;
-
                ret = rte_kvargs_process(kvlist, RTE_CRYPTODEV_VDEV_SOCKET_ID,
                                &parse_integer_arg,
                                &params->def_p.socket_id);
@@ -466,8 +457,7 @@ cryptodev_scheduler_probe(struct rte_vdev_device *vdev)
                        "",
                        sizeof(struct scheduler_ctx),
                        rte_socket_id(),
-                       RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS,
-                       RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS
+                       RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS
                },
                .nb_slaves = 0,
                .mode = CDEV_SCHED_MODE_NOT_SET,
@@ -500,7 +490,6 @@ RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_SCHEDULER_PMD,
        cryptodev_scheduler_pmd_drv);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_SCHEDULER_PMD,
        "max_nb_queue_pairs=<int> "
-       "max_nb_sessions=<int> "
        "socket_id=<int> "
        "slave=<name>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(scheduler_crypto_drv,
index 8742058..802585f 100644 (file)
@@ -321,8 +321,7 @@ scheduler_pmd_info_get(struct rte_cryptodev *dev,
                struct rte_cryptodev_info *dev_info)
 {
        struct scheduler_ctx *sched_ctx = dev->data->dev_private;
-       uint32_t max_nb_sessions = sched_ctx->nb_slaves ?
-                       UINT32_MAX : RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS;
+       uint32_t max_nb_sess = 0;
        uint32_t i;
 
        if (!dev_info)
@@ -338,17 +337,18 @@ scheduler_pmd_info_get(struct rte_cryptodev *dev,
                struct rte_cryptodev_info slave_info;
 
                rte_cryptodev_info_get(slave_dev_id, &slave_info);
-               max_nb_sessions = slave_info.sym.max_nb_sessions <
-                               max_nb_sessions ?
-                               slave_info.sym.max_nb_sessions :
-                               max_nb_sessions;
+               uint32_t dev_max_sess = slave_info.sym.max_nb_sessions;
+               if (dev_max_sess != 0) {
+                       if (max_nb_sess == 0 || dev_max_sess < max_nb_sess)
+                               max_nb_sess = slave_info.sym.max_nb_sessions;
+               }
        }
 
        dev_info->driver_id = dev->driver_id;
        dev_info->feature_flags = dev->feature_flags;
        dev_info->capabilities = sched_ctx->capabilities;
        dev_info->max_nb_queue_pairs = sched_ctx->max_nb_queue_pairs;
-       dev_info->sym.max_nb_sessions = max_nb_sessions;
+       dev_info->sym.max_nb_sessions = max_nb_sess;
 }
 
 /** Release queue pair */
index c13f33f..7db5d40 100644 (file)
@@ -555,7 +555,6 @@ cryptodev_snow3g_create(const char *name,
        internals = dev->data->dev_private;
 
        internals->max_nb_queue_pairs = init_params->max_nb_queue_pairs;
-       internals->max_nb_sessions = init_params->max_nb_sessions;
 
        return 0;
 init_error:
@@ -573,8 +572,7 @@ cryptodev_snow3g_probe(struct rte_vdev_device *vdev)
                "",
                sizeof(struct snow3g_private),
                rte_socket_id(),
-               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS,
-               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS
+               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS
        };
        const char *name;
        const char *input_args;
@@ -617,7 +615,6 @@ RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_SNOW3G_PMD, cryptodev_snow3g_pmd_drv);
 RTE_PMD_REGISTER_ALIAS(CRYPTODEV_NAME_SNOW3G_PMD, cryptodev_snow3g_pmd);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_SNOW3G_PMD,
        "max_nb_queue_pairs=<int> "
-       "max_nb_sessions=<int> "
        "socket_id=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(snow3g_crypto_drv,
                cryptodev_snow3g_pmd_drv.driver, cryptodev_driver_id);
index 8add039..e5c7a86 100644 (file)
@@ -130,7 +130,8 @@ snow3g_pmd_info_get(struct rte_cryptodev *dev,
        if (dev_info != NULL) {
                dev_info->driver_id = dev->driver_id;
                dev_info->max_nb_queue_pairs = internals->max_nb_queue_pairs;
-               dev_info->sym.max_nb_sessions = internals->max_nb_sessions;
+               /* No limit of number of sessions */
+               dev_info->sym.max_nb_sessions = 0;
                dev_info->feature_flags = dev->feature_flags;
                dev_info->capabilities = snow3g_pmd_capabilities;
        }
index f0cc60d..b7807b6 100644 (file)
@@ -24,8 +24,6 @@ int snow3g_logtype_driver;
 struct snow3g_private {
        unsigned max_nb_queue_pairs;
        /**< Max number of queue pairs supported by device */
-       unsigned max_nb_sessions;
-       /**< Max number of sessions supported by device */
 };
 
 /** SNOW 3G buffer queue pair */
index 4f170cf..e51c102 100644 (file)
@@ -1417,8 +1417,8 @@ virtio_crypto_dev_info_get(struct rte_cryptodev *dev,
                info->driver_id = cryptodev_virtio_driver_id;
                info->feature_flags = dev->feature_flags;
                info->max_nb_queue_pairs = hw->max_dataqueues;
-               info->sym.max_nb_sessions =
-                       RTE_VIRTIO_CRYPTO_PMD_MAX_NB_SESSIONS;
+               /* No limit of number of sessions */
+               info->sym.max_nb_sessions = 0;
                info->capabilities = hw->virtio_dev_capabilities;
        }
 }
@@ -1431,8 +1431,7 @@ crypto_virtio_pci_probe(
        struct rte_cryptodev_pmd_init_params init_params = {
                .name = "",
                .socket_id = rte_socket_id(),
-               .private_data_size = sizeof(struct virtio_crypto_hw),
-               .max_nb_sessions = RTE_VIRTIO_CRYPTO_PMD_MAX_NB_SESSIONS
+               .private_data_size = sizeof(struct virtio_crypto_hw)
        };
        char name[RTE_CRYPTODEV_NAME_MAX_LEN];
 
index 119d393..8de5c27 100644 (file)
@@ -478,7 +478,6 @@ cryptodev_zuc_create(const char *name,
        internals = dev->data->dev_private;
 
        internals->max_nb_queue_pairs = init_params->max_nb_queue_pairs;
-       internals->max_nb_sessions = init_params->max_nb_sessions;
 
        return 0;
 init_error:
@@ -496,8 +495,7 @@ cryptodev_zuc_probe(struct rte_vdev_device *vdev)
                "",
                sizeof(struct zuc_private),
                rte_socket_id(),
-               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS,
-               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS
+               RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS
        };
        const char *name;
        const char *input_args;
@@ -540,7 +538,6 @@ static struct cryptodev_driver zuc_crypto_drv;
 RTE_PMD_REGISTER_VDEV(CRYPTODEV_NAME_ZUC_PMD, cryptodev_zuc_pmd_drv);
 RTE_PMD_REGISTER_PARAM_STRING(CRYPTODEV_NAME_ZUC_PMD,
        "max_nb_queue_pairs=<int> "
-       "max_nb_sessions=<int> "
        "socket_id=<int>");
 RTE_PMD_REGISTER_CRYPTO_DRIVER(zuc_crypto_drv, cryptodev_zuc_pmd_drv.driver,
                cryptodev_driver_id);
index 87c44ce..e151750 100644 (file)
@@ -130,7 +130,8 @@ zuc_pmd_info_get(struct rte_cryptodev *dev,
        if (dev_info != NULL) {
                dev_info->driver_id = dev->driver_id;
                dev_info->max_nb_queue_pairs = internals->max_nb_queue_pairs;
-               dev_info->sym.max_nb_sessions = internals->max_nb_sessions;
+               /* No limit of number of sessions */
+               dev_info->sym.max_nb_sessions = 0;
                dev_info->feature_flags = dev->feature_flags;
                dev_info->capabilities = zuc_pmd_capabilities;
        }
index 69cc32e..5e5906d 100644 (file)
@@ -24,8 +24,6 @@ int zuc_logtype_driver;
 struct zuc_private {
        unsigned max_nb_queue_pairs;
        /**< Max number of queue pairs supported by device */
-       unsigned max_nb_sessions;
-       /**< Max number of sessions supported by device */
 };
 
 /** ZUC buffer queue pair */
index f2aac24..2088ac3 100644 (file)
@@ -65,13 +65,6 @@ rte_cryptodev_pmd_parse_input_args(
                if (ret < 0)
                        goto free_kvlist;
 
-               ret = rte_kvargs_process(kvlist,
-                               RTE_CRYPTODEV_PMD_MAX_NB_SESS_ARG,
-                               &rte_cryptodev_pmd_parse_uint_arg,
-                               &params->max_nb_sessions);
-               if (ret < 0)
-                       goto free_kvlist;
-
                ret = rte_kvargs_process(kvlist,
                                RTE_CRYPTODEV_PMD_SOCKET_ID_ARG,
                                &rte_cryptodev_pmd_parse_uint_arg,
@@ -109,10 +102,9 @@ rte_cryptodev_pmd_create(const char *name,
                        device->driver->name, name);
 
        CDEV_LOG_INFO("[%s] - Initialisation parameters - name: %s,"
-                       "socket id: %d, max queue pairs: %u, max sessions: %u",
+                       "socket id: %d, max queue pairs: %u",
                        device->driver->name, name,
-                       params->socket_id, params->max_nb_queue_pairs,
-                       params->max_nb_sessions);
+                       params->socket_id, params->max_nb_queue_pairs);
 
        /* allocate device structure */
        cryptodev = rte_cryptodev_pmd_allocate(name, params->socket_id);
index db8b976..1fb7e7d 100644 (file)
@@ -32,18 +32,15 @@ extern "C" {
 
 
 #define RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_QUEUE_PAIRS   8
-#define RTE_CRYPTODEV_PMD_DEFAULT_MAX_NB_SESSIONS      2048
 
 #define RTE_CRYPTODEV_PMD_NAME_ARG                     ("name")
 #define RTE_CRYPTODEV_PMD_MAX_NB_QP_ARG                        ("max_nb_queue_pairs")
-#define RTE_CRYPTODEV_PMD_MAX_NB_SESS_ARG              ("max_nb_sessions")
 #define RTE_CRYPTODEV_PMD_SOCKET_ID_ARG                        ("socket_id")
 
 
 static const char * const cryptodev_pmd_valid_params[] = {
        RTE_CRYPTODEV_PMD_NAME_ARG,
        RTE_CRYPTODEV_PMD_MAX_NB_QP_ARG,
-       RTE_CRYPTODEV_PMD_MAX_NB_SESS_ARG,
        RTE_CRYPTODEV_PMD_SOCKET_ID_ARG
 };
 
@@ -56,7 +53,6 @@ struct rte_cryptodev_pmd_init_params {
        size_t private_data_size;
        int socket_id;
        unsigned int max_nb_queue_pairs;
-       unsigned int max_nb_sessions;
 };
 
 /** Global structure used for maintaining state of allocated crypto devices */