From patchwork Tue Jul 28 19:13:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 247227 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp800461ilg; Tue, 28 Jul 2020 12:14:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwj/2dtSoHwm/WD5FISiHB4X+zVBpFWfck5H+GFnoCg6UrSMBrmzLKw9Lo/O4Jjh5VeS4RO X-Received: by 2002:a25:bd87:: with SMTP id f7mr21014744ybh.329.1595963667772; Tue, 28 Jul 2020 12:14:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595963667; cv=none; d=google.com; s=arc-20160816; b=Sq7dARu5RoXcwOFcWMQ+P9E9VC1KHNoPF2aDYO+dB45o5HFcIK4EIuqVSEnGznBsaa 571wAglptX6mXb/ck7bj6wmTUzSjQ5oKMkk86lirVxuwDQbFjZbvb1pgyEgBEn0ta49t yjeuuKm7c9bnJSgcKChvDgr5zCTbM3KxvpbnOdpxoAiiDGh+jfO79lnOJE60YSzPNLR1 nkQHCGcxFmryypqNXSNaor0AEcH/b3217dv32I0YcBGDldUq9HU1Ny8Ygs8vVDBQ+FP9 UsXlm32z+uA0ZxI0kRMZluGhbuTylbtdZd19rkS+bPHia/l1mNQywJGfOR9i7aokqZhX 73QA== 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=9a1Muj0yhg5qN2YZyeRJeEfa7ViIacgWiKYyExxeKOY=; b=BU3CXYoeoct2V7GdVmn118XWSry+mCMyzmjp4F2CZ+MmnouBc6ePwz4FanRMXqhcl7 cKK/tV7WYYNElEaKlxLW4nvaNMeRD0/Lw1I8SbU9TQlXhaNBW6lJV9K1YXgDlC8gg+rc 7gTrcI/xGkM6WbwxRgGurQHhFAdbqP4X8vFEZIrT4bxtHcYgRce0jobcDmkCr7LyQkPv dBL155lsA2Lxtx9JSHcoQP/1iq+19D9eCPhQy/jxXZ06YHK7i71NrqQurOeYWp0tP1eG FLoADtgV4iuzdb+64qXmxJhPhaTDdQWZ00lARZXJfFAecfoo4YNTMwN+OTCjEq1JrArv V8xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=HmXyD6C2; 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 u3si13479839ybu.150.2020.07.28.12.14.27; Tue, 28 Jul 2020 12:14:27 -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=HmXyD6C2; 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 782C71C0B6; Tue, 28 Jul 2020 21:13:54 +0200 (CEST) Received: from mail-pg1-f193.google.com (mail-pg1-f193.google.com [209.85.215.193]) by dpdk.org (Postfix) with ESMTP id 7A6661C027 for ; Tue, 28 Jul 2020 21:13:49 +0200 (CEST) Received: by mail-pg1-f193.google.com with SMTP id l63so12573081pge.12 for ; Tue, 28 Jul 2020 12:13: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=9a1Muj0yhg5qN2YZyeRJeEfa7ViIacgWiKYyExxeKOY=; b=HmXyD6C2EtI228lvC2Y6hwA8P4XHhMAjYx759sTKUJxxcBZQnehCa8e/AnLN1yEUw5 d7v3c1p6fjNQNwnAINhXPGWAl23W0NzAcam+WOhdCgaGPqpj9ISsYoypl/8RDLCCERrq t1dH0v8f1WdQj8CT6vPhHjvsixr8c5yUT+SGTemvzW9xE+YmVWv5R5rOdagNkRLeXEVS qRQgRQY1womKA/rxwd+p4SyTJripmDoobkOm7Ym8wbK/gjwlQI3kt9piK+ZdLGH+4xyS XNu/HCSF3vZ3KrDsT4TSuHnLII+8i+9RiZBbWbO29gYLDQx+Li54H/S5HgPhYfxFJaLZ 0edw== 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=9a1Muj0yhg5qN2YZyeRJeEfa7ViIacgWiKYyExxeKOY=; b=qZpxsck3tSUmPFXLuEhpEjlQCozEzxOM4Rru/UIjWa/7B12JwDxu4tfOGLrjmcwNux n+Bu/1d9PPMircnjEMAx2+0YPqf9lNupvIKJpHB51XUMYcmXkUMGb6ssFvjiC6HYIdJA ZUwv/VG1q6k7xqhs7BsLA1rSRcbqLqrFfBk9DwsY3/qsNCmktvhVVyFXo0Z6wk4wbhyi 8RJC4FCL4iG/ZL8ViYitPoJssWv8om4khPSFT0YCqDPINnnLV43XjiVVZ64+jkjm0BmV VW4EcEtEQkKFLgYPUnKIpmfZJBHqiUhsN+LVwrsglBK1KZohyWv5aYLTj+G/kXZO9xcs YC6Q== X-Gm-Message-State: AOAM533DaS+dCuxDprGIFdASi6QbvA/NTXaSBAIo65uGhISGuxsPCIbw WUjAJ9/EYgFE4NtboYpOvQ9bCkW9phtTLQ== X-Received: by 2002:a05:6a00:2283:: with SMTP id f3mr25642506pfe.89.1595963628298; Tue, 28 Jul 2020 12:13:48 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id x66sm19045748pgb.12.2020.07.28.12.13.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2020 12:13:47 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Hemant Agrawal , Stephen Hemminger Date: Tue, 28 Jul 2020 12:13:27 -0700 Message-Id: <20200728191330.20864-6-stephen@networkplumber.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200728191330.20864-1-stephen@networkplumber.org> References: <20200506193741.24117-1-stephen@networkplumber.org> <20200728191330.20864-1-stephen@networkplumber.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 5/8] app/proc-info: enhance mempool to print ops name 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 Enhance the mempool details to also print the ops index and name Signed-off-by: Hemant Agrawal Signed-off-by: Stephen Hemminger --- app/proc-info/main.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.27.0 diff --git a/app/proc-info/main.c b/app/proc-info/main.c index 28838be882b9..b2011c448577 100644 --- a/app/proc-info/main.c +++ b/app/proc-info/main.c @@ -1219,7 +1219,10 @@ show_mempool(char *name) if (name != NULL) { struct rte_mempool *ptr = rte_mempool_lookup(name); if (ptr != NULL) { + struct rte_mempool_ops *ops; + flags = ptr->flags; + ops = rte_mempool_get_ops(ptr->ops_index); printf(" - Name: %s on socket %d\n" " - flags:\n" "\t -- No spread (%c)\n" @@ -1249,6 +1252,8 @@ show_mempool(char *name) printf(" - Count: avail (%u), in use (%u)\n", rte_mempool_avail_count(ptr), rte_mempool_in_use_count(ptr)); + printf(" - ops_index %d ops_name %s\n", + ptr->ops_index, ops ? ops->name : "NA"); return; } From patchwork Thu Sep 24 05:34:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 313446 Delivered-To: patch@linaro.org Received: by 2002:a92:5ad1:0:0:0:0:0 with SMTP id b78csp1063361ilg; Wed, 23 Sep 2020 22:35:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8p7mM4ho1qmOGwrPWoyj77qag38JR+xye+lCZmrz6j0iBCUxwYYTOnOOjvKOeiUWHSQ4V X-Received: by 2002:a17:906:eced:: with SMTP id qt13mr2824071ejb.357.1600925729405; Wed, 23 Sep 2020 22:35:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600925729; cv=none; d=google.com; s=arc-20160816; b=QYteVENAgdgdSRwz6cEKgdwgETJjfD7Sw06q14qTFbiezkINw4OudCsg+EU1P99KFd JIzZjUMDzNM21JKYORJdLd0oijnd4ftRrIq4Cd9tF6unls4JpocOLrfIDA7c28/LXtBY JC0hEdOF2SFEBeWWVapuT1H0xwNdb3FmXDRCpdI1suoHoJxAcq8vcZ7lo8Q6AFkWOI+b oJoyPABMvp4V0g3cAOJPqgEW6Acd2kMdCrkHTqC/GPumAygqSYyrktzYCWGw/l1wOXhe LzFlTloD6wPWGklRucvwCytxfWVtsHK21r1FADUwL4489oNZO9L1qzRi1BMLAwvwTY5u QsBA== 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=fTElCX3vFG04xc93DAgMHACNuypYEu6nOBwSgv76rgk=; b=ASTBXIMmMwCOWxif2I2najFf0duxcb1L6O6/n6FIKTsqYq2X4en3oXRY6Jj00Lj0OY x3DzBZoO1YmQRLh7uvUFwCHBi+h8anBqHF+SDO3R4gQO/4XbSR4k6DqWjq+9aNM9tNS9 YjDvXPcBuNCgAUZ6wB4HPrXZCld8fBpijS4128fSBigWNziyY62u3ToqQAzbLFgqoEbI gKxTtPKZDLXR2jDCDjWNEY9Dw+yuj9tY4LKYipwq5MEdgHE4p2Ck1N5W7zO0SBRopj9i xgrJQVE0JKFK8p6gfgnTrdZkC1U/R01za9ekqK1+M6/KGnNOqQ2U44mq7DK6cNM9u02N mMVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=h+rlMwU5; 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 l11si1297912ejd.105.2020.09.23.22.35.29; Wed, 23 Sep 2020 22:35:29 -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=h+rlMwU5; 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 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-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 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(-) -- 2.27.0 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 } } From patchwork Tue Jul 28 19:13:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Hemminger X-Patchwork-Id: 247228 Delivered-To: patch@linaro.org Received: by 2002:a92:d244:0:0:0:0:0 with SMTP id v4csp800694ilg; Tue, 28 Jul 2020 12:14:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwoVFrReVPSIL2rSNxtuhAxsuokKAfb1HwIbrm541VPuJ6KBMQAOmI249LGFQsv71f7gVGs X-Received: by 2002:a17:906:a1c7:: with SMTP id bx7mr26266350ejb.388.1595963688528; Tue, 28 Jul 2020 12:14:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595963688; cv=none; d=google.com; s=arc-20160816; b=hyYS/NrlPR9/XvXC4Nuad5g6OI8CfoELGqZZv7oEmWlPMlpmVTk8uGqUOBSrDOxXpW VENC/UhZAl1jcrX13y0fjDTMbmunmhaXvSxiEajMb2caaIV7TUULwIAf6ypitzGDb8F6 XsjyT0xoEhGeAo054oqt7kw9ZPSiBi8bb3AlZAazODsTufV0d/HdZKRkwagEQrxW82DV PGxuZduP4D9zKwdzuBQXj6QpkfQWwdtHsa4vbaMbNon2U/gNtvqbKRHOezaAAPftgUK6 vDIBi9az4myoqVeRKMNQQVftlVtkQ39T0h3kiX57Q39Mh27nS2GVjsw23EQ4ZyXQFVJt m/Mg== 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=eZjTWwbqvqVSSxQh00ui5CqRv4SW9nnllNk3zygOnFI=; b=rHkgnG3vzFZGx9LjSMaEQiaZ8ubE40M1zvG/cLawXks7nEA27Rzu4FieRD0gPzWUpW erb8sBz2NmXGxwqW0uQYjsTBm4yZqO78VW+nJcfqU/omuzesszJhIaWzDK3q6iW6WCVE kkLKojUVkzpaiR/4bfLOcP8KUtkIbEypaxgqdwiJ0mqrAzWqhgjLeled9XMrWvwKX38J mdgGXLycPdBwTBTO8G5in5JEQYTChpeLftLNDnK1XZLiI3YS71Z9ulh3EWpPRWGiSfuP zH1lLDTrZPbQF6JV9ts5lVaWNMYBEqZUlfzA+PnqKBlLEdCNT/kVN7B0SXdWsBDCpHXI I4Ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@networkplumber-org.20150623.gappssmtp.com header.s=20150623 header.b=d1wxHGzl; 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 u27si7648461ejj.716.2020.07.28.12.14.48; Tue, 28 Jul 2020 12:14:48 -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=d1wxHGzl; 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 B53C71C0C6; Tue, 28 Jul 2020 21:14:01 +0200 (CEST) Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by dpdk.org (Postfix) with ESMTP id E700E1C043 for ; Tue, 28 Jul 2020 21:13:52 +0200 (CEST) Received: by mail-pj1-f68.google.com with SMTP id gc9so405990pjb.2 for ; Tue, 28 Jul 2020 12:13:52 -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=eZjTWwbqvqVSSxQh00ui5CqRv4SW9nnllNk3zygOnFI=; b=d1wxHGzlPRDfepVwK+wyIrpWHEKiL8BiqhAI9SdedxYzo+xYFkwle8PcKDWCMHVZQF XbBcUhHASmtU2NOzaMhB5XdoIISUMZjcMSXsFWMg7Fy5OVnVSBAGBL1aEjacFGJorTo5 MBUfj8KL+x0uxtsaMp8cisb6tGWnlAWc+IkLI7TTITzcDyLXp8UI6wrI9WRPlAFpWs5k ufr+r5mvG/iLEaY4RuhAC66AUaERJIT6dlQWEgJdB4v99RtaojHB5KxVIfzTQJ8Zrzqo k6/HJtLSetmY+RzNJmKdpqY5jdAgso7RCbO9Q/OrOtlOZA/66f7aYuKwxbKwuDMgchKG lqMg== 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=eZjTWwbqvqVSSxQh00ui5CqRv4SW9nnllNk3zygOnFI=; b=Hl8+dI2jkr9gnYdNBJt+xGBu4SLWfkkwxCNo3OLvtpxvhnaE9fzWLo0xQ2GH+glDgN BOtTn7rdF+lGE4wtu5uGU8GQvLYD+XUtNxGMgXrofFiAlvLph7OC9FPz52Dx9IocxQeF KGEGAE279Fklw76Jg95JamoJmPO5gdtef250P7wlOBpLBGM6XP3tLPhTLR9BQ6Ri2jSr f0zzUgrEdRdc/ZAQDEajh80NsPhD3esd/q2CFRa8/LCgEMNKKbMITU119/Po1RJAnfCR q4jqpZRZzsfAnOZHlDRRVyEqUDV2b7VKafQFFGyRe2x81TfhSrsSvGOjVPIbU070/QLp UkZQ== X-Gm-Message-State: AOAM533q1cCCo0ikcuKiR2mOMXi4xjSkSP4OjH+PhhlQ0mUFPvMZoj4D HJmseihieJ0BIhblX80GiWtWSE6CrrEURw== X-Received: by 2002:a17:902:7689:: with SMTP id m9mr24101276pll.240.1595963631642; Tue, 28 Jul 2020 12:13:51 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id x66sm19045748pgb.12.2020.07.28.12.13.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Jul 2020 12:13:50 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Hemant Agrawal , Stephen Hemminger Date: Tue, 28 Jul 2020 12:13:29 -0700 Message-Id: <20200728191330.20864-8-stephen@networkplumber.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200728191330.20864-1-stephen@networkplumber.org> References: <20200506193741.24117-1-stephen@networkplumber.org> <20200728191330.20864-1-stephen@networkplumber.org> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v5 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 4e2e647498ff..282af670d20a 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) { @@ -841,26 +867,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 } } @@ -1166,7 +1174,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', @@ -1200,14 +1208,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); @@ -1215,14 +1223,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 } }