app/proc-info: fix security context info
PATCH 1/1 app/proc-info: fix security context info
We need to differentiate between crypto and ethernet security context as they belong to different devices.
--- app/proc-info/main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
app/proc-info/main.c +9 -4
@@ -648,11 +648,16 @@ metrics_display(int port_id) }static void -show_security_context (uint16_t portid) +show_security_context (uint16_t portid,uint8_t inline_offload) { -void *p_ctx =rte_eth_dev_get_sec_ctx (portid); +void *p_ctx;const struct rte_security_capability *s_cap; +if (inline_offload) + p_ctx =rte_eth_dev_get_sec_ctx (portid); +else + p_ctx =rte_cryptodev_get_sec_ctx (portid); +if (p_ctx ==NULL )return ;
@@ -859,7 +864,7 @@ show_port(void) }#ifdef RTE_LIB_SECURITY -show_security_context (i); +show_security_context (i,1 );#endif } }
@@ -1224,7 +1229,7 @@ show_crypto(void) }#ifdef RTE_LIB_SECURITY -show_security_context (i); +show_security_context (i,0 );#endif } }
Signature · 1 line
2.17.1
24/12/2020 08:51, Hemant Agrawal:
Quoted 26 lines
static void
app/proc-info/main.c +8
-3-show_security_context(uint16_t portid) +show_security_context(uint16_t portid, uint8_t inline_offload) { -void *p_ctx =rte_eth_dev_get_sec_ctx (portid); + void *p_ctx;const struct rte_security_capability *s_cap; +if (inline_offload) + p_ctx =rte_eth_dev_get_sec_ctx (portid); +else + p_ctx =rte_cryptodev_get_sec_ctx (portid); +if (p_ctx ==NULL )return ;@@ -859,7 +864,7 @@ show_port(void) }#ifdef RTE_LIB_SECURITY -show_security_context (i); +show_security_context (i,1 );#endif } }
app/proc-info/main.c show_crypto(void) · line 1233
Quoted 6 lines
app/proc-info/main.c +1
-1@@ -1224,7 +1229,7 @@ show_crypto(void) }#ifdef RTE_LIB_SECURITY -show_security_context (i); +show_security_context (i,0 );#endif
It seems this new parameter would better be a boolean.
PATCH v2 1/1 app/proc-info: fix security context info
In reply to Hemant AgrawalWe need to differentiate between crypto and ethernet security context as they belong to different devices.
--- app/proc-info/main.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
app/proc-info/main.c +9 -4
@@ -648,11 +648,16 @@ metrics_display(int port_id) }static void -show_security_context (uint16_t portid) +show_security_context (uint16_t portid,bool inline_offload) { -void *p_ctx =rte_eth_dev_get_sec_ctx (portid); +void *p_ctx;const struct rte_security_capability *s_cap; +if (inline_offload) + p_ctx =rte_eth_dev_get_sec_ctx (portid); +else + p_ctx =rte_cryptodev_get_sec_ctx (portid); +if (p_ctx ==NULL )return ;
@@ -859,7 +864,7 @@ show_port(void) }#ifdef RTE_LIB_SECURITY -show_security_context (i); +show_security_context (i,1 );#endif } }
@@ -1224,7 +1229,7 @@ show_crypto(void) }#ifdef RTE_LIB_SECURITY -show_security_context (i); +show_security_context (i,0 );#endif } }
Signature · 1 line
2.17.1
PATCH v3 1/1 app/procinfo: fix security context info
From: Hemant Agrawal <[email protected]>
We need to differentiate between crypto and ethernet security context as they belong to different devices.
---
v3: include stdbool.h and use true/false instead of 1/0
--- app/proc-info/main.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
app/proc-info/main.c +10 -4
@@ -5,6 +5,7 @@#include <stdio.h> #include <string.h> #include <stdint.h> +#include <stdbool.h> #include <errno.h> #include <stdarg.h> #include <inttypes.h>
@@ -645,11 +646,16 @@ metrics_display(int port_id) }static void -show_security_context (uint16_t portid) +show_security_context (uint16_t portid,bool inline_offload) { -void *p_ctx =rte_eth_dev_get_sec_ctx (portid); +void *p_ctx;const struct rte_security_capability *s_cap; +if (inline_offload) + p_ctx =rte_eth_dev_get_sec_ctx (portid); +else + p_ctx =rte_cryptodev_get_sec_ctx (portid); +if (p_ctx ==NULL )return ;
@@ -856,7 +862,7 @@ show_port(void) }#ifdef RTE_LIB_SECURITY -show_security_context (i); +show_security_context (i, true);#endif } }
@@ -1220,7 +1226,7 @@ show_crypto(void) }#ifdef RTE_LIB_SECURITY -show_security_context (i); +show_security_context (i, false);#endif } }
Signature · 1 line
2.30.0
Thomas Monjalon
AppliedRe: [dpdk-dev] [PATCH v3 1/1] app/procinfo: fix security context info
26/01/2021 14:06, Thomas Monjalon:
Quoted 5 lines
From: Hemant Agrawal <[email protected]>
We need to differentiate between crypto and ethernet security context as they belong to different devices.
Quoted 7 lines
Fixes d82d6ac64338 ("app/procinfo: add crypto security context info")Signed-off-by Hemant Agrawal <[email protected]>Signed-off-by Thomas Monjalon <[email protected]>---
v3: includestdbool.hand use true/false instead of 1/0
Applied, thanks