From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 664CAA2E1B for ; Tue, 3 Sep 2019 12:14:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 0D7621E4EA; Tue, 3 Sep 2019 12:14:04 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 9106A1D149 for ; Tue, 3 Sep 2019 12:14:02 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Sep 2019 03:14:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,462,1559545200"; d="scan'208";a="211940691" Received: from rnicolau-mobl1.ger.corp.intel.com (HELO [10.237.221.62]) ([10.237.221.62]) by fmsmga002.fm.intel.com with ESMTP; 03 Sep 2019 03:13:59 -0700 To: Anoob Joseph , "dev@dpdk.org" Cc: "akhil.goyal@nxp.com" , "konstantin.ananyev@intel.com" , "bernard.iremonger@intel.com" , "declan.doherty@intel.com" , "stephen@networkplumber.org" References: <1567156760-29520-1-git-send-email-radu.nicolau@intel.com> <1567503690-15586-1-git-send-email-radu.nicolau@intel.com> From: "Nicolau, Radu" Message-ID: Date: Tue, 3 Sep 2019 11:13:59 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-GB Subject: Re: [dpdk-dev] [PATCH v2] 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" Hi, replies inline: On 9/3/2019 11:04 AM, Anoob Joseph wrote: > Hi Radu, > > Please see inline. > > Thanks, > Anoob > >> -----Original Message----- >> From: dev On Behalf Of Radu Nicolau >> Sent: Tuesday, September 3, 2019 3:12 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; Radu Nicolau >> Subject: [dpdk-dev] [PATCH v2] security: add statistics definitions and update >> API >> >> Update IPsec statistics struct definition, add per SA statistics collection enable >> flag. >> >> Signed-off-by: Radu Nicolau >> --- >> v2: added second reserved field >> >> lib/librte_security/rte_security.h | 24 ++++++++++++++++++++---- >> 1 file changed, 20 insertions(+), 4 deletions(-) >> >> diff --git a/lib/librte_security/rte_security.h >> b/lib/librte_security/rte_security.h >> index 96806e3..21bbee2 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. >> + */ > [Anoob] I believe you will have to add the above description after the item. Else the documentation generated could end up wrong. Description of all items of this structure is actually wrong. > https://doc.dpdk.org/api/structrte__security__ipsec__sa__options.html It is wrong indeed, I will fix it for the whole struct. > >> + 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,12 @@ 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 > [Anoob] With NULL as security session, do we expect PMDs to return stats for all sessions or only for the ones 'stats' is enabled? We expect global stats, not a sum of per session stats, and independent of the per session configuration - that is, if there are 2 sessions and the per seesion stats are enabled for only one, this will still return the global total. I will make a note of this in the doc. > >> * @param stats statistics >> * @return >> - * - On success return 0 >> - * - On failure errno >> + * - On success, return 0 >> + * - On failure, a negative value > [Anoob] PMDs which doesn't support this would return ENOTSUP, right? Do you think we should document that? I don't think we need to explicitly document it, as the ENOTSUP is quite self explanatory. > >> */ >> __rte_experimental >> int >> -- >> 2.7.4