security: add statistics definitions and update API
PATCH 1/1 security: add statistics definitions and update API
Update IPsec statistics struct definition, add per SA statistics collection enable flag.
--- lib/librte_security/rte_security.h | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
lib/librte_security/rte_security.h +18 -2
@@ -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,6 +490,12 @@ struct rte_security_macsec_stats { };struct rte_security_ipsec_stats { +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 reserved; };
@@ -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 * @param stats statistics * @return -* - On success return 0 -* - On failure errno +* - On success, return 0 +* - On failure, a negative value */ __rte_experimental int
Signature · 1 line
2.7.4
lib/librte_security/rte_security.h struct rte_security_macsec_stats { · line 501
Quoted 11 lines · On Fri, 30 Aug 2019 10:19:20 +0100 Radu Nicolau <[email protected]> wrote:
struct
rte_security_ipsec_stats{lib/librte_security/rte_security.h +6
-0+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 reserved; };
Why not a second reserved field, then it will be 8*8 64 bytes long which is cache aligned. And you will have a pair for future counters.
Quoted 13 lines · Stephen Hemminger
Quoted 10 lines · On Fri, 30 Aug 2019 10:19:20 +0100 Radu Nicolau <[email protected]> wrote:
struct rte_security_ipsec_stats {lib/librte_security/rte_security.h +6
-0+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 reserved;
Quoted 3 lines
Quoted 1 line
};Why not a second reserved field, then it will be 8*8 64 bytes long which is cache aligned. And you will have a pair for future counters.
Yes, I will add a second reserved field.
PATCH v2 1/1 security: add statistics definitions and update API
In reply to Radu NicolauUpdate IPsec statistics struct definition, add per SA statistics collection enable flag.
---
v2: added second reserved field
lib/librte_security/rte_security.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-)
lib/librte_security/rte_security.h +20 -4
@@ -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,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 * @param stats statistics * @return -* - On success return 0 -* - On failure errno +* - On success, return 0 +* - On failure, a negative value */ __rte_experimental int
Signature · 1 line
2.7.4
Hi Radu,
Please see inline.
Thanks,
Anoob
Quoted 26 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Radu Nicolau
Sent: Tuesday, September 3, 2019 3:12 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Radu Nicolau <[email protected]>
Subject: [dpdk-dev] [PATCH v2] security: add statistics definitions and update APIUpdate IPsec statistics struct definition, add per SA statistics collection enable flag.
Signed-off-by Radu Nicolau <[email protected]>---
v2: added second reserved fieldlib/librte_security/rte_security.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-)lib/librte_security/rte_security.h +0
-0
lib/librte_security/rte_security.h struct rte_security_ipsec_sa_options { · line 181
Quoted 10 lines
lib/librte_security/rte_security.h +7
-0@@ -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
Quoted 21 lines
lib/librte_security/rte_security.h +1
-0+ uint32_t stats : 1; }; /** IPSec security association direction */ @@ -482,8 +490,14 @@ struct
rte_security_macsec_stats{ };struct
rte_security_ipsec_stats{lib/librte_security/rte_security.h +8
-2-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 {
lib/librte_security/rte_security.h struct rte_security_stats { · line 526
Quoted 6 lines
lib/librte_security/rte_security.h +3
-0@@ -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?
lib/librte_security/rte_security.h struct rte_security_stats { · line 529
Quoted 6 lines
lib/librte_security/rte_security.h +2
-2* @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?
Quoted 5 lines
lib/librte_security/rte_security.h +0
-1*/ __rte_experimental int --2.7.4
Hi, replies inline:
Quoted 37 lines · Anoob Joseph
Hi Radu,
Please see inline.
Thanks,
AnoobQuoted 30 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Radu Nicolau
Sent: Tuesday, September 3, 2019 3:12 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Radu Nicolau <[email protected]>
Subject: [dpdk-dev] [PATCH v2] security: add statistics definitions and update APIUpdate IPsec statistics struct definition, add per SA statistics collection enable flag.
Signed-off-by Radu Nicolau <[email protected]>---
v2: added second reserved fieldlib/librte_security/rte_security.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-)lib/librte_security/rte_security.h +1
-0@@ -172,6 +172,14 @@ struct rte_security_ipsec_sa_options {* * 0: Inner/outer header are not modified. */ uint32_t ecn : 1; +
Quoted 8 lines
lib/librte_security/rte_security.h struct rte_security_ipsec_sa_options { · line 181
Quoted 6 lines
lib/librte_security/rte_security.h +6
-0+/**< 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.
Quoted 20 lines
Quoted 20 lines
lib/librte_security/rte_security.h +1
-0+ uint32_t stats : 1; }; /** IPSec security association direction */ @@ -482,8 +490,14 @@ struct
rte_security_macsec_stats{ };struct rte_security_ipsec_stats {lib/librte_security/rte_security.h +8
-2-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. */ };
Quoted 9 lines
lib/librte_security/rte_security.h struct rte_security_stats { · line 526
Quoted 8 lines
struct rte_security_pdcp_stats {lib/librte_security/rte_security.h +3
-0@@ -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.
Quoted 8 lines
lib/librte_security/rte_security.h struct rte_security_stats { · line 529
Quoted 7 lines
lib/librte_security/rte_security.h +2
-2* @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.
Quoted 6 lines
Quoted 6 lines
lib/librte_security/rte_security.h +0
-1*/ __rte_experimental int --2.7.4
Hi Radu,
Please see inline.
Thanks,
Anoob
Quoted 93 lines
-----Original Message-----
From: Nicolau, Radu <[email protected]>
Sent: Tuesday, September 3, 2019 3:44 PM
To: Anoob Joseph <[email protected]>; [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]
Subject: [EXT] Re: [dpdk-dev] [PATCH v2] security: add statistics definitions and update APIExternal Email
----------------------------------------------------------------------
Hi, replies inline:Quoted 36 lines · Anoob Joseph
Hi Radu,
Please see inline.
Thanks,
AnoobQuoted 29 lines
-----Original Message-----
From: dev <[email protected]> On Behalf Of Radu Nicolau
Sent: Tuesday, September 3, 2019 3:12 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Radu Nicolau <[email protected]>
Subject: [dpdk-dev] [PATCH v2] security: add statistics definitions and update APIUpdate IPsec statistics struct definition, add per SA statistics collection enable flag.
Signed-off-by Radu Nicolau <[email protected]>---
v2: added second reserved fieldlib/librte_security/rte_security.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-)lib/librte_security/rte_security.h +0
-0@@ -172,6 +172,14 @@ struct rte_security_ipsec_sa_options {* * 0: Inner/outer header are not modified. */ uint32_t ecn : 1;Quoted 8 lines
lib/librte_security/rte_security.h struct rte_security_ipsec_sa_options { · line 181
Quoted 7 lines
lib/librte_security/rte_security.h +7
-0+ +/**< 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.
It is wrong indeed, I will fix it for the whole struct.
Quoted 20 lines
Quoted 20 lines
lib/librte_security/rte_security.h +1
-0+ uint32_t stats : 1; }; /** IPSec security association direction */ @@ -482,8 +490,14 @@struct
rte_security_macsec_stats{ };struct rte_security_ipsec_stats {lib/librte_security/rte_security.h +8
-2-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. */ };Quoted 9 lines
lib/librte_security/rte_security.h struct rte_security_stats { · line 526
Quoted 8 lines
struct rte_security_pdcp_stats {lib/librte_security/rte_security.h +3
-0@@ -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
Quoted 5 lines
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.
[Anoob] That sounds good.
Quoted 11 lines
Quoted 8 lines
lib/librte_security/rte_security.h struct rte_security_stats { · line 529
Quoted 7 lines
lib/librte_security/rte_security.h +2
-2* @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.
[Anoob] Agreed.
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
lib/librte_security/rte_security.h +0
-1*/ __rte_experimental int --2.7.4
PATCH v3 1/1 security: add statistics definitions and update API
In reply to Radu NicolauUpdate IPsec statistics struct definition, add per SA statistics collection enable flag.
---
v2: added second reserved field
v3: update doc
lib/librte_security/rte_security.h | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-)
lib/librte_security/rte_security.h +21 -4
@@ -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
Signature · 1 line
2.7.4
Quoted 10 lines
Update IPsec statistics struct definition, add per SA statistics collection enable flag.
Signed-off-by Radu Nicolau <[email protected]>---
v2: added second reserved field
v3: update doc
Akhil Goyal
AppliedQuoted 10 lines
Quoted 9 lines
Update IPsec statistics struct definition, add per SA statistics collection enable flag.
Signed-off-by Radu Nicolau <[email protected]>---
v2: added second reserved field
v3: update docAcked-by Akhil Goyal <[email protected]>
Applied to dpdk-next-crypto
Thanks.
Quoted 12 lines
-----Original Message-----
From: Radu Nicolau <[email protected]>
Sent: Tuesday, September 3, 2019 6:36 PM
To: [email protected]
Cc: [email protected]; [email protected]; [email protected]; [email protected]; [email protected]; Anoob Joseph <[email protected]>; Radu Nicolau <[email protected]>
Subject: [EXT] [PATCH v3] security: add statistics definitions and update APIExternal Email
Quoted 8 lines
----------------------------------------------------------------------
Update IPsec statistics struct definition, add per SA statistics collection enable flag.Signed-off-by Radu Nicolau <[email protected]>---
v2: added second reserved field
v3: update doc