From patchwork Tue Jul 21 18:22:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 246940 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp3166418ilg; Tue, 21 Jul 2020 11:23:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQIbUFqyjlxEEH/lFqr9p+1OqWHV604ZBmqfq5MV+nVmTyoRwLqBGlK/2k33m6mO5YNUZQ X-Received: by 2002:a5b:58e:: with SMTP id l14mr45299756ybp.352.1595355837826; Tue, 21 Jul 2020 11:23:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595355837; cv=none; d=google.com; s=arc-20160816; b=TFxno1ok/EE7O0i0NgmFKNPW3jpEJ0UnU26nfv33ij56m7CFFnQclPcNhzkthjWYyG LhP2fH8l/XRPK7xQsVWg2w9KhDC3qazagto1qt0X1qySJ4DqoDoyHAXaGPs+Xx/qYA0I 2G6ECVwazKoPbfUsDhs/426hHTcaWpkA2F1JWVgv5AFFcO82OiX8SbG5EZJpbXOIAhuz 2gow1xqEys3Q9jKLdXWQGM0ubDqgxyHRb/r03ivtJNQOImkZEON0EzK76qkZJTuYCMCD CUcJTRoIG8qCssK0CvJUfV1v5xxiE2dNq/KDE2VepLeKX4EqfeVnPXxP4h24mvlJCdht be0A== 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; bh=APxh6TEqjihvxLTreWgYh1aslJ6OO9srNzUtwxDnuNY=; b=j81YZnQwbso213lnwf8V51nkNNjcP+3BmfRChuNVP1RvHHfPCqbR22TTuh41eo+XJw aDlsD4QBKgBkWJ1dlzVjIkgnUemhMt0Toc7TwiEraeunS1+O51GxcEHitObs29t54+1T xYovUbcSEIMqvU18lIod5ILGvXC/dnBLIcJS8b1ee2+AdtXBzAsAWqGmlbMBkffm/L2e jXRPeNHf4YLAmI5RIox0FUTVKnKY9yWR9r330hUwpUIDu60iJ1xXQfw9sC8qDKLumgvT OBF/Ok3iMx8/jddmFLwRqj4up1aX9tpae5DEZ1mxYU6z+q5lNPTEf4+0bN9m13eE5Rok aE0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=S+xafrLp; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Return-Path: Received: from dpdk.org (dpdk.org. [92.243.14.124]) by mx.google.com with ESMTP id 203si19927786ybc.231.2020.07.21.11.23.57; Tue, 21 Jul 2020 11:23:57 -0700 (PDT) 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; dkim=fail header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=S+xafrLp; spf=pass (google.com: domain of dev-bounces@dpdk.org designates 92.243.14.124 as permitted sender) smtp.mailfrom=dev-bounces@dpdk.org Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id BD23E1C0CD; Tue, 21 Jul 2020 20:23:11 +0200 (CEST) Received: from mail-pf1-f193.google.com (mail-pf1-f193.google.com [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id 7B1541C0B2 for ; Tue, 21 Jul 2020 20:23:03 +0200 (CEST) Received: by mail-pf1-f193.google.com with SMTP id j20so11124540pfe.5 for ; Tue, 21 Jul 2020 11:23:03 -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=APxh6TEqjihvxLTreWgYh1aslJ6OO9srNzUtwxDnuNY=; b=S+xafrLpqlgMBr+utEcUBD3l8SNIZn5Nxp9eWdJH6khifDtWaq+crq4B1sWEMJTJld KVVg2MhdWY/nA65K9x7qs6nBw0QhRtMcOGzStQPi1X5eLVem8b1AdyEruDVEu3yU/Cgs e4RCKL+FhJM0OPCrBpoGV7Grv8uZrYKakPyiMj8bqLQFgd3h5IFNE5IOvTuqxRWvGqUi UBcASWViW0OpsTI9DVZFCndKRneR5fDD2DvhBVHk0NT65U00f3XA5ZXeWIebaQ7JACqf oH5cLbW4d9H2LCXXZkv3vu3+upsYyGOhEQKtnri3Wqokf692PrTZS0mEfcC1qictvAV9 bzhA== 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=APxh6TEqjihvxLTreWgYh1aslJ6OO9srNzUtwxDnuNY=; b=czFxeTNDXkZgHBFU11AEk6lZ5ChYy9NiXwB9Uu4qFgsEy5L8QjqnI1oUhje9YluX13 myLeSXOqt61mxiaeGdQOMHRkhVs3UxAm/cWABOrfJjbo9oLlup08LyqNHSu2qAb8phW3 7mW8glCf85Tv3flaw4sJc7xFPyOmXY7/dQtHebdJlR5n+YaovjaJL5GPlzbbix1fl40j HNeuakzH1kf81xq0lMSiD0jjv9nO/zWq7TjmtzJ8meryUFwY9d4+J+bUrhtweE+wOZ8v BuT7DzBepyohNlwOOm6YtDgfmx/fBB1ZB94SkVJLyhwkG0OKP/N+U9R7NyDAzecSu+R7 0jMQ== X-Gm-Message-State: AOAM5326eU/yEV4zDZt4ocTMNb7l4DYj4mB2Xa9HivPIaosZ5ME2xZN/ Kq8ISM+JedL8BBQozhNcTpAR+2yBBvQkIw== X-Received: by 2002:a65:6119:: with SMTP id z25mr24567219pgu.52.1595355782166; Tue, 21 Jul 2020 11:23:02 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id 76sm21434031pfu.139.2020.07.21.11.23.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 11:23:01 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Hemant Agrawal , Stephen Hemminger Date: Tue, 21 Jul 2020 11:22:41 -0700 Message-Id: <20200721182242.5366-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200721182242.5366-1-stephen@networkplumber.org> References: <20200506193741.24117-1-stephen@networkplumber.org> <20200721182242.5366-1-stephen@networkplumber.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v4 7/8] 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(-) -- 2.27.0 diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 2ea554ab01f0..aa074dc7c429 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -673,6 +673,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) { @@ -840,26 +866,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 } } @@ -1165,7 +1173,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', @@ -1199,14 +1207,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); @@ -1214,14 +1222,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 } }