cryptodev: remove unused driver struct
[dpdk.git] / lib / librte_cryptodev / rte_cryptodev.h
index d61a43e..4e318f0 100644 (file)
@@ -49,6 +49,7 @@ extern "C" {
 #include "rte_crypto.h"
 #include "rte_dev.h"
 #include <rte_common.h>
+#include <rte_vdev.h>
 
 #define CRYPTODEV_NAME_NULL_PMD                crypto_null
 /**< Null crypto PMD device name */
@@ -70,6 +71,8 @@ extern "C" {
 /**< ARMv8 Crypto PMD device name */
 #define CRYPTODEV_NAME_SCHEDULER_PMD   crypto_scheduler
 /**< Scheduler Crypto PMD device name */
+#define CRYPTODEV_NAME_DPAA2_SEC_PMD   cryptodev_dpaa2_sec_pmd
+/**< NXP DPAA2 - SEC PMD device name */
 
 /** Crypto device type */
 enum rte_cryptodev_type {
@@ -83,6 +86,7 @@ enum rte_cryptodev_type {
        RTE_CRYPTODEV_OPENSSL_PMD,    /**<  OpenSSL PMD */
        RTE_CRYPTODEV_ARMV8_PMD,        /**< ARMv8 crypto PMD */
        RTE_CRYPTODEV_SCHEDULER_PMD,    /**< Crypto Scheduler PMD */
+       RTE_CRYPTODEV_DPAA2_SEC_PMD,    /**< NXP DPAA2 - SEC PMD */
 };
 
 extern const char **rte_cyptodev_names;
@@ -332,6 +336,10 @@ struct rte_cryptodev_info {
        struct {
                unsigned max_nb_sessions;
                /**< Maximum number of sessions supported by device. */
+               unsigned int max_nb_sessions_per_qp;
+               /**< Maximum number of sessions per queue pair.
+                * Default 0 for infinite sessions
+                */
        } sym;
 };
 
@@ -378,35 +386,6 @@ struct rte_cryptodev_stats {
 
 #define RTE_CRYPTODEV_NAME_MAX_LEN     (64)
 /**< Max length of name of crypto PMD */
-#define RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_QUEUE_PAIRS  8
-#define RTE_CRYPTODEV_VDEV_DEFAULT_MAX_NB_SESSIONS     2048
-
-/**
- * @internal
- * Initialisation parameters for virtual crypto devices
- */
-struct rte_crypto_vdev_init_params {
-       unsigned max_nb_queue_pairs;
-       unsigned max_nb_sessions;
-       uint8_t socket_id;
-       char name[RTE_CRYPTODEV_NAME_MAX_LEN];
-};
-
-/**
- * Parse virtual device initialisation parameters input arguments
- * @internal
- *
- * @params     params          Initialisation parameters with defaults set.
- * @params     input_args      Command line arguments
- *
- * @return
- * 0 on successful parse
- * <0 on failure to parse
- */
-int
-rte_cryptodev_parse_vdev_init_params(
-               struct rte_crypto_vdev_init_params *params,
-               const char *input_args);
 
 /**
  * Create a virtual crypto device
@@ -456,9 +435,10 @@ extern uint8_t
 rte_cryptodev_count_devtype(enum rte_cryptodev_type type);
 
 /**
- * Get number and identifiers of attached crypto device.
+ * Get number and identifiers of attached crypto devices that
+ * use the same crypto driver.
  *
- * @param      dev_name        device name.
+ * @param      driver_name     driver name.
  * @param      devices         output devices identifiers.
  * @param      nb_devices      maximal number of devices.
  *
@@ -466,7 +446,7 @@ rte_cryptodev_count_devtype(enum rte_cryptodev_type type);
  *   Returns number of attached crypto device.
  */
 uint8_t
-rte_cryptodev_devices_get(const char *dev_name, uint8_t *devices,
+rte_cryptodev_devices_get(const char *driver_name, uint8_t *devices,
                uint8_t nb_devices);
 /*
  * Return the NUMA socket to which a device is connected
@@ -714,8 +694,6 @@ struct rte_cryptodev {
        enqueue_pkt_burst_t enqueue_burst;
        /**< Pointer to PMD transmit function. */
 
-       const struct rte_cryptodev_driver *driver;
-       /**< Driver for this device */
        struct rte_cryptodev_data *data;
        /**< Pointer to device data */
        struct rte_cryptodev_ops *dev_ops;
@@ -915,6 +893,36 @@ extern struct rte_cryptodev_sym_session *
 rte_cryptodev_sym_session_free(uint8_t dev_id,
                struct rte_cryptodev_sym_session *session);
 
+/**
+ * Attach queue pair with sym session.
+ *
+ * @param      qp_id           Queue pair to which session will be attached.
+ * @param      session         Session pointer previously allocated by
+ *                             *rte_cryptodev_sym_session_create*.
+ *
+ * @return
+ *  - On success, zero.
+ *  - On failure, a negative value.
+ */
+int
+rte_cryptodev_queue_pair_attach_sym_session(uint16_t qp_id,
+               struct rte_cryptodev_sym_session *session);
+
+/**
+ * Detach queue pair with sym session.
+ *
+ * @param      qp_id           Queue pair to which session is attached.
+ * @param      session         Session pointer previously allocated by
+ *                             *rte_cryptodev_sym_session_create*.
+ *
+ * @return
+ *  - On success, zero.
+ *  - On failure, a negative value.
+ */
+int
+rte_cryptodev_queue_pair_detach_sym_session(uint16_t qp_id,
+               struct rte_cryptodev_sym_session *session);
+
 
 #ifdef __cplusplus
 }