cryptodev: add function to retrieve device name
[dpdk.git] / lib / librte_cryptodev / rte_cryptodev.h
index 3ba3efb..fd0e3f1 100644 (file)
@@ -238,7 +238,6 @@ rte_cryptodev_sym_capability_check_cipher(
  * @param      capability      Description of the symmetric crypto capability.
  * @param      key_size        Auth key size.
  * @param      digest_size     Auth digest size.
- * @param      aad_size        Auth aad size.
  * @param      iv_size         Auth initial vector size.
  *
  * @return
@@ -248,8 +247,7 @@ rte_cryptodev_sym_capability_check_cipher(
 int
 rte_cryptodev_sym_capability_check_auth(
                const struct rte_cryptodev_symmetric_capability *capability,
-               uint16_t key_size, uint16_t digest_size, uint16_t aad_size,
-               uint16_t iv_size);
+               uint16_t key_size, uint16_t digest_size, uint16_t iv_size);
 
 /**
  * Check if key, digest, AAD and initial vector sizes are supported
@@ -436,6 +434,8 @@ struct rte_cryptodev_stats {
 /**< Max length of name of crypto PMD */
 
 /**
+ * @deprecated
+ *
  * Create a virtual crypto device
  *
  * @param      name    Cryptodev PMD name of device to be created.
@@ -446,6 +446,7 @@ struct rte_cryptodev_stats {
  *   which will be between 0 and rte_cryptodev_count().
  * - In the case of a failure, returns -1.
  */
+__rte_deprecated
 extern int
 rte_cryptodev_create_vdev(const char *name, const char *args);
 
@@ -461,6 +462,19 @@ rte_cryptodev_create_vdev(const char *name, const char *args);
 extern int
 rte_cryptodev_get_dev_id(const char *name);
 
+/**
+ * Get the crypto device name given a device identifier.
+ *
+ * @param dev_id
+ *   The identifier of the device
+ *
+ * @return
+ *   - Returns crypto device name.
+ *   - Returns NULL if crypto device is not present.
+ */
+extern const char *
+rte_cryptodev_name_get(uint8_t dev_id);
+
 /**
  * Get the total number of crypto devices that have been successfully
  * initialised.
@@ -525,15 +539,13 @@ struct rte_cryptodev_config {
  *
  * @param      dev_id          The identifier of the device to configure.
  * @param      config          The crypto device configuration structure.
- * @param      session_pool    Pointer to device session mempool
  *
  * @return
  *   - 0: Success, device configured.
  *   - <0: Error code returned by the driver configuration function.
  */
 extern int
-rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config,
-               struct rte_mempool *session_pool);
+rte_cryptodev_configure(uint8_t dev_id, struct rte_cryptodev_config *config);
 
 /**
  * Start an device.
@@ -592,6 +604,8 @@ rte_cryptodev_close(uint8_t dev_id);
  *                             *SOCKET_ID_ANY* if there is no NUMA constraint
  *                             for the DMA memory allocated for the receive
  *                             queue pair.
+ * @param      session_pool    Pointer to device session mempool, used
+ *                             for session-less operations.
  *
  * @return
  *   - 0: Success, queue pair correctly set up.
@@ -599,7 +613,8 @@ rte_cryptodev_close(uint8_t dev_id);
  */
 extern int
 rte_cryptodev_queue_pair_setup(uint8_t dev_id, uint16_t queue_pair_id,
-               const struct rte_cryptodev_qp_conf *qp_conf, int socket_id);
+               const struct rte_cryptodev_qp_conf *qp_conf, int socket_id,
+               struct rte_mempool *session_pool);
 
 /**
  * Start a specified queue pair of a device. It is used
@@ -882,7 +897,6 @@ rte_cryptodev_enqueue_burst(uint8_t dev_id, uint16_t qp_id,
 
 /** Cryptodev symmetric crypto session */
 struct rte_cryptodev_sym_session {
-       RTE_STD_C11
        __extension__ void *sess_private_data[0];
        /**< Private session material */
 };
@@ -926,7 +940,9 @@ rte_cryptodev_sym_session_free(struct rte_cryptodev_sym_session *sess);
  *
  * @return
  *  - On success, zero.
- *  - On failure, a negative value.
+ *  - -EINVAL if input parameters are invalid.
+ *  - -ENOTSUP if crypto device does not support the crypto transform.
+ *  - -ENOMEM if the private session could not be allocated.
  */
 int
 rte_cryptodev_sym_session_init(uint8_t dev_id,
@@ -1022,26 +1038,6 @@ int rte_cryptodev_driver_id_get(const char *name);
  */
 const char *rte_cryptodev_driver_name_get(uint8_t driver_id);
 
-/**
- * @internal
- * Allocate Cryptodev driver.
- *
- * @param driver
- *   Pointer to rte_driver.
- * @return
- *  The driver type identifier
- */
-uint8_t rte_cryptodev_allocate_driver(const struct rte_driver *driver);
-
-
-#define RTE_PMD_REGISTER_CRYPTO_DRIVER(drv, driver_id)\
-RTE_INIT(init_ ##driver_id);\
-static void init_ ##driver_id(void)\
-{\
-       driver_id = rte_cryptodev_allocate_driver(&(drv).driver);\
-}
-
-
 #ifdef __cplusplus
 }
 #endif