Show a patch.

GET /api/patches/74593/
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 74593,
    "url": "https://patches.dpdk.org/api/patches/74593/",
    "web_url": "https://patches.dpdk.org/patch/74593/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk"
    },
    "msgid": "<20200721182242.5366-8-stephen@networkplumber.org>",
    "date": "2020-07-21T18:22:41",
    "name": "[v4,7/8] app/proc-info: add crypto security context info",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e3c44da20fdb98fcb1b4d1c59feef761f099368a",
    "submitter": {
        "id": 27,
        "url": "https://patches.dpdk.org/api/people/27/",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/patch/74593/mbox/",
    "series": [
        {
            "id": 11222,
            "url": "https://patches.dpdk.org/api/series/11222/",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=11222",
            "date": "2020-07-21T18:22:34",
            "name": "app/proc-info enhancements",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/11222/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/74593/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/74593/checks/",
    "tags": {},
    "headers": {
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "X-Gm-Message-State": "AOAM5326eU/yEV4zDZt4ocTMNb7l4DYj4mB2Xa9HivPIaosZ5ME2xZN/\n Kq8ISM+JedL8BBQozhNcTpAR+2yBBvQkIw==",
        "X-Google-Smtp-Source": "\n ABdhPJxKFy0GDdLJJaq0ry5lSTDFi77m7PPvW1iu2OAjKjYX7SS4+m26uUKhshaAXInefJW3aZcepQ==",
        "List-Post": "<mailto:dev@dpdk.org>",
        "MIME-Version": "1.0",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "X-BeenThere": "dev@dpdk.org",
        "References": "<20200506193741.24117-1-stephen@networkplumber.org>\n <20200721182242.5366-1-stephen@networkplumber.org>",
        "Subject": "[dpdk-dev] [PATCH v4 7/8] app/proc-info: add crypto security\n\tcontext info",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id C9651A0526;\n\tTue, 21 Jul 2020 20:23:56 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id BD23E1C0CD;\n\tTue, 21 Jul 2020 20:23:11 +0200 (CEST)",
            "from mail-pf1-f193.google.com (mail-pf1-f193.google.com\n [209.85.210.193]) by dpdk.org (Postfix) with ESMTP id 7B1541C0B2\n for <dev@dpdk.org>; Tue, 21 Jul 2020 20:23:03 +0200 (CEST)",
            "by mail-pf1-f193.google.com with SMTP id j20so11124540pfe.5\n for <dev@dpdk.org>; Tue, 21 Jul 2020 11:23:03 -0700 (PDT)",
            "from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n by smtp.gmail.com with ESMTPSA id 76sm21434031pfu.139.2020.07.21.11.23.00\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 21 Jul 2020 11:23:01 -0700 (PDT)"
        ],
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "X-Mailer": "git-send-email 2.27.0",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20161025;\n h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n :references:mime-version:content-transfer-encoding;\n bh=APxh6TEqjihvxLTreWgYh1aslJ6OO9srNzUtwxDnuNY=;\n b=czFxeTNDXkZgHBFU11AEk6lZ5ChYy9NiXwB9Uu4qFgsEy5L8QjqnI1oUhje9YluX13\n myLeSXOqt61mxiaeGdQOMHRkhVs3UxAm/cWABOrfJjbo9oLlup08LyqNHSu2qAb8phW3\n 7mW8glCf85Tv3flaw4sJc7xFPyOmXY7/dQtHebdJlR5n+YaovjaJL5GPlzbbix1fl40j\n HNeuakzH1kf81xq0lMSiD0jjv9nO/zWq7TjmtzJ8meryUFwY9d4+J+bUrhtweE+wOZ8v\n BuT7DzBepyohNlwOOm6YtDgfmx/fBB1ZB94SkVJLyhwkG0OKP/N+U9R7NyDAzecSu+R7\n 0jMQ==",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n h=from:to:cc:subject:date:message-id:in-reply-to:references\n :mime-version:content-transfer-encoding;\n bh=APxh6TEqjihvxLTreWgYh1aslJ6OO9srNzUtwxDnuNY=;\n b=S+xafrLpqlgMBr+utEcUBD3l8SNIZn5Nxp9eWdJH6khifDtWaq+crq4B1sWEMJTJld\n KVVg2MhdWY/nA65K9x7qs6nBw0QhRtMcOGzStQPi1X5eLVem8b1AdyEruDVEu3yU/Cgs\n e4RCKL+FhJM0OPCrBpoGV7Grv8uZrYKakPyiMj8bqLQFgd3h5IFNE5IOvTuqxRWvGqUi\n UBcASWViW0OpsTI9DVZFCndKRneR5fDD2DvhBVHk0NT65U00f3XA5ZXeWIebaQ7JACqf\n oH5cLbW4d9H2LCXXZkv3vu3+upsYyGOhEQKtnri3Wqokf692PrTZS0mEfcC1qictvAV9\n bzhA==",
        "Date": "Tue, 21 Jul 2020 11:22:41 -0700",
        "Content-Transfer-Encoding": "8bit",
        "X-Received": "by 2002:a65:6119:: with SMTP id z25mr24567219pgu.52.1595355782166;\n Tue, 21 Jul 2020 11:23:02 -0700 (PDT)",
        "To": "dev@dpdk.org",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "In-Reply-To": "<20200721182242.5366-1-stephen@networkplumber.org>",
        "Cc": "Hemant Agrawal <hemant.agrawal@nxp.com>,\n Stephen Hemminger <stephen@networkplumber.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<20200721182242.5366-8-stephen@networkplumber.org>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "From: Hemant Agrawal <hemant.agrawal@nxp.com>\n\nIf crypto context is not present, no point in displaying it.\n\nThis patch adds the crypto based security context info.\nAlso improve the flag printing to SECURITY OFFLOAD from\nINLINE.\n\nUse common code for displaying crypto context information\nwhen doing show_ports and show_crypto.\n\nSigned-off-by: Hemant Agrawal <hemant.agrawal@nxp.com>\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n app/proc-info/main.c | 80 +++++++++++++++++++++++++-------------------\n 1 file changed, 46 insertions(+), 34 deletions(-)",
    "diff": "diff --git a/app/proc-info/main.c b/app/proc-info/main.c\nindex 2ea554ab01f0..aa074dc7c429 100644\n--- a/app/proc-info/main.c\n+++ b/app/proc-info/main.c\n@@ -673,6 +673,32 @@ eth_tx_queue_available(uint16_t port_id, uint16_t queue_id, uint16_t n)\n \treturn count;\n }\n \n+static void\n+show_security_context(uint16_t portid)\n+{\n+\tvoid *p_ctx = rte_eth_dev_get_sec_ctx(portid);\n+\tconst struct rte_security_capability *s_cap;\n+\n+\tif (p_ctx == NULL)\n+\t\treturn;\n+\n+\tprintf(\"  - crypto context\\n\");\n+\tprintf(\"\\t  -- security context - %p\\n\", p_ctx);\n+\tprintf(\"\\t  -- size %u\\n\",\n+\t       rte_security_session_get_size(p_ctx));\n+\n+\ts_cap = rte_security_capabilities_get(p_ctx);\n+\tif (s_cap) {\n+\t\tprintf(\"\\t  -- action (0x%x), protocol (0x%x),\"\n+\t\t       \" offload flags (0x%x)\\n\",\n+\t\t       s_cap->action,\n+\t\t       s_cap->protocol,\n+\t\t       s_cap->ol_flags);\n+\t\tprintf(\"\\t  -- capabilities - oper type %x\\n\",\n+\t\t       s_cap->crypto_capabilities->op);\n+\t}\n+}\n+\n static void\n show_port(void)\n {\n@@ -840,26 +866,8 @@ show_port(void)\n \t\t\t}\n \t\t}\n \n-\t\tprintf(\"  - cyrpto context\\n\");\n #ifdef RTE_LIBRTE_SECURITY\n-\t\tvoid *p_ctx = rte_eth_dev_get_sec_ctx(i);\n-\t\tprintf(\"\\t  -- security context - %p\\n\", p_ctx);\n-\n-\t\tif (p_ctx) {\n-\t\t\tprintf(\"\\t  -- size %u\\n\",\n-\t\t\t\t\trte_security_session_get_size(p_ctx));\n-\t\t\tconst struct rte_security_capability *s_cap =\n-\t\t\t\trte_security_capabilities_get(p_ctx);\n-\t\t\tif (s_cap) {\n-\t\t\t\tprintf(\"\\t  -- action (0x%x), protocol (0x%x),\"\n-\t\t\t\t\t\t\" offload flags (0x%x)\\n\",\n-\t\t\t\t\t\ts_cap->action,\n-\t\t\t\t\t\ts_cap->protocol,\n-\t\t\t\t\t\ts_cap->ol_flags);\n-\t\t\t\tprintf(\"\\t  -- capabilities - oper type %x\\n\",\n-\t\t\t\t\t\ts_cap->crypto_capabilities->op);\n-\t\t\t}\n-\t\t}\n+\t\tshow_security_context(i);\n #endif\n \t}\n }\n@@ -1165,7 +1173,7 @@ display_crypto_feature_info(uint64_t x)\n \tprintf(\"\\t\\t  + AESNI: CPU (%c), HW (%c)\\n\",\n \t\t(x & RTE_CRYPTODEV_FF_CPU_AESNI) ? 'y' : 'n',\n \t\t(x & RTE_CRYPTODEV_FF_HW_ACCELERATED) ? 'y' : 'n');\n-\tprintf(\"\\t\\t  + INLINE (%c)\\n\",\n+\tprintf(\"\\t\\t  + SECURITY OFFLOAD (%c)\\n\",\n \t\t(x & RTE_CRYPTODEV_FF_SECURITY) ? 'y' : 'n');\n \tprintf(\"\\t\\t  + ARM: NEON (%c), CE (%c)\\n\",\n \t\t(x & RTE_CRYPTODEV_FF_CPU_NEON) ? 'y' : 'n',\n@@ -1199,14 +1207,14 @@ show_crypto(void)\n \n \t\tprintf(\"  - device (%u)\\n\", i);\n \t\tprintf(\"\\t  -- name (%s)\\n\"\n-\t\t\t\"\\t  -- driver (%s)\\n\"\n-\t\t\t\"\\t  -- id (%u) on socket (%d)\\n\"\n-\t\t\t\"\\t  -- queue pairs (%d)\\n\",\n-\t\t\trte_cryptodev_name_get(i),\n-\t\t\tdev_info.driver_name,\n-\t\t\tdev_info.driver_id,\n-\t\t\tdev_info.device->numa_node,\n-\t\t\trte_cryptodev_queue_pair_count(i));\n+\t\t       \"\\t  -- driver (%s)\\n\"\n+\t\t       \"\\t  -- id (%u) on socket (%d)\\n\"\n+\t\t       \"\\t  -- queue pairs (%d)\\n\",\n+\t\t       rte_cryptodev_name_get(i),\n+\t\t       dev_info.driver_name,\n+\t\t       dev_info.driver_id,\n+\t\t       dev_info.device->numa_node,\n+\t\t       rte_cryptodev_queue_pair_count(i));\n \n \t\tdisplay_crypto_feature_info(dev_info.feature_flags);\n \n@@ -1214,14 +1222,18 @@ show_crypto(void)\n \t\tif (rte_cryptodev_stats_get(i, &stats) == 0) {\n \t\t\tprintf(\"\\t  -- stats\\n\");\n \t\t\tprintf(\"\\t\\t  + enqueue count (%\"PRIu64\")\"\n-\t\t\t\t\" error (%\"PRIu64\")\\n\",\n-\t\t\t\tstats.enqueued_count,\n-\t\t\t\tstats.enqueue_err_count);\n+\t\t\t       \" error (%\"PRIu64\")\\n\",\n+\t\t\t       stats.enqueued_count,\n+\t\t\t       stats.enqueue_err_count);\n \t\t\tprintf(\"\\t\\t  + dequeue count (%\"PRIu64\")\"\n-\t\t\t\t\" error (%\"PRIu64\")\\n\",\n-\t\t\t\tstats.dequeued_count,\n-\t\t\t\tstats.dequeue_err_count);\n+\t\t\t       \" error (%\"PRIu64\")\\n\",\n+\t\t\t       stats.dequeued_count,\n+\t\t\t       stats.dequeue_err_count);\n \t\t}\n+\n+#ifdef RTE_LIBRTE_SECURITY\n+\t\tshow_security_context(i);\n+#endif\n \t}\n }\n \n",
    "prefixes": [
        "v4",
        "7/8"
    ]
}