DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Hemant Agrawal <hemant.agrawal@nxp.com>,
	Stephen Hemminger <stephen@networkplumber.org>
Subject: [dpdk-dev] [PATCH v5 7/8] app/proc-info: add crypto security context info
Date: Tue, 28 Jul 2020 12:13:29 -0700	[thread overview]
Message-ID: <20200728191330.20864-8-stephen@networkplumber.org> (raw)
In-Reply-To: <20200728191330.20864-1-stephen@networkplumber.org>

From: Hemant Agrawal <hemant.agrawal@nxp.com>

If crypto context is not present, no point in displaying it.

This patch adds the crypto based security context info.
Also improve the flag printing to SECURITY OFFLOAD from
INLINE.

Use common code for displaying crypto context information
when doing show_ports and show_crypto.

Signed-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/proc-info/main.c | 80 +++++++++++++++++++++++++-------------------
 1 file changed, 46 insertions(+), 34 deletions(-)

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index 4e2e647498ff..282af670d20a 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -673,6 +673,32 @@ eth_tx_queue_available(uint16_t port_id, uint16_t queue_id, uint16_t n)
 	return count;
 }
 
+static void
+show_security_context(uint16_t portid)
+{
+	void *p_ctx = rte_eth_dev_get_sec_ctx(portid);
+	const struct rte_security_capability *s_cap;
+
+	if (p_ctx == NULL)
+		return;
+
+	printf("  - crypto context\n");
+	printf("\t  -- security context - %p\n", p_ctx);
+	printf("\t  -- size %u\n",
+	       rte_security_session_get_size(p_ctx));
+
+	s_cap = rte_security_capabilities_get(p_ctx);
+	if (s_cap) {
+		printf("\t  -- action (0x%x), protocol (0x%x),"
+		       " offload flags (0x%x)\n",
+		       s_cap->action,
+		       s_cap->protocol,
+		       s_cap->ol_flags);
+		printf("\t  -- capabilities - oper type %x\n",
+		       s_cap->crypto_capabilities->op);
+	}
+}
+
 static void
 show_port(void)
 {
@@ -841,26 +867,8 @@ show_port(void)
 			}
 		}
 
-		printf("  - cyrpto context\n");
 #ifdef RTE_LIBRTE_SECURITY
-		void *p_ctx = rte_eth_dev_get_sec_ctx(i);
-		printf("\t  -- security context - %p\n", p_ctx);
-
-		if (p_ctx) {
-			printf("\t  -- size %u\n",
-					rte_security_session_get_size(p_ctx));
-			const struct rte_security_capability *s_cap =
-				rte_security_capabilities_get(p_ctx);
-			if (s_cap) {
-				printf("\t  -- action (0x%x), protocol (0x%x),"
-						" offload flags (0x%x)\n",
-						s_cap->action,
-						s_cap->protocol,
-						s_cap->ol_flags);
-				printf("\t  -- capabilities - oper type %x\n",
-						s_cap->crypto_capabilities->op);
-			}
-		}
+		show_security_context(i);
 #endif
 	}
 }
@@ -1166,7 +1174,7 @@ display_crypto_feature_info(uint64_t x)
 	printf("\t\t  + AESNI: CPU (%c), HW (%c)\n",
 		(x & RTE_CRYPTODEV_FF_CPU_AESNI) ? 'y' : 'n',
 		(x & RTE_CRYPTODEV_FF_HW_ACCELERATED) ? 'y' : 'n');
-	printf("\t\t  + INLINE (%c)\n",
+	printf("\t\t  + SECURITY OFFLOAD (%c)\n",
 		(x & RTE_CRYPTODEV_FF_SECURITY) ? 'y' : 'n');
 	printf("\t\t  + ARM: NEON (%c), CE (%c)\n",
 		(x & RTE_CRYPTODEV_FF_CPU_NEON) ? 'y' : 'n',
@@ -1200,14 +1208,14 @@ show_crypto(void)
 
 		printf("  - device (%u)\n", i);
 		printf("\t  -- name (%s)\n"
-			"\t  -- driver (%s)\n"
-			"\t  -- id (%u) on socket (%d)\n"
-			"\t  -- queue pairs (%d)\n",
-			rte_cryptodev_name_get(i),
-			dev_info.driver_name,
-			dev_info.driver_id,
-			dev_info.device->numa_node,
-			rte_cryptodev_queue_pair_count(i));
+		       "\t  -- driver (%s)\n"
+		       "\t  -- id (%u) on socket (%d)\n"
+		       "\t  -- queue pairs (%d)\n",
+		       rte_cryptodev_name_get(i),
+		       dev_info.driver_name,
+		       dev_info.driver_id,
+		       dev_info.device->numa_node,
+		       rte_cryptodev_queue_pair_count(i));
 
 		display_crypto_feature_info(dev_info.feature_flags);
 
@@ -1215,14 +1223,18 @@ show_crypto(void)
 		if (rte_cryptodev_stats_get(i, &stats) == 0) {
 			printf("\t  -- stats\n");
 			printf("\t\t  + enqueue count (%"PRIu64")"
-				" error (%"PRIu64")\n",
-				stats.enqueued_count,
-				stats.enqueue_err_count);
+			       " error (%"PRIu64")\n",
+			       stats.enqueued_count,
+			       stats.enqueue_err_count);
 			printf("\t\t  + dequeue count (%"PRIu64")"
-				" error (%"PRIu64")\n",
-				stats.dequeued_count,
-				stats.dequeue_err_count);
+			       " error (%"PRIu64")\n",
+			       stats.dequeued_count,
+			       stats.dequeue_err_count);
 		}
+
+#ifdef RTE_LIBRTE_SECURITY
+		show_security_context(i);
+#endif
 	}
 }
 
-- 
2.27.0


  parent reply	other threads:[~2020-07-28 19:14 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-06 19:37 [dpdk-dev] [PATCH 0/7] proc-info enhancements Stephen Hemminger
2020-05-06 19:37 ` [dpdk-dev] [PATCH 1/7] app/proc-info: remove unused logtype #define Stephen Hemminger
2020-05-06 19:37 ` [dpdk-dev] [PATCH 2/7] app/proc-info: eliminate useless borders Stephen Hemminger
2020-05-06 19:37 ` [dpdk-dev] [PATCH 3/7] app/proc-info: hide EAL info messages Stephen Hemminger
2020-05-06 19:37 ` [dpdk-dev] [PATCH 4/7] app/proc-info: add more info to show_ports Stephen Hemminger
2020-05-06 19:37 ` [dpdk-dev] [PATCH 5/7] app/proc-info: hide crypto-context display Stephen Hemminger
2020-05-06 19:37 ` [dpdk-dev] [PATCH 6/7] app/proc-info: dump rx and tx descriptor info Stephen Hemminger
2020-05-06 19:37 ` [dpdk-dev] [PATCH 7/7] app/proc-info: provide way to request info on owned ports Stephen Hemminger
2020-05-06 19:57 ` [dpdk-dev] [PATCH v2 0/7] app/proc-info enhancements Stephen Hemminger
2020-05-06 19:57   ` [dpdk-dev] [PATCH v2 1/7] app/proc-info: remove unused logtype #define Stephen Hemminger
2020-05-06 19:57   ` [dpdk-dev] [PATCH v2 2/7] app/proc-info: eliminate useless borders Stephen Hemminger
2020-05-06 19:57   ` [dpdk-dev] [PATCH v2 3/7] app/proc-info: hide EAL info messages Stephen Hemminger
2020-05-06 19:57   ` [dpdk-dev] [PATCH v2 4/7] app/proc-info: add more info to show_ports Stephen Hemminger
2020-07-13 12:09     ` Hemant Agrawal
2020-05-06 19:57   ` [dpdk-dev] [PATCH v2 5/7] app/proc-info: hide crypto-context display Stephen Hemminger
2020-05-06 19:57   ` [dpdk-dev] [PATCH v2 6/7] app/proc-info: dump rx and tx descriptor info Stephen Hemminger
2020-07-13 12:08     ` Hemant Agrawal
2020-05-06 19:57   ` [dpdk-dev] [PATCH v2 7/7] app/proc-info: provide way to request info on owned ports Stephen Hemminger
2020-07-13 12:10   ` [dpdk-dev] [PATCH v2 0/7] app/proc-info enhancements Hemant Agrawal
2020-07-15 21:22 ` [dpdk-dev] [PATCH v3 0/7] app/proc-info enhancments Stephen Hemminger
2020-07-15 21:22   ` [dpdk-dev] [PATCH v3 1/7] app/proc-info: remove unused logtype #define Stephen Hemminger
2020-07-15 21:22   ` [dpdk-dev] [PATCH v3 2/7] app/proc-info: eliminate useless borders Stephen Hemminger
2020-07-17 14:06     ` Thomas Monjalon
2020-08-13  4:10       ` Varghese, Vipin
2020-08-13 16:11         ` Stephen Hemminger
2020-08-14  0:45           ` Varghese, Vipin
2020-08-14  1:14             ` Varghese, Vipin
2020-08-14  3:18               ` Stephen Hemminger
2020-08-14 11:08                 ` Varghese, Vipin
2020-08-14 14:56                   ` Stephen Hemminger
2020-08-15  2:48                     ` Varghese, Vipin
2020-07-15 21:22   ` [dpdk-dev] [PATCH v3 3/7] app/proc-info: hide EAL info messages Stephen Hemminger
2020-07-17 14:04     ` Thomas Monjalon
2020-07-15 21:22   ` [dpdk-dev] [PATCH v3 4/7] app/proc-info: add more info to show_ports Stephen Hemminger
2020-07-15 21:22   ` [dpdk-dev] [PATCH v3 5/7] app/proc-info: dump rx and tx descriptor info Stephen Hemminger
2020-07-15 21:22   ` [dpdk-dev] [PATCH v3 6/7] app/proc-info: provide way to request info on owned ports Stephen Hemminger
2020-07-17 15:01     ` Thomas Monjalon
2020-07-21 17:05       ` Stephen Hemminger
2020-07-21 17:08         ` Thomas Monjalon
2020-07-21 17:37           ` Stephen Hemminger
2020-07-15 21:22   ` [dpdk-dev] [PATCH v3 7/7] app/proc-info: add crypto security context info Stephen Hemminger
2020-07-21 18:22 ` [dpdk-dev] [PATCH v4 0/8] app/proc-info enhancements Stephen Hemminger
2020-07-21 18:22   ` [dpdk-dev] [PATCH v4 1/8] app/proc-info: remove unused logtype #define Stephen Hemminger
2020-07-21 18:22   ` [dpdk-dev] [PATCH v4 2/8] app/proc-info: eliminate useless borders Stephen Hemminger
2020-07-21 18:22   ` [dpdk-dev] [PATCH v4 3/8] app/proc-info: hide EAL info messages Stephen Hemminger
2020-07-21 18:22   ` [dpdk-dev] [PATCH v4 4/8] app/proc-info: add more info to show_ports Stephen Hemminger
2020-07-28  7:22     ` Hemant Agrawal (OSS)
2020-07-21 18:22   ` [dpdk-dev] [PATCH v4 5/8] app/proc-info: enhance mempool to print ops name Stephen Hemminger
2020-07-21 18:22   ` [dpdk-dev] [PATCH v4 6/8] app/proc-info: dump rx and tx descriptor info Stephen Hemminger
2020-07-21 18:22   ` [dpdk-dev] [PATCH v4 7/8] app/proc-info: add crypto security context info Stephen Hemminger
2020-07-21 18:22   ` [dpdk-dev] [PATCH v4 8/8] app/proc-info: provide way to request info on owned ports Stephen Hemminger
2020-07-28  5:39     ` Hemant Agrawal (OSS)
2020-07-28  5:45       ` Stephen Hemminger
2020-07-28 19:13 ` [dpdk-dev] [PATCH v5 0/8] app/proc-info enhancements Stephen Hemminger
2020-07-28 19:13   ` [dpdk-dev] [PATCH v5 1/8] app/proc-info: remove unused logtype #define Stephen Hemminger
2020-07-28 19:13   ` [dpdk-dev] [PATCH v5 2/8] app/proc-info: eliminate useless borders Stephen Hemminger
2020-07-28 19:13   ` [dpdk-dev] [PATCH v5 3/8] app/proc-info: hide EAL info messages Stephen Hemminger
2020-07-28 19:13   ` [dpdk-dev] [PATCH v5 4/8] app/proc-info: add more info to show_ports Stephen Hemminger
2020-07-28 19:13   ` [dpdk-dev] [PATCH v5 5/8] app/proc-info: enhance mempool to print ops name Stephen Hemminger
2020-07-28 19:13   ` [dpdk-dev] [PATCH v5 6/8] app/proc-info: dump rx and tx descriptor info Stephen Hemminger
2020-07-28 19:13   ` Stephen Hemminger [this message]
2020-07-28 19:13   ` [dpdk-dev] [PATCH v5 8/8] app/proc-info: provide way to request info on owned ports Stephen Hemminger
2020-09-18 22:12   ` [dpdk-dev] [PATCH v5 0/8] app/proc-info enhancements Stephen Hemminger
2020-09-24  5:34   ` [dpdk-dev] [PATCH v6 0/7] app/proc-info: enhancements Stephen Hemminger
2020-09-24  5:34     ` [dpdk-dev] [PATCH v6 1/7] app/proc-info: remove unused logtype #define Stephen Hemminger
2020-09-24  5:34     ` [dpdk-dev] [PATCH v6 2/7] app/proc-info: eliminate useless borders Stephen Hemminger
2020-09-24  5:34     ` [dpdk-dev] [PATCH v6 3/7] app/proc-info: hide EAL info messages Stephen Hemminger
2020-09-24  5:34     ` [dpdk-dev] [PATCH v6 4/7] app/proc-info: add more info to show_ports Stephen Hemminger
2020-09-24  5:34     ` [dpdk-dev] [PATCH v6 5/7] app/proc-info: dump rx and tx descriptor info Stephen Hemminger
2020-09-24  5:34     ` [dpdk-dev] [PATCH v6 6/7] app/proc-info: add crypto security context info Stephen Hemminger
2020-09-24  5:34     ` [dpdk-dev] [PATCH v6 7/7] app/proc-info: provide way to request info on owned ports Stephen Hemminger
2020-10-19 22:39     ` [dpdk-dev] [PATCH v6 0/7] app/proc-info: enhancements Thomas Monjalon
2020-08-12  0:52 ` [dpdk-dev] [PATCH 0/7] proc-info enhancements Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200728191330.20864-8-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    --cc=hemant.agrawal@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).