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 5F67BA09FF; Thu, 24 Dec 2020 09:01:40 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 430ABCA10; Thu, 24 Dec 2020 09:01:38 +0100 (CET) Received: from inva021.nxp.com (inva021.nxp.com [92.121.34.21]) by dpdk.org (Postfix) with ESMTP id CA394CA00; Thu, 24 Dec 2020 09:01:35 +0100 (CET) Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id A0B832005A1; Thu, 24 Dec 2020 09:01:34 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id ABA3C2003B7; Thu, 24 Dec 2020 09:01:32 +0100 (CET) Received: from bf-netperf1.ap.freescale.net (bf-netperf1.ap.freescale.net [10.232.133.63]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id B3928402D5; Thu, 24 Dec 2020 09:01:29 +0100 (CET) From: Hemant Agrawal To: dev@dpdk.org Cc: stable@dpdk.org, Hemant Agrawal Date: Thu, 24 Dec 2020 13:21:33 +0530 Message-Id: <20201224075133.15020-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH] app/proc-info: fix security context info 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" 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 --- 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