From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 103ACA04B1; Thu, 24 Sep 2020 07:35:29 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B5B2F1DD66; Thu, 24 Sep 2020 07:34:56 +0200 (CEST) Received: from mail-pl1-f196.google.com (mail-pl1-f196.google.com [209.85.214.196]) by dpdk.org (Postfix) with ESMTP id 9FF121DD56 for ; Thu, 24 Sep 2020 07:34:49 +0200 (CEST) Received: by mail-pl1-f196.google.com with SMTP id bb1so1078471plb.2 for ; Wed, 23 Sep 2020 22:34:49 -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=fTElCX3vFG04xc93DAgMHACNuypYEu6nOBwSgv76rgk=; b=h+rlMwU54MZtH4GsLdGs5oNLPjemW9JtC+x5wss+3r94hpRRr6rpGBqg3k3fV5Ilkr TNDoaiw0EB7WY0xKJIhyh0KhklbxZlnniZmPfN4x9qt+7YU+sTMlR3jS4W1D+w4Zr2Nl BPPjJXjM0KSHC5ED9XBbdkmZZR+5gYvtAEbTrRNcrHf+8zolgSN5QyZzX3U/+wHH4k2e wZDRqHCvHtt7t4SFyqQrd0sqWsT0mieLMVfz/kgAtp9vSwkGejEwqo3/Fifq1x/HBG7b 3EcN4MKKB99XdCu1zukusPYihzQZ/e8W9w3BMK/NcDakaN1hIVsIBm/sr3Mw0zzdW3av 21RQ== 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=fTElCX3vFG04xc93DAgMHACNuypYEu6nOBwSgv76rgk=; b=KxN9lXhx4cq5dSOZIRbbUlfHkc5l5CnyZRIiK6MQcdKJMa3xUknCTR2en07SnhQ41V VqhR6fk+uKdYXOh/7gqt3qaJt+zqN3A48B/kWuTDfVEbldVyBkP0lHdrvSWnKvq/KPwS jd1axvLS0epCixZsM6VDnxInpoMPQAOn+Ss1nL2gk6mtu5ekFpyZhF2Z8xknaR3OUeqk bJISkYc/XAWwT8BihAJ++hGj09/4bHMQHeKUrHZ7xLOc+WE4k/wgGM9El6LzoEA1aBYB bOjfWTRCCNgKvp8yrhZR14wUjdxJUAIzT/FD8BT7KFbeemLZr4eCE+8vQavkNokBXgCv cTCg== X-Gm-Message-State: AOAM532Lp8jH+AEVMr7bFhFmctBdkf1u3zD7ql7MZ6UZ8b0k6xUI1JXy Idru951Dy5ThQ6tj8A8KzdLY5Lf4HvLhYA== X-Google-Smtp-Source: ABdhPJzAwu57iXQKT75hvHPOJuED+t/44g3IYinTfD0zG2ST844QCx0wqkkhNwcq3fzO1YslhKiXVg== X-Received: by 2002:a17:90b:138e:: with SMTP id hr14mr2323239pjb.161.1600925688429; Wed, 23 Sep 2020 22:34:48 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id v8sm1529609pgg.58.2020.09.23.22.34.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Sep 2020 22:34:47 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Hemant Agrawal , Stephen Hemminger Date: Wed, 23 Sep 2020 22:34:32 -0700 Message-Id: <20200924053433.12648-7-stephen@networkplumber.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200924053433.12648-1-stephen@networkplumber.org> References: <20200728191330.20864-1-stephen@networkplumber.org> <20200924053433.12648-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v6 6/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 c36f9f4d7471..e90e9aba080e 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -654,6 +654,32 @@ metrics_display(int port_id) rte_free(names); } +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_offloads(uint64_t offloads, const char *(show_offload)(uint64_t)) @@ -826,26 +852,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 } } @@ -1151,7 +1159,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', @@ -1185,14 +1193,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); @@ -1200,14 +1208,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 } } -- 2.27.0