From patchwork Wed Jul 15 21:22:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 74142 X-Patchwork-Delegate: thomas@monjalon.net Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 1783AA0548; Wed, 15 Jul 2020 23:23:43 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BD8831BEDC; Wed, 15 Jul 2020 23:22:51 +0200 (CEST) Received: from mail-pl1-f195.google.com (mail-pl1-f195.google.com [209.85.214.195]) by dpdk.org (Postfix) with ESMTP id B95B91BEB1 for ; Wed, 15 Jul 2020 23:22:47 +0200 (CEST) Received: by mail-pl1-f195.google.com with SMTP id k4so2910906pld.12 for ; Wed, 15 Jul 2020 14:22:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7qMco6owzSRRppoegkjBk6gyJ3foTnwTLT70++HgyZ0=; b=1pIqgUzU8w87HsWoGQ+Vp7AnFy/PQ9mxJubXqG3NcoibPqLOe5WEJe8cyJI/OJ/iye hO6N90XjyzOerjFLSyR9h816Mlw67m5/PFYAZntmS1vma6u+Q4cMSpJhEK47QpQXe6A9 bLfixftqMNKCvkeqaFteRWjRmCRrv+FsdF0m9eJ53VQ13I0mbhuOO9qIx0y9O/EwYUN4 jK0D6e3PEsOfVRl3adqDOs5tLSKDT+FR22TjeKJQ7UoTiF9zKsLbP3OZLGUk+e1Qi2B9 ZNuEuBVI7K6ewaE9QWqXBVWn08ov1ESCsEcgKzqaZzkhL+G0f+E0rmisZaNIevud0Qeo HoBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7qMco6owzSRRppoegkjBk6gyJ3foTnwTLT70++HgyZ0=; b=RetN67W1d6U0ksl1GiTqAwz+wVm1xSTl06jdtCsfN5R1bAZ9htDD4cEjPj7MDI/Lcu cjVgf7zRHPAR2yz3I7rtbhoe3zDQ5bWfPp4L70csWkOOHfx3hMydUaUlas3XGvitPro2 50Lp7Bet/aYqT2SkOLLz36ZHjT6USQNRL9vyyyevkC4z66LPgdbitDToFw9vp2zADaTr LntlTYe3qtwQxeGTiX8rhMy5ZlDIm99gE7fRMZPDishGyea/hA/ELcCwTfMRiLt4Qa8R 1okFoftRYi2Z5bgZ8Y0lsZasMoDWXzrXaLldCUP2ERvvElv/woDI5SWZV1gAxB9fx6Wo i+YQ== X-Gm-Message-State: AOAM531VREVIi1YNtbiJbNN2C+TgzXLGgatRFb+/yXWcypBaLJMU8OBh N4YjMfTnfCbyMcug8xocw/p7SQ== X-Google-Smtp-Source: ABdhPJzBTfxVQx6Jo54IbVBr7gmvPJz5kz0iwsWdZ/+JccZ+M9JJcmvaAGwRVRT2xXZuRfKBcDRbIA== X-Received: by 2002:a17:90a:368c:: with SMTP id t12mr1654868pjb.90.1594848166984; Wed, 15 Jul 2020 14:22:46 -0700 (PDT) Received: from hermes.corp.microsoft.com (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id s89sm2932600pjj.28.2020.07.15.14.22.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2020 14:22:46 -0700 (PDT) From: Stephen Hemminger To: maryam.tahhan@intel.com, reshma.pattan@intel.com, hemant.agrawal@nxp.com Cc: dev@dpdk.org, Stephen Hemminger Date: Wed, 15 Jul 2020 14:22:28 -0700 Message-Id: <20200715212228.28010-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200715212228.28010-1-stephen@networkplumber.org> References: <20200506193741.24117-1-stephen@networkplumber.org> <20200715212228.28010-1-stephen@networkplumber.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v3 7/7] app/proc-info: add crypto 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" From: Hemant Agrawal If crypto context is not present, no point in displaying it. This patch adds the crypto based security context info. Also improve the flag printing to SECURITY OFFLOAD from INLINE. Use common code for displaying crypto context information when doing show_ports and show_crypto. Signed-off-by: Hemant Agrawal Signed-off-by: Stephen Hemminger --- app/proc-info/main.c | 80 +++++++++++++++++++++++++------------------- 1 file changed, 46 insertions(+), 34 deletions(-) diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 14c04f8367f1..91205a51ad6b 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -674,6 +674,32 @@ eth_tx_queue_available(uint16_t port_id, uint16_t queue_id, uint16_t n) return count; } +static void +show_security_context(uint16_t portid) +{ + void *p_ctx = rte_eth_dev_get_sec_ctx(portid); + const struct rte_security_capability *s_cap; + + if (p_ctx == NULL) + return; + + printf(" - crypto context\n"); + printf("\t -- security context - %p\n", p_ctx); + printf("\t -- size %u\n", + rte_security_session_get_size(p_ctx)); + + s_cap = rte_security_capabilities_get(p_ctx); + if (s_cap) { + printf("\t -- action (0x%x), protocol (0x%x)," + " offload flags (0x%x)\n", + s_cap->action, + s_cap->protocol, + s_cap->ol_flags); + printf("\t -- capabilities - oper type %x\n", + s_cap->crypto_capabilities->op); + } +} + static void show_port(void) { @@ -853,26 +879,8 @@ show_port(void) } } - printf(" - cyrpto context\n"); #ifdef RTE_LIBRTE_SECURITY - void *p_ctx = rte_eth_dev_get_sec_ctx(i); - printf("\t -- security context - %p\n", p_ctx); - - if (p_ctx) { - printf("\t -- size %u\n", - rte_security_session_get_size(p_ctx)); - const struct rte_security_capability *s_cap = - rte_security_capabilities_get(p_ctx); - if (s_cap) { - printf("\t -- action (0x%x), protocol (0x%x)," - " offload flags (0x%x)\n", - s_cap->action, - s_cap->protocol, - s_cap->ol_flags); - printf("\t -- capabilities - oper type %x\n", - s_cap->crypto_capabilities->op); - } - } + show_security_context(i); #endif } } @@ -1178,7 +1186,7 @@ display_crypto_feature_info(uint64_t x) printf("\t\t + AESNI: CPU (%c), HW (%c)\n", (x & RTE_CRYPTODEV_FF_CPU_AESNI) ? 'y' : 'n', (x & RTE_CRYPTODEV_FF_HW_ACCELERATED) ? 'y' : 'n'); - printf("\t\t + INLINE (%c)\n", + printf("\t\t + SECURITY OFFLOAD (%c)\n", (x & RTE_CRYPTODEV_FF_SECURITY) ? 'y' : 'n'); printf("\t\t + ARM: NEON (%c), CE (%c)\n", (x & RTE_CRYPTODEV_FF_CPU_NEON) ? 'y' : 'n', @@ -1212,14 +1220,14 @@ show_crypto(void) printf(" - device (%u)\n", i); printf("\t -- name (%s)\n" - "\t -- driver (%s)\n" - "\t -- id (%u) on socket (%d)\n" - "\t -- queue pairs (%d)\n", - rte_cryptodev_name_get(i), - dev_info.driver_name, - dev_info.driver_id, - dev_info.device->numa_node, - rte_cryptodev_queue_pair_count(i)); + "\t -- driver (%s)\n" + "\t -- id (%u) on socket (%d)\n" + "\t -- queue pairs (%d)\n", + rte_cryptodev_name_get(i), + dev_info.driver_name, + dev_info.driver_id, + dev_info.device->numa_node, + rte_cryptodev_queue_pair_count(i)); display_crypto_feature_info(dev_info.feature_flags); @@ -1227,14 +1235,18 @@ show_crypto(void) if (rte_cryptodev_stats_get(i, &stats) == 0) { printf("\t -- stats\n"); printf("\t\t + enqueue count (%"PRIu64")" - " error (%"PRIu64")\n", - stats.enqueued_count, - stats.enqueue_err_count); + " error (%"PRIu64")\n", + stats.enqueued_count, + stats.enqueue_err_count); printf("\t\t + dequeue count (%"PRIu64")" - " error (%"PRIu64")\n", - stats.dequeued_count, - stats.dequeue_err_count); + " error (%"PRIu64")\n", + stats.dequeued_count, + stats.dequeue_err_count); } + +#ifdef RTE_LIBRTE_SECURITY + show_security_context(i); +#endif } }