From patchwork Tue Jan 26 13:06:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Monjalon X-Patchwork-Id: 370626 Delivered-To: patch@linaro.org Received: by 2002:a02:a60d:0:0:0:0:0 with SMTP id c13csp4957867jam; Tue, 26 Jan 2021 05:06:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJxxC2QqUrJm4KCykrnXqAMzVCB6md/HwvAfYrOcCJropVnlWtNQvfOSW6xsjG4jq804oaJN X-Received: by 2002:a05:6402:11c7:: with SMTP id j7mr4468072edw.290.1611666385842; Tue, 26 Jan 2021 05:06:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611666385; cv=none; d=google.com; s=arc-20160816; b=io3VZwGiU5aF6h6ok79BvrNPK9a+XuAjp2K+kXTV6phWt6EFt6OlLcAP0gHFZDwA1B 0KY2TyE5eEN8FcHWwd3CG3MlBQkK1m+r+0SgJ1BATGUW7A2oJVTtA4DevTAYKcGnhW8P PnVy1pT09rKImv6NJLd/wLqmGfKTVL75i1V83fTTmwZod+Xd/0KJXTm16+d+qzT5LjUB odyv6eQYgbeOYB1KxMtlFk6N0GwwOVBcu0tC6OoH8LcQpvjkfhUuRJG216PqtG60S07w 5b7hP+6Z5bb5GVL0rdCjULBLYDyhPPODfE8OfNP50GqT28RKQLmmXzFvkHJYzbPXzjYS X8LQ== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:cc:to:from:dkim-signature:dkim-signature; bh=ya0Yit6Mg1+t95FMQ7lEg/7BqT8le0T09jO6e/O5LlE=; b=b6wiWsvWvJHliix7rSLiaLve+tRNPKsXnM3ivWlc88AZCBJfoRTLJP4zAuWTqQsmMp 3ogGcvotobRisOqK7RwRlJtMn2zo0weQrKHmWqT/2sMCEUmKwPVzN4CO7IV9Bl7QAsf8 5Z+CvnzK8Ukme/g0R9o4hGjWaehwAWhib1/7cuhvjOMnr8Qrvo8ne2y8yM595ZeIY6vx 54+aAKKyxUhVSW8gSYmUhCgNwE7KM2WW4EwwfkuXBRwfXx8lj9hXfLcuEdIix3RDW5aa il6kCvBkoSKiyoTvn0zQFam6C1BjVfNcf1rg9xyumhCia8eGJwUk/c+c3UbqtIkDUDV9 7HyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@monjalon.net header.s=fm3 header.b=Cq2Am+2X; dkim=fail header.i=@messagingengine.com header.s=fm1 header.b=FaWLCOSg; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Return-Path: Received: from mails.dpdk.org (mails.dpdk.org. [217.70.189.124]) by mx.google.com with ESMTP id t9si8296995edd.589.2021.01.26.05.06.25; Tue, 26 Jan 2021 05:06:25 -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; dkim=fail header.i=@monjalon.net header.s=fm3 header.b=Cq2Am+2X; dkim=fail header.i=@messagingengine.com header.s=fm1 header.b=FaWLCOSg; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 217.70.189.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1FA441414B1; Tue, 26 Jan 2021 14:06:25 +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: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdehgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtf frrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedtgfeu tdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgrlhho nhdrnhgvth X-ME-Proxy: 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 To: dev@dpdk.org Cc: Hemant Agrawal , stable@dpdk.org, Maryam Tahhan , Reshma Pattan , Stephen Hemminger 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 Subject: [dpdk-dev] [PATCH v3 1/1] app/procinfo: 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" From: Hemant Agrawal 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 Signed-off-by: Thomas Monjalon --- 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(-) -- 2.30.0 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 #include #include +#include #include #include #include @@ -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 } }