From patchwork Tue Sep 3 13:06:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Radu Nicolau X-Patchwork-Id: 58462 X-Patchwork-Delegate: gakhil@marvell.com Return-Path: X-Original-To: patchwork@dpdk.org Delivered-To: patchwork@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 779641BEFE; Tue, 3 Sep 2019 15:06:11 +0200 (CEST) Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by dpdk.org (Postfix) with ESMTP id E053F1BEC8 for ; Tue, 3 Sep 2019 15:06:09 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Sep 2019 06:06:09 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,463,1559545200"; d="scan'208";a="187247047" Received: from silpixa00383879.ir.intel.com ([10.237.222.142]) by orsmga006.jf.intel.com with ESMTP; 03 Sep 2019 06:06:07 -0700 From: Radu Nicolau To: dev@dpdk.org Cc: akhil.goyal@nxp.com, konstantin.ananyev@intel.com, bernard.iremonger@intel.com, declan.doherty@intel.com, stephen@networkplumber.org, anoobj@marvell.com, Radu Nicolau Date: Tue, 3 Sep 2019 14:06:03 +0100 Message-Id: <1567515963-8635-1-git-send-email-radu.nicolau@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1567156760-29520-1-git-send-email-radu.nicolau@intel.com> References: <1567156760-29520-1-git-send-email-radu.nicolau@intel.com> Subject: [dpdk-dev] [PATCH v3] security: add statistics definitions and update API X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Update IPsec statistics struct definition, add per SA statistics collection enable flag. Signed-off-by: Radu Nicolau Acked-by: Akhil Goyal Acked-by: Anoob Joseph --- v2: added second reserved field v3: update doc lib/librte_security/rte_security.h | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) 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