[v3] security: add statistics definitions and update API

Message ID 1567515963-8635-1-git-send-email-radu.nicolau@intel.com (mailing list archive)
State Accepted, archived
Delegated to: akhil goyal
Headers
Series [v3] security: add statistics definitions and update API |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-dpdk_compile_ovs success Compile Testing PASS
ci/iol-dpdk_compile_spdk success Compile Testing PASS
ci/iol-dpdk_compile success Compile Testing PASS
ci/intel-Performance success Performance Testing PASS
ci/mellanox-Performance success Performance Testing PASS

Commit Message

Radu Nicolau Sept. 3, 2019, 1:06 p.m. UTC
  Update IPsec statistics struct definition, add per SA
statistics collection enable flag.

Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
---
v2: added second reserved field
v3: update doc

 lib/librte_security/rte_security.h | 25 +++++++++++++++++++++----
 1 file changed, 21 insertions(+), 4 deletions(-)
  

Comments

Akhil Goyal Sept. 4, 2019, 9:23 a.m. UTC | #1
> 
> Update IPsec statistics struct definition, add per SA
> statistics collection enable flag.
> 
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> ---
> v2: added second reserved field
> v3: update doc
> 
Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
  
Anoob Joseph Sept. 4, 2019, 9:31 a.m. UTC | #2
> -----Original Message-----
> From: Radu Nicolau <radu.nicolau@intel.com>
> Sent: Tuesday, September 3, 2019 6:36 PM
> To: dev@dpdk.org
> Cc: akhil.goyal@nxp.com; konstantin.ananyev@intel.com;
> bernard.iremonger@intel.com; declan.doherty@intel.com;
> stephen@networkplumber.org; Anoob Joseph <anoobj@marvell.com>;
> Radu Nicolau <radu.nicolau@intel.com>
> Subject: [EXT] [PATCH v3] security: add statistics definitions and update API
> 
> External Email
> 
> ----------------------------------------------------------------------
> Update IPsec statistics struct definition, add per SA statistics collection enable
> flag.
> 
> Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> ---
> v2: added second reserved field
> v3: update doc

Acked-by: Anoob Joseph <anoobj@marvell.com>
  
Akhil Goyal Sept. 19, 2019, 3:09 p.m. UTC | #3
> >
> > Update IPsec statistics struct definition, add per SA
> > statistics collection enable flag.
> >
> > Signed-off-by: Radu Nicolau <radu.nicolau@intel.com>
> > ---
> > v2: added second reserved field
> > v3: update doc
> >
> Acked-by: Akhil Goyal <akhil.goyal@nxp.com>
Applied to dpdk-next-crypto

Thanks.
  

Patch

diff --git a/lib/librte_security/rte_security.h b/lib/librte_security/rte_security.h
index d56907d..2d064f4 100644
--- a/lib/librte_security/rte_security.h
+++ b/lib/librte_security/rte_security.h
@@ -172,6 +172,14 @@  struct rte_security_ipsec_sa_options {
 	 * * 0: Inner/outer header are not modified.
 	 */
 	uint32_t ecn : 1;
+
+	/** Security statistics
+	 *
+	 * * 1: Enable per session security statistics collection for
+	 *      this SA, if supported by the driver.
+	 * * 0: Disable per session security statistics collection for this SA.
+	 */
+	uint32_t stats : 1;
 };
 
 /** IPSec security association direction */
@@ -482,8 +490,14 @@  struct rte_security_macsec_stats {
 };
 
 struct rte_security_ipsec_stats {
-	uint64_t reserved;
-
+	uint64_t ipackets;  /**< Successfully received IPsec packets. */
+	uint64_t opackets;  /**< Successfully transmitted IPsec packets.*/
+	uint64_t ibytes;    /**< Successfully received IPsec bytes. */
+	uint64_t obytes;    /**< Successfully transmitted IPsec bytes. */
+	uint64_t ierrors;   /**< IPsec packets receive/decrypt errors. */
+	uint64_t oerrors;   /**< IPsec packets transmit/encrypt errors. */
+	uint64_t reserved1; /**< Reserved for future use. */
+	uint64_t reserved2; /**< Reserved for future use. */
 };
 
 struct rte_security_pdcp_stats {
@@ -507,10 +521,13 @@  struct rte_security_stats {
  *
  * @param	instance	security instance
  * @param	sess		security session
+ * If security session is NULL then global (per security instance) statistics
+ * will be retrieved, if supported. Global statistics collection is not
+ * dependent on the per session statistics configuration.
  * @param	stats		statistics
  * @return
- *  - On success return 0
- *  - On failure errno
+ *  - On success, return 0
+ *  - On failure, a negative value
  */
 __rte_experimental
 int