Show a patch.

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

{
    "id": 74592,
    "url": "https://patches.dpdk.org/api/patches/74592/?format=api",
    "web_url": "https://patches.dpdk.org/patch/74592/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "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-7-stephen@networkplumber.org>",
    "date": "2020-07-21T18:22:40",
    "name": "[v4,6/8] app/proc-info: dump rx and tx descriptor info",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "4a02becc06b84ad1cadd11e36a5ebb4764ff984c",
    "submitter": {
        "id": 27,
        "url": "https://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/patch/74592/mbox/",
    "series": [
        {
            "id": 11222,
            "url": "https://patches.dpdk.org/api/series/11222/?format=api",
            "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/74592/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/74592/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "References": "<20200506193741.24117-1-stephen@networkplumber.org>\n <20200721182242.5366-1-stephen@networkplumber.org>",
        "X-Mailman-Version": "2.1.15",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "X-BeenThere": "dev@dpdk.org",
        "Message-Id": "<20200721182242.5366-7-stephen@networkplumber.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "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=MS29TzAnF/7DvK6A99faG+GGupmWaNY81pGDtnmH55I=;\n b=cKjkIzMePmM9AcJasbHcwmEaXv0Ew/MtflO3Dft4ZqTXswyEljsGeKW7dJM6PeuQuK\n yk2OjDhS7Pd+Y2Ac4jfF/CTOf9ofN57HnD3VZBBf1hX73SfqFbiLQoK5Yzv7UCbzcOlP\n o6cdZlBreQ4SCtEP+3XJltVbPVFdYsfmSzZXX9ZAvBcjxTI1xUPhfT8szVyDq5ejhGDs\n ZQAz/XGD33nphcHQOs+9BgMl3pXnlVwhCRB/Iqz7RVrrTZbxS6DhkOvJEkFp0i1sMb/w\n CcZv0xitQY9KyoBhKP9S5qbdmmC/uJicUv3kRbh9bevo5wXrXJN3wMZdjGVszljiQvfR\n wWCw==",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 613C5A0526;\n\tTue, 21 Jul 2020 20:23:46 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 47F0B1C0CA;\n\tTue, 21 Jul 2020 20:23:06 +0200 (CEST)",
            "from mail-pj1-f68.google.com (mail-pj1-f68.google.com\n [209.85.216.68]) by dpdk.org (Postfix) with ESMTP id EF5F51C0AC\n for <dev@dpdk.org>; Tue, 21 Jul 2020 20:23:01 +0200 (CEST)",
            "by mail-pj1-f68.google.com with SMTP id t15so2073266pjq.5\n for <dev@dpdk.org>; Tue, 21 Jul 2020 11:23:01 -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.22.59\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 21 Jul 2020 11:22:59 -0700 (PDT)"
        ],
        "X-Mailer": "git-send-email 2.27.0",
        "X-Received": "by 2002:a17:90a:20e9:: with SMTP id\n f96mr6189859pjg.13.1595355780635;\n Tue, 21 Jul 2020 11:23:00 -0700 (PDT)",
        "Subject": "[dpdk-dev] [PATCH v4 6/8] app/proc-info: dump rx and tx descriptor\n\tinfo",
        "Precedence": "list",
        "X-Gm-Message-State": "AOAM530xpeLjybUlv4fuiHlHE2BQMwYI3eXrIfaTYiYts38qDUKVos4h\n fDxQUhf1sFjYsxrmp8cN6HRRBm+Kh7+VZw==",
        "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=MS29TzAnF/7DvK6A99faG+GGupmWaNY81pGDtnmH55I=;\n b=yChB63YSyvdybRYlPK0ao2X9PqyST6NwSGpFHhDWFEtmOAUqM75jBbtCy3yE36xZhT\n gftv52zSMSsx6gB6RL2ZvGmGD/Hrmg2h8vqsGMyoU5Y+8bwvRwwfRGnwoqRxKoDmMbGZ\n sXglTlfHv17mKYfaQ7IuH8t5cPxmi9mzh9uLczT1s6KwnAavEfwf12PQLq7o/sq4x+MY\n D5vpteG0o7wlpMRqURVFJ1rNDNZVWJExYcbObxUeRE+qDo5RDif5xvgpt247D06KxWDP\n 8WxkBPRNHicsf4kwKXF5LYkFuN8Jkb7o5IqfNaXmgO4xCvyRnxSNeIuoGZl6XLYpEAB5\n 8+YQ==",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Date": "Tue, 21 Jul 2020 11:22:40 -0700",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "Errors-To": "dev-bounces@dpdk.org",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-Google-Smtp-Source": "\n ABdhPJyaw/Lv+tJz8yAo+b0YkmOlRv4/AYFoO9LJH5Gz/c9YEYfjhOyUtl3g38Bdrmh4dPUZEZBTpQ==",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n Hemant Agrawal <hemant.agrawal@nxp.com>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "In-Reply-To": "<20200721182242.5366-1-stephen@networkplumber.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "To": "dev@dpdk.org"
    },
    "content": "Many drivers will report per queue info for both rx and tx\nas well as how many descriptors are in use.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\nAcked-by: Hemant Agrawal <hemant.agrawal@nxp.com>\n---\n app/proc-info/main.c | 79 ++++++++++++++++++++++++++++++++++++--------\n 1 file changed, 66 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/app/proc-info/main.c b/app/proc-info/main.c\nindex f3f83c0cea37..2ea554ab01f0 100644\n--- a/app/proc-info/main.c\n+++ b/app/proc-info/main.c\n@@ -654,6 +654,25 @@ metrics_display(int port_id)\n \trte_free(names);\n }\n \n+/* This could be replaced by an ethdev hook in future */\n+static int\n+eth_tx_queue_available(uint16_t port_id, uint16_t queue_id, uint16_t n)\n+{\n+\tuint16_t offset;\n+\tint count = 0;\n+\n+\tfor (offset = 0; offset < n; offset++) {\n+\t\tint status;\n+\n+\t\tstatus = rte_eth_tx_descriptor_status(port_id, queue_id, offset);\n+\t\tif (status < 0)\n+\t\t\treturn status;\n+\t\tif (status == RTE_ETH_TX_DESC_DONE)\n+\t\t\t++count;\n+\t}\n+\treturn count;\n+}\n+\n static void\n show_port(void)\n {\n@@ -667,7 +686,6 @@ show_port(void)\n \t\tuint16_t mtu = 0;\n \t\tstruct rte_eth_link link;\n \t\tstruct rte_eth_dev_info dev_info;\n-\t\tstruct rte_eth_rxq_info queue_info;\n \t\tstruct rte_eth_rss_conf rss_conf;\n \t\tstruct rte_eth_fc_conf fc_conf;\n \t\tstruct rte_ether_addr mac;\n@@ -739,6 +757,7 @@ show_port(void)\n \t\tret = rte_eth_macaddr_get(i, &mac);\n \t\tif (ret == 0) {\n \t\t\tchar ebuf[RTE_ETHER_ADDR_FMT_SIZE];\n+\n \t\t\trte_ether_format_addr(ebuf, sizeof(ebuf), &mac);\n \t\t\tprintf(\"\\t  -- mac %s\\n\", ebuf);\n \t\t}\n@@ -758,20 +777,54 @@ show_port(void)\n \t\tif (ret == 0)\n \t\t\tprintf(\"\\t  -- mtu (%d)\\n\", mtu);\n \n-\t\tprintf(\"  - queue\\n\");\n \t\tfor (j = 0; j < dev_info.nb_rx_queues; j++) {\n+\t\t\tstruct rte_eth_rxq_info queue_info;\n+\t\t\tint count;\n+\n \t\t\tret = rte_eth_rx_queue_info_get(i, j, &queue_info);\n-\t\t\tif (ret == 0) {\n-\t\t\t\tprintf(\"\\t  -- queue %d rx scatter %d\"\n-\t\t\t\t\t\t\" descriptors %d\"\n-\t\t\t\t\t\t\" offloads 0x%\"PRIx64\n-\t\t\t\t\t\t\" mempool socket %d\\n\",\n-\t\t\t\t\t\tj,\n-\t\t\t\t\t\tqueue_info.scattered_rx,\n-\t\t\t\t\t\tqueue_info.nb_desc,\n-\t\t\t\t\t\tqueue_info.conf.offloads,\n-\t\t\t\t\t\tqueue_info.mp->socket_id);\n-\t\t\t}\n+\t\t\tif (ret != 0)\n+\t\t\t\tbreak;\n+\n+\t\t\tif (j == 0)\n+\t\t\t\tprintf(\"  - rx queue\\n\");\n+\n+\t\t\tprintf(\"\\t  -- %d descriptors \", j);\n+\t\t\tcount = rte_eth_rx_queue_count(i, j);\n+\t\t\tif (count >= 0)\n+\t\t\t\tprintf(\"%d/\", count);\n+\t\t\tprintf(\"%d\", queue_info.nb_desc);\n+\n+\t\t\tif (queue_info.scattered_rx)\n+\t\t\t\tprintf(\" scattered_rx\");\n+\n+\t\t\tprintf(\" offloads %#\"PRIx64\" socket %d\\n\",\n+\t\t\t       queue_info.conf.offloads,\n+\t\t\t       queue_info.mp->socket_id);\n+\t\t}\n+\n+\t\tfor (j = 0; j < dev_info.nb_tx_queues; j++) {\n+\t\t\tstruct rte_eth_txq_info queue_info;\n+\t\t\tint count;\n+\n+\t\t\tret = rte_eth_tx_queue_info_get(i, j, &queue_info);\n+\t\t\tif (ret != 0)\n+\t\t\t\tbreak;\n+\n+\t\t\tif (j == 0)\n+\t\t\t\tprintf(\"  - tx queue\\n\");\n+\n+\t\t\tprintf(\"\\t  -- %d descriptors \", j);\n+\n+\t\t\tcount = eth_tx_queue_available(i, j, queue_info.nb_desc);\n+\t\t\tif (count >= 0)\n+\t\t\t\tprintf(\"%d/\", count);\n+\t\t\tprintf(\"%d\", queue_info.nb_desc);\n+\n+\t\t\tif (queue_info.conf.tx_deferred_start)\n+\t\t\t\tprintf(\" deferred_start\");\n+\n+\t\t\tprintf(\" offloads %#\"PRIx64\"\\n\",\n+\t\t\t       queue_info.conf.offloads);\n \t\t}\n \n \t\tret = rte_eth_dev_rss_hash_conf_get(i, &rss_conf);\n",
    "prefixes": [
        "v4",
        "6/8"
    ]
}