Show a patch.

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

{
    "id": 74590,
    "url": "https://patches.dpdk.org/api/patches/74590/",
    "web_url": "https://patches.dpdk.org/patch/74590/",
    "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-5-stephen@networkplumber.org>",
    "date": "2020-07-21T18:22:38",
    "name": "[v4,4/8] app/proc-info: add more info to show_ports",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "056b35f381b0a8f747de4615cf3b1bf82a8964a0",
    "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/74590/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/74590/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/74590/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": "AOAM532AHyTaxmyGJ++aZ2n4sMphI8YFvM7bln9nT83ngHrswtSPdK0g\n t7ilN5wETo9sad9Z15igK+iSaD3viINAoQ==",
        "X-Google-Smtp-Source": "\n ABdhPJy4vwejUmMVmDE3esGwN88BHHOuu2cWsGLEtG1Jwtn35QUVX2iIDEvJz2HlxbHa1x++gbjMjA==",
        "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 4/8] app/proc-info: add more info to show_ports",
        "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 66508A0526;\n\tTue, 21 Jul 2020 20:23:31 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 893AF1C0B4;\n\tTue, 21 Jul 2020 20:23:03 +0200 (CEST)",
            "from mail-pg1-f194.google.com (mail-pg1-f194.google.com\n [209.85.215.194]) by dpdk.org (Postfix) with ESMTP id 433F81C068\n for <dev@dpdk.org>; Tue, 21 Jul 2020 20:22:59 +0200 (CEST)",
            "by mail-pg1-f194.google.com with SMTP id d4so12321342pgk.4\n for <dev@dpdk.org>; Tue, 21 Jul 2020 11:22:59 -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.55\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 21 Jul 2020 11:22:56 -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=cLVk64kgZdaK3nTs9Q9TTw8imJyCV0REKP4gEuKNz6E=;\n b=SWq2UKOs+vsY5c4IqHfX/1WIQCt1TFSRYeioBMfOjOQH9/ZK0+kG0zm1AZj1sBABNS\n 4zBWsyEnPtQ6BoRBpqjLl7gE5RvPpHdFGQpd6S5xCXub8rbB9ERVDrO/QRs05y6XCu3j\n mykNIB26NBoSxSrKZqRGppsUSFQDO7qswpUh/4CF7gC+GlcSr6goFYSGAaccvABk12zc\n /uwlG1pClLMfmXCyooJ9jN8qT/0ubFr3nihFNl6LEWeDkv+ocOXjhTSdR/p0SaW1FPts\n aF6WPSPLe2qDZGnrLqmqyXGZrdpmAVxms+cup1HK4xmL1mspZssncsfLsH2NgMdba5Uy\n fxtg==",
        "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=cLVk64kgZdaK3nTs9Q9TTw8imJyCV0REKP4gEuKNz6E=;\n b=b6dv4mHkeGXE8zS4pZz35PEI+VfUKmDGMvJpfGdZ3dndRj8pI6kVtTiowga70dN5eG\n yZXSMEZhGCeWxXx6/mnN+AwCzhnMIR0SSlvgWVpi74srUp4KDZaND1PbpA0MR74jGbiK\n N+gxDPcj556KCXKFw7D/uxdbPJ9Ql6wOc9jsqjQfb9Q/pFItIkvu+HpVY3t4W7O+WAfe\n qLNIgJg7njRLCXw2NuPJdnQetre2S8QflTkfK7yp88pVgYU8B5yt9Dy87Kw1bRqb/vqb\n Wxeq9AKl18snm2cAdA9sAWLE2nX/uWBsQgBfQtdVqPfMcojEZI7AOeKPcoYpvLbnGaCG\n kAsA==",
        "Date": "Tue, 21 Jul 2020 11:22:38 -0700",
        "Content-Transfer-Encoding": "8bit",
        "X-Received": "by 2002:a63:144c:: with SMTP id 12mr23633758pgu.189.1595355777809;\n Tue, 21 Jul 2020 11:22:57 -0700 (PDT)",
        "To": "dev@dpdk.org",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "In-Reply-To": "<20200721182242.5366-1-stephen@networkplumber.org>",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n Hemant Agrawal <hemant.agrawal@nxp.com>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Message-Id": "<20200721182242.5366-5-stephen@networkplumber.org>",
        "Return-Path": "<dev-bounces@dpdk.org>"
    },
    "content": "Revise the display of port information to include more data\nand be more human friendly.\n\n  * Display units for port speed, and decode link fields.\n  * Show driver and device information\n  * Show MAC address\n  * Show flow control information\n  * Combine lines if possible\n  * Show all multicast mode\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\nAcked-by: Hemant Agrawal <hemant.agrawal@nxp.com>\n---\n app/proc-info/main.c | 88 ++++++++++++++++++++++++++++++++++++--------\n 1 file changed, 72 insertions(+), 16 deletions(-)",
    "diff": "diff --git a/app/proc-info/main.c b/app/proc-info/main.c\nindex e4914191bef9..7c1276b7fbc1 100644\n--- a/app/proc-info/main.c\n+++ b/app/proc-info/main.c\n@@ -669,6 +669,8 @@ show_port(void)\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 \n \t\tmemset(&rss_conf, 0, sizeof(rss_conf));\n \n@@ -676,32 +678,86 @@ show_port(void)\n \t\tSTATS_BDR_STR(5, bdr_str);\n \t\tprintf(\"  - generic config\\n\");\n \n-\t\tprintf(\"\\t  -- Socket %d\\n\", rte_eth_dev_socket_id(i));\n+\t\tret = rte_eth_dev_info_get(i, &dev_info);\n+\t\tif (ret != 0) {\n+\t\t\tprintf(\"Error during getting device info: %s\\n\",\n+\t\t\t\tstrerror(-ret));\n+\t\t\treturn;\n+\t\t}\n+\n+\t\tprintf(\"\\t  -- driver %s device %s socket %d\\n\",\n+\t\t       dev_info.driver_name, dev_info.device->name,\n+\t\t       rte_eth_dev_socket_id(i));\n+\n \t\tret = rte_eth_link_get(i, &link);\n \t\tif (ret < 0) {\n \t\t\tprintf(\"Link get failed (port %u): %s\\n\",\n \t\t\t       i, rte_strerror(-ret));\n \t\t} else {\n-\t\t\tprintf(\"\\t  -- link speed %d duplex %d,\"\n-\t\t\t\t\t\" auto neg %d status %d\\n\",\n-\t\t\t\t\tlink.link_speed,\n-\t\t\t\t\tlink.link_duplex,\n-\t\t\t\t\tlink.link_autoneg,\n-\t\t\t\t\tlink.link_status);\n+\t\t\tuint32_t speed = link.link_speed;\n+\t\t\tchar suffix = 'M';\n+\t\t\tconst char *duplex, *autoneg, *status;\n+\n+\t\t\tif (speed > 1000) {\n+\t\t\t\tsuffix = 'G';\n+\t\t\t\tspeed /= 1000;\n+\t\t\t}\n+\n+\t\t\tif (link.link_duplex == ETH_LINK_FULL_DUPLEX)\n+\t\t\t\tduplex = \"full\";\n+\t\t\telse\n+\t\t\t\tduplex = \"half\";\n+\n+\t\t\tif (link.link_autoneg == ETH_LINK_AUTONEG)\n+\t\t\t\tautoneg = \"auto neg\";\n+\t\t\telse\n+\t\t\t\tautoneg = \"fixed\";\n+\n+\t\t\tif (link.link_status == ETH_LINK_UP)\n+\t\t\t\tstatus = \"up\";\n+\t\t\telse\n+\t\t\t\tstatus = \"down\";\n+\n+\t\t\tprintf(\"\\t  -- link speed %u%cbps (%s), duplex %s, %s\\n\",\n+\t\t\t       speed, suffix, autoneg, duplex, status);\n+\t\t}\n+\n+\t\tret = rte_eth_dev_flow_ctrl_get(i, &fc_conf);\n+\t\tif (ret == 0 && fc_conf.mode != RTE_FC_NONE)  {\n+\t\t\tprintf(\"\\t  -- flow control mode %s%s high %u low %u pause %u%s%s\\n\",\n+\t\t\t       fc_conf.mode == RTE_FC_RX_PAUSE ? \"rx \" :\n+\t\t\t       fc_conf.mode == RTE_FC_TX_PAUSE ? \"tx \" :\n+\t\t\t       fc_conf.mode == RTE_FC_FULL ? \"full\" : \"???\",\n+\t\t\t       fc_conf.autoneg ? \" auto\" : \"\",\n+\t\t\t       fc_conf.high_water,\n+\t\t\t       fc_conf.low_water,\n+\t\t\t       fc_conf.pause_time,\n+\t\t\t       fc_conf.send_xon ? \" xon\" : \"\",\n+\t\t\t       fc_conf.mac_ctrl_frame_fwd ? \" mac_ctrl\" : \"\");\n \t\t}\n-\t\tprintf(\"\\t  -- promiscuous (%d)\\n\",\n-\t\t\t\trte_eth_promiscuous_get(i));\n+\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+\t\t\trte_ether_format_addr(ebuf, sizeof(ebuf), &mac);\n+\t\t\tprintf(\"\\t  -- mac %s\\n\", ebuf);\n+\t\t}\n+\n+\n+\t\tret = rte_eth_promiscuous_get(i);\n+\t\tif (ret >= 0)\n+\t\t\tprintf(\"\\t  -- promiscuous mode %s\\n\",\n+\t\t\t       ret > 0 ? \"enabled\" : \"disabled\");\n+\n+\t\tret = rte_eth_allmulticast_get(i);\n+\t\tif (ret >= 0)\n+\t\t\tprintf(\"\\t  -- all multicast mode %s\\n\",\n+\t\t\t       ret > 0 ? \"enabled\" : \"disabled\");\n+\n \t\tret = rte_eth_dev_get_mtu(i, &mtu);\n \t\tif (ret == 0)\n \t\t\tprintf(\"\\t  -- mtu (%d)\\n\", mtu);\n \n-\t\tret = rte_eth_dev_info_get(i, &dev_info);\n-\t\tif (ret != 0) {\n-\t\t\tprintf(\"Error during getting device (port %u) info: %s\\n\",\n-\t\t\t\ti, strerror(-ret));\n-\t\t\treturn;\n-\t\t}\n-\n \t\tprintf(\"  - queue\\n\");\n \t\tfor (j = 0; j < dev_info.nb_rx_queues; j++) {\n \t\t\tret = rte_eth_rx_queue_info_get(i, j, &queue_info);\n",
    "prefixes": [
        "v4",
        "4/8"
    ]
}