* [dpdk-dev] [PATCH] app/proc-info: fix security context info
@ 2020-12-24 7:51 Hemant Agrawal
2021-01-15 11:25 ` Thomas Monjalon
2021-01-20 5:17 ` [dpdk-dev] [PATCH v2] " Hemant Agrawal
0 siblings, 2 replies; 5+ messages in thread
From: Hemant Agrawal @ 2020-12-24 7:51 UTC (permalink / raw)
To: dev; +Cc: stable, Hemant Agrawal
We need to differentiate between crypto and ethernet security
context as they belong to different devices.
Fixes: d82d6ac64338 ("app/procinfo: add crypto security context info")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
app/proc-info/main.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index d743209f0d..6486a2419e 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -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
}
}
--
2.17.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH] app/proc-info: fix security context info
2020-12-24 7:51 [dpdk-dev] [PATCH] app/proc-info: fix security context info Hemant Agrawal
@ 2021-01-15 11:25 ` Thomas Monjalon
2021-01-20 5:17 ` [dpdk-dev] [PATCH v2] " Hemant Agrawal
1 sibling, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2021-01-15 11:25 UTC (permalink / raw)
To: Hemant Agrawal; +Cc: dev, stable
24/12/2020 08:51, Hemant Agrawal:
> 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
It seems this new parameter would better be a boolean.
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH v2] app/proc-info: fix security context info
2020-12-24 7:51 [dpdk-dev] [PATCH] app/proc-info: fix security context info Hemant Agrawal
2021-01-15 11:25 ` Thomas Monjalon
@ 2021-01-20 5:17 ` Hemant Agrawal
2021-01-26 13:06 ` [dpdk-dev] [PATCH v3 1/1] app/procinfo: " Thomas Monjalon
1 sibling, 1 reply; 5+ messages in thread
From: Hemant Agrawal @ 2021-01-20 5:17 UTC (permalink / raw)
To: dev, thomas; +Cc: stable, Hemant Agrawal
We need to differentiate between crypto and ethernet security
context as they belong to different devices.
Fixes: d82d6ac64338 ("app/procinfo: add crypto security context info")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
---
app/proc-info/main.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index d743209f0d..f5121720c4 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -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
}
}
--
2.17.1
^ permalink raw reply [flat|nested] 5+ messages in thread
* [dpdk-dev] [PATCH v3 1/1] app/procinfo: fix security context info
2021-01-20 5:17 ` [dpdk-dev] [PATCH v2] " Hemant Agrawal
@ 2021-01-26 13:06 ` Thomas Monjalon
2021-01-26 13:08 ` Thomas Monjalon
0 siblings, 1 reply; 5+ messages in thread
From: Thomas Monjalon @ 2021-01-26 13:06 UTC (permalink / raw)
To: dev
Cc: Hemant Agrawal, stable, Maryam Tahhan, Reshma Pattan, Stephen Hemminger
From: Hemant Agrawal <hemant.agrawal@nxp.com>
We need to differentiate between crypto and ethernet security
context as they belong to different devices.
Fixes: d82d6ac64338 ("app/procinfo: add crypto security context info")
Cc: stable@dpdk.org
Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
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(-)
diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index 44249dd2cb..b9587f7ded 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -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
}
}
--
2.30.0
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [dpdk-dev] [PATCH v3 1/1] app/procinfo: fix security context info
2021-01-26 13:06 ` [dpdk-dev] [PATCH v3 1/1] app/procinfo: " Thomas Monjalon
@ 2021-01-26 13:08 ` Thomas Monjalon
0 siblings, 0 replies; 5+ messages in thread
From: Thomas Monjalon @ 2021-01-26 13:08 UTC (permalink / raw)
To: Hemant Agrawal
Cc: dev, stable, Maryam Tahhan, Reshma Pattan, Stephen Hemminger
26/01/2021 14:06, Thomas Monjalon:
> From: Hemant Agrawal <hemant.agrawal@nxp.com>
>
> We need to differentiate between crypto and ethernet security
> context as they belong to different devices.
>
> Fixes: d82d6ac64338 ("app/procinfo: add crypto security context info")
> Cc: stable@dpdk.org
>
> Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> v3: include stdbool.h and use true/false instead of 1/0
Applied, thanks
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2021-01-26 13:08 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-24 7:51 [dpdk-dev] [PATCH] app/proc-info: fix security context info Hemant Agrawal
2021-01-15 11:25 ` Thomas Monjalon
2021-01-20 5:17 ` [dpdk-dev] [PATCH v2] " Hemant Agrawal
2021-01-26 13:06 ` [dpdk-dev] [PATCH v3 1/1] app/procinfo: " Thomas Monjalon
2021-01-26 13:08 ` Thomas Monjalon
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).