From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <stable-bounces@dpdk.org>
Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124])
	by inbox.dpdk.org (Postfix) with ESMTP id 7566AA052A
	for <public@inbox.dpdk.org>; Tue, 26 Jan 2021 14:06:27 +0100 (CET)
Received: from [217.70.189.124] (localhost [127.0.0.1])
	by mails.dpdk.org (Postfix) with ESMTP id 526FE1414B7;
	Tue, 26 Jan 2021 14:06:27 +0100 (CET)
Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com
 [66.111.4.27]) by mails.dpdk.org (Postfix) with ESMTP id 0959F1414A6;
 Tue, 26 Jan 2021 14:06:23 +0100 (CET)
Received: from compute2.internal (compute2.nyi.internal [10.202.2.42])
 by mailout.nyi.internal (Postfix) with ESMTP id 5B6165C00BE;
 Tue, 26 Jan 2021 08:06:21 -0500 (EST)
Received: from mailfrontend1 ([10.202.2.162])
 by compute2.internal (MEProxy); Tue, 26 Jan 2021 08:06:21 -0500
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h=
 from:to:cc:subject:date:message-id:in-reply-to:references
 :mime-version:content-transfer-encoding; s=fm3; bh=ya0Yit6Mg1+t9
 5FMQ7lEg/7BqT8le0T09jO6e/O5LlE=; b=Cq2Am+2XOaTo+WM+0q8uMf/cWC/xI
 /Iya0PAZkIZvZH8Q7akj+cZxU5VqDADHz0UgP/x/JTgw5dEm/S+UphhRZlpPeYb3
 QJjcy3bXrw1w7V4Up4iTkO8s44b7EuRVPwSO3HH6XLASFDDGKK4ien5YscommlWn
 v9PSV42jGAmazSaLFHLpfclaZW0Y8ZArPs3rmdTkghdg1hzFdb6N05c0cynCl9bq
 urKuXCaLA/usuxX6VvbLD97wLUMFt9fvEhqnrMYJcvwtQS3vk1s15xs36dfwLC6i
 /gFoiyOV7c1xG4m/eRN3QQ5Ox0/oxuuaV56Lu/UrXsC9+2l5P7smBikXw==
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:date:from
 :in-reply-to:message-id:mime-version:references:subject:to
 :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=
 fm1; bh=ya0Yit6Mg1+t95FMQ7lEg/7BqT8le0T09jO6e/O5LlE=; b=FaWLCOSg
 iWQPNsx+RxQZcBGvfB/AZ9pI0gX7z3AW3Ord+5S+/rjyNP4UjUTXBIPkTtOdraMl
 z2Dx+zbVT25Ea9oLWT4K5kg+1hDIFgP5m3Lk0yT+cQtC4S8gR39PZJDP7/pRFYAK
 EpNF/0iRsysSbu5ECY6xAVABYoTmUy1IsGYQwNWvU9t8/zIv53CunmBuxc3V9E0v
 uFKrfzdtWj6pBf4cA2+afmf8plF24FCmo1EHu4PIHXQuic66s0oDVtfNLqAz3Tk7
 u+rNJMQIpEJR+AXxsD1asNglS1DCqKTijhemYUgZNkUABiEZMUSkN49vIiTL/Sat
 9ZWxfaZhxgSUDQ==
X-ME-Sender: <xms:zBMQYNcJxId43KH0j6WYYh0U4JQFKbG9Wl9cTbRgVwoW9fw04VfOLQ>
 <xme:zBMQYLN2ebv2WpwBEm-y-g0sZxK_vy7WzistnJydFZ4edzp9bZhHN971jBrVgnUls
 sHkqDhFFjVgrqmoHA>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdehgdegkecutefuodetggdotefrodftvf
 curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu
 uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc
 fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs
 ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf
 frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu
 tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih
 iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho
 nhdrnhgvth
X-ME-Proxy: <xmx:zBMQYGi0wJEBrrOmnW2SzzLMtnfpVeySVBLtfaYZzOGDQyVfX9rkxw>
 <xmx:zBMQYG-s5fUztpvrtst0oBN9T-YfO3X-ucNd5PQWXH6JnyUCol2sKw>
 <xmx:zBMQYJvpTYC0Gl3iV6LD7F-f-zkZ0qILUVLx3PTahqmJI41i1y-vuQ>
 <xmx:zRMQYBK0PajxJ3kGJaJ7220-Kb4i0kqXtxFTcOhHBuAUwIb_8niWcQ>
Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184])
 by mail.messagingengine.com (Postfix) with ESMTPA id 94EBB240064;
 Tue, 26 Jan 2021 08:06:19 -0500 (EST)
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: Hemant Agrawal <hemant.agrawal@nxp.com>, stable@dpdk.org,
 Maryam Tahhan <maryam.tahhan@intel.com>,
 Reshma Pattan <reshma.pattan@intel.com>,
 Stephen Hemminger <stephen@networkplumber.org>
Date: Tue, 26 Jan 2021 14:06:16 +0100
Message-Id: <20210126130616.3840205-1-thomas@monjalon.net>
X-Mailer: git-send-email 2.30.0
In-Reply-To: <20210120051711.19876-1-hemant.agrawal@nxp.com>
References: <20210120051711.19876-1-hemant.agrawal@nxp.com>
MIME-Version: 1.0
Content-Transfer-Encoding: 8bit
Subject: [dpdk-stable] [PATCH v3 1/1] app/procinfo: fix security context info
X-BeenThere: stable@dpdk.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: patches for DPDK stable branches <stable.dpdk.org>
List-Unsubscribe: <https://mails.dpdk.org/options/stable>,
 <mailto:stable-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://mails.dpdk.org/archives/stable/>
List-Post: <mailto:stable@dpdk.org>
List-Help: <mailto:stable-request@dpdk.org?subject=help>
List-Subscribe: <https://mails.dpdk.org/listinfo/stable>,
 <mailto:stable-request@dpdk.org?subject=subscribe>
Errors-To: stable-bounces@dpdk.org
Sender: "stable" <stable-bounces@dpdk.org>

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