From patchwork Thu Dec 24 07:51:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 351880 Delivered-To: patch@linaro.org Received: by 2002:a02:85a7:0:0:0:0:0 with SMTP id d36csp6827865jai; Thu, 24 Dec 2020 00:01:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJxw7o4IlIiKMxvq23Nvx1JwUatz/797pgGx9oYn2at1RVnzSa1xP17JjaxczFpy7x+ABc8s X-Received: by 2002:a17:906:780c:: with SMTP id u12mr1498356ejm.125.1608796904702; Thu, 24 Dec 2020 00:01:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608796904; cv=none; d=google.com; s=arc-20160816; b=GMfVhk3m22lztuEeULSJBk2whOXPpdyW44r4I+naLeJqy2DbURLavgA5qbYNbwGl3I 9DeSgvHw05wDvkK8G1/WpJDp9aCQ2/jQo9oI4PyejPEeesf3XliAjv9u6SsbQsHZg533 wu9J3Wtnx1uBDwYHKgfNKG9oeLPHzX9weLYT5ryUnrB9UAVCf3inkHN21RHGMMmzxuhH FGsOo4uTG/bmp1fGS3mfTQFQN//TQNYV4JuxHnVZ+sVn1XNc0wvrhmACJaprRSLEeiJy a444XxoU+ND4yUT6g4VY75U8z/4qlbYZWEPue0ekufVwkSogtMcuitGdgsfmbBv7izlf himA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:message-id:date:cc:to :from; bh=bcPBh44c/Vl+Aw7f8nxa0HEJAa0EBFPD6GOHnZD/NSA=; b=dWAt0tdeFENQFCaRZIrHNyGARqLsxe7Q3ijAPPALhPofaxaTQ6WleT1LCWk6aD40Te bZg3n/dxMF9mNVpa1Kolr/XhrtLXhv1BYDnR1xaFSUo3rqgwjLbmAHEntEAfG5eGGqh+ wr27dkn3k/YyTz7ZMb62cryAUv/nXQ1Hw9YS+iHaAM2ML59Q7KLc46iJp3U7ngR8WRh0 p+iqXcyinw56Wh9JW/n0O1iiixo26FpEle4HWkM7ZPThVDkB/tcmxUt9lNp/3BD9YMxU q4/zLoDoHR3PgluMqAWklmKUFv65XfJ1hgUFJhb2V2WcJrirQS/jgUIVQlFrIvoEydcz J2TQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id z23si16536667edl.270.2020.12.24.00.01.44; Thu, 24 Dec 2020 00:01:44 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) client-ip=92.243.14.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com 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(-) -- 2.17.1 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 } }