]> git.droids-corp.org - dpdk.git/commitdiff
security: get session size
authorRadu Nicolau <radu.nicolau@intel.com>
Thu, 18 Jan 2018 15:41:41 +0000 (15:41 +0000)
committerPablo de Lara <pablo.de.lara.guarch@intel.com>
Sat, 20 Jan 2018 15:10:52 +0000 (16:10 +0100)
Add function to get security session size.

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
lib/librte_security/rte_security.c
lib/librte_security/rte_security.h
lib/librte_security/rte_security_driver.h
lib/librte_security/rte_security_version.map

index 5805051168929c15684a8295a9184a2bd2de0f9d..6461dba053f2e00072256ebcaffb6a65c7ee6065 100644 (file)
@@ -70,6 +70,13 @@ rte_security_session_update(struct rte_security_ctx *instance,
        return instance->ops->session_update(instance->device, sess, conf);
 }
 
+unsigned int
+rte_security_session_get_size(struct rte_security_ctx *instance)
+{
+       RTE_FUNC_PTR_OR_ERR_RET(*instance->ops->session_get_size, 0);
+       return instance->ops->session_get_size(instance->device);
+}
+
 int
 rte_security_session_stats_get(struct rte_security_ctx *instance,
                               struct rte_security_session *sess,
index 004a0ebe3d92337328207d6d8168a1373fdd015c..d7362f3319e751b776c7bc868a9043077e5685fc 100644 (file)
@@ -314,6 +314,18 @@ rte_security_session_update(struct rte_security_ctx *instance,
                            struct rte_security_session *sess,
                            struct rte_security_session_conf *conf);
 
+/**
+ * Get the size of the security session data for a device.
+ *
+ * @param   instance   security instance.
+ *
+ * @return
+ *   - Size of the private data, if successful
+ *   - 0 if device is invalid or does not support the operation.
+ */
+unsigned int
+rte_security_session_get_size(struct rte_security_ctx *instance);
+
 /**
  * Free security session header and the session private data and
  * return it to its original mempool.
index bf0170ec932f30a8f0af181998ba165251bf97f0..46239049b18e205e2258fdbbfe0a46d1345a0c43 100644 (file)
@@ -91,6 +91,18 @@ typedef int (*security_session_destroy_t)(void *device,
 typedef int (*security_session_update_t)(void *device,
                struct rte_security_session *sess,
                struct rte_security_session_conf *conf);
+
+/**
+ * Get the size of a security session
+ *
+ * @param      device          Crypto/eth device pointer
+ *
+ * @return
+ *  - On success returns the size of the session structure for device
+ *  - On failure returns 0
+ */
+typedef unsigned int (*security_session_get_size)(void *device);
+
 /**
  * Get stats from the PMD.
  *
@@ -155,6 +167,8 @@ struct rte_security_ops {
        /**< Configure a security session. */
        security_session_update_t session_update;
        /**< Update a security session. */
+       security_session_get_size session_get_size;
+       /**< Return size of security session. */
        security_session_stats_get_t session_stats_get;
        /**< Get security session statistics. */
        security_session_destroy_t session_destroy;
index bff5039b60c71bbcca56485f27132ef5c9a3f5b6..5a1c8ae38c3f5cd1c20c78a507bb01fb7639c136 100644 (file)
@@ -7,6 +7,7 @@ EXPERIMENTAL {
        rte_security_get_userdata;
        rte_security_session_create;
        rte_security_session_destroy;
+       rte_security_session_get_size;
        rte_security_session_stats_get;
        rte_security_session_update;
        rte_security_set_pkt_metadata;