From patchwork Wed Jan 20 05:17:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hemant Agrawal X-Patchwork-Id: 366956 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp143410jam; Tue, 19 Jan 2021 21:28:08 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8tnkrrsc3qpwNyfhbDXCc1GHfi2z0ptwyMHVMkrpBy+HuqMfzKItT6hH+gApnv9eD2ih1 X-Received: by 2002:a17:906:1c0f:: with SMTP id k15mr5039688ejg.157.1611120488825; Tue, 19 Jan 2021 21:28:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611120488; cv=none; d=google.com; s=arc-20160816; b=icidREdyuWTfIW7vBGIdIniL11hLl/u3ul7ue1NWqDsAcPuleDgDshXrQJq2iF2Kei UGekkremwoPqNDD9vkmALTplDp25HnMO5LNmeuP2AuHNZ5YZTIqQKxu8WArTvDVewemv mBwnLGv47dFFLfWsQ2QwgbkY5grGbfy9eNBDeMiHcIZ0zTN2rNUCHSPIFWnMq8gQ7bgo f8d/v+/IVKrR3+hY/5DBGuEx9PlZ5LuRZbBuvSt3/Cru6Pz9HNSegJI64JkbF//sYwKB 4fJgrgnb9HQ+Rw8G5phhBULI6VaeYt1jFIbaOpCAnJCpsSUhcPeUcdtFCJ4f2yRGIzHg 3HWQ== 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:references:in-reply-to :message-id:date:cc:to:from; bh=Mn7LwmdVqnyLwpPBoROz5EHzctbe93zxxYnkOcwunWE=; b=yP0LOYr7PSwDHvizaFAWOAWisE6mleHzKR1Fy0SyAGGnCjrPYsCO9qUxzoFtWbWI5U fvoMoWT17W7tSTdTHYMsib/5PezlGb4g8vUX/4+LDWXLn4e/U9TnAAUYAz1hGle992zn PnpSg+IivvW3FSBVFUPt49wbJSvetOnp8X8QeAR9OjYNQX2CyjxftpGESi+KFDtXw0Z5 jkETR2me2ATKrSdDra5/uh2beQgIjN5jlOjshw1jWhBFzECAhuCZjZfnmHOvWNvLAV2D FKiShUef1dSqgn+8id0ViEarSaL+PcQRUpA/eQqKsIQwe49OUVqASDwOALvjupJy2URV YVJA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.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 mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id i20si319576ejz.447.2021.01.19.21.28.08; Tue, 19 Jan 2021 21:28:08 -0800 (PST) Received-SPF: pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) client-ip=217.70.189.124; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CFBBC140DB4; Wed, 20 Jan 2021 06:28:07 +0100 (CET) Received: from inva020.nxp.com (inva020.nxp.com [92.121.34.13]) by mails.dpdk.org (Postfix) with ESMTP id 73302140DB2; Wed, 20 Jan 2021 06:28:06 +0100 (CET) Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 463051A056F; Wed, 20 Jan 2021 06:28:06 +0100 (CET) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 4E5321A13BD; Wed, 20 Jan 2021 06:28:04 +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 621194029B; Wed, 20 Jan 2021 06:28:01 +0100 (CET) From: Hemant Agrawal To: dev@dpdk.org, thomas@monjalon.net Cc: stable@dpdk.org, Hemant Agrawal Date: Wed, 20 Jan 2021 10:47:11 +0530 Message-Id: <20210120051711.19876-1-hemant.agrawal@nxp.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201224075133.15020-1-hemant.agrawal@nxp.com> References: <20201224075133.15020-1-hemant.agrawal@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP Subject: [dpdk-dev] [PATCH v2] app/proc-info: fix security context info X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 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..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 } }