get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8502,
    "url": "https://patches.dpdk.org/api/patches/8502/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1446307051-29283-10-git-send-email-jingjing.wu@intel.com/",
    "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",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<1446307051-29283-10-git-send-email-jingjing.wu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1446307051-29283-10-git-send-email-jingjing.wu@intel.com",
    "date": "2015-10-31T15:57:31",
    "name": "[dpdk-dev,v3,9/9] app/testpmd: add command to display DCB info",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a9480e4cabca41b18d57fad12b56b147973f37e7",
    "submitter": {
        "id": 47,
        "url": "https://patches.dpdk.org/api/people/47/?format=api",
        "name": "Jingjing Wu",
        "email": "jingjing.wu@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1446307051-29283-10-git-send-email-jingjing.wu@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/8502/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/8502/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id CF64F8E8C;\n\tSat, 31 Oct 2015 16:58:10 +0100 (CET)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id DE7F08E8C\n\tfor <dev@dpdk.org>; Sat, 31 Oct 2015 16:58:07 +0100 (CET)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga102.fm.intel.com with ESMTP; 31 Oct 2015 08:58:06 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby FMSMGA003.fm.intel.com with ESMTP; 31 Oct 2015 08:58:01 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id t9VFvu4G001295;\n\tSat, 31 Oct 2015 23:57:56 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t9VFvrwG029724; Sat, 31 Oct 2015 23:57:55 +0800",
            "(from wujingji@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t9VFvqWU029720; \n\tSat, 31 Oct 2015 23:57:52 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.20,224,1444719600\"; d=\"scan'208\";a=\"591622764\"",
        "From": "Jingjing Wu <jingjing.wu@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Sat, 31 Oct 2015 23:57:31 +0800",
        "Message-Id": "<1446307051-29283-10-git-send-email-jingjing.wu@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1446307051-29283-1-git-send-email-jingjing.wu@intel.com>",
        "References": "<1446108827-7907-1-git-send-email-jingjing.wu@intel.com>\n\t<1446307051-29283-1-git-send-email-jingjing.wu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3 9/9] app/testpmd: add command to display DCB\n\tinfo",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch adds a command to display DCB info in ports.\n\nSigned-off-by: Jingjing Wu <jingjing.wu@intel.com>\n---\n app/test-pmd/cmdline.c                      | 15 ++++++----\n app/test-pmd/config.c                       | 43 +++++++++++++++++++++++++++++\n app/test-pmd/testpmd.h                      |  1 +\n doc/guides/testpmd_app_ug/testpmd_funcs.rst | 12 ++++----\n 4 files changed, 61 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 0254628..410f149 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -182,7 +182,7 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\"Display:\\n\"\n \t\t\t\"--------\\n\\n\"\n \n-\t\t\t\"show port (info|stats|xstats|fdir|stat_qmap) (port_id|all)\\n\"\n+\t\t\t\"show port (info|stats|xstats|fdir|stat_qmap|dcb_tc) (port_id|all)\\n\"\n \t\t\t\"    Display information for port_id, or all.\\n\\n\"\n \n \t\t\t\"show port X rss reta (size) (mask0,mask1,...)\\n\"\n@@ -5235,6 +5235,9 @@ static void cmd_showportall_parsed(void *parsed_result,\n \telse if (!strcmp(res->what, \"stat_qmap\"))\n \t\tFOREACH_PORT(i, ports)\n \t\t\tnic_stats_mapping_display(i);\n+\telse if (!strcmp(res->what, \"dcb_tc\"))\n+\t\tFOREACH_PORT(i, ports)\n+\t\t\tport_dcb_info_display(i);\n }\n \n cmdline_parse_token_string_t cmd_showportall_show =\n@@ -5244,13 +5247,13 @@ cmdline_parse_token_string_t cmd_showportall_port =\n \tTOKEN_STRING_INITIALIZER(struct cmd_showportall_result, port, \"port\");\n cmdline_parse_token_string_t cmd_showportall_what =\n \tTOKEN_STRING_INITIALIZER(struct cmd_showportall_result, what,\n-\t\t\t\t \"info#stats#xstats#fdir#stat_qmap\");\n+\t\t\t\t \"info#stats#xstats#fdir#stat_qmap#dcb_tc\");\n cmdline_parse_token_string_t cmd_showportall_all =\n \tTOKEN_STRING_INITIALIZER(struct cmd_showportall_result, all, \"all\");\n cmdline_parse_inst_t cmd_showportall = {\n \t.f = cmd_showportall_parsed,\n \t.data = NULL,\n-\t.help_str = \"show|clear port info|stats|xstats|fdir|stat_qmap all\",\n+\t.help_str = \"show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc all\",\n \t.tokens = {\n \t\t(void *)&cmd_showportall_show,\n \t\t(void *)&cmd_showportall_port,\n@@ -5288,6 +5291,8 @@ static void cmd_showport_parsed(void *parsed_result,\n \t\t fdir_get_infos(res->portnum);\n \telse if (!strcmp(res->what, \"stat_qmap\"))\n \t\tnic_stats_mapping_display(res->portnum);\n+\telse if (!strcmp(res->what, \"dcb_tc\"))\n+\t\tport_dcb_info_display(res->portnum);\n }\n \n cmdline_parse_token_string_t cmd_showport_show =\n@@ -5297,14 +5302,14 @@ cmdline_parse_token_string_t cmd_showport_port =\n \tTOKEN_STRING_INITIALIZER(struct cmd_showport_result, port, \"port\");\n cmdline_parse_token_string_t cmd_showport_what =\n \tTOKEN_STRING_INITIALIZER(struct cmd_showport_result, what,\n-\t\t\t\t \"info#stats#xstats#fdir#stat_qmap\");\n+\t\t\t\t \"info#stats#xstats#fdir#stat_qmap#dcb_tc\");\n cmdline_parse_token_num_t cmd_showport_portnum =\n \tTOKEN_NUM_INITIALIZER(struct cmd_showport_result, portnum, UINT8);\n \n cmdline_parse_inst_t cmd_showport = {\n \t.f = cmd_showport_parsed,\n \t.data = NULL,\n-\t.help_str = \"show|clear port info|stats|xstats|fdir|stat_qmap X (X = port number)\",\n+\t.help_str = \"show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc X (X = port number)\",\n \t.tokens = {\n \t\t(void *)&cmd_showport_show,\n \t\t(void *)&cmd_showport_port,\ndiff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex ef87581..1b0d5d5 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -2285,3 +2285,46 @@ mcast_addr_remove(uint8_t port_id, struct ether_addr *mc_addr)\n \tmcast_addr_pool_remove(port, i);\n \teth_port_multicast_addr_list_set(port_id);\n }\n+\n+void\n+port_dcb_info_display(uint8_t port_id)\n+{\n+\tstruct rte_eth_dcb_info dcb_info;\n+\tuint16_t i;\n+\tint ret;\n+\tstatic const char *border = \"================\";\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tret = rte_eth_dev_get_dcb_info(port_id, &dcb_info);\n+\tif (ret) {\n+\t\tprintf(\"\\n Failed to get dcb infos on port %-2d\\n\",\n+\t\t\tport_id);\n+\t\treturn;\n+\t}\n+\tprintf(\"\\n  %s DCB infos for port %-2d  %s\\n\", border, port_id, border);\n+\tprintf(\"  TC NUMBER: %d\\n\", dcb_info.nb_tcs);\n+\tprintf(\"\\n  TC :        \");\n+\tfor (i = 0; i < dcb_info.nb_tcs; i++)\n+\t\tprintf(\"\\t%4d\", i);\n+\tprintf(\"\\n  Priority :  \");\n+\tfor (i = 0; i < dcb_info.nb_tcs; i++)\n+\t\tprintf(\"\\t%4d\", dcb_info.prio_tc[i]);\n+\tprintf(\"\\n  BW percent :\");\n+\tfor (i = 0; i < dcb_info.nb_tcs; i++)\n+\t\tprintf(\"\\t%4d%%\", dcb_info.tc_bws[i]);\n+\tprintf(\"\\n  RXQ base :  \");\n+\tfor (i = 0; i < dcb_info.nb_tcs; i++)\n+\t\tprintf(\"\\t%4d\", dcb_info.tc_queue.tc_rxq[0][i].base);\n+\tprintf(\"\\n  RXQ number :\");\n+\tfor (i = 0; i < dcb_info.nb_tcs; i++)\n+\t\tprintf(\"\\t%4d\", dcb_info.tc_queue.tc_rxq[0][i].nb_queue);\n+\tprintf(\"\\n  TXQ base :  \");\n+\tfor (i = 0; i < dcb_info.nb_tcs; i++)\n+\t\tprintf(\"\\t%4d\", dcb_info.tc_queue.tc_txq[0][i].base);\n+\tprintf(\"\\n  TXQ number :\");\n+\tfor (i = 0; i < dcb_info.nb_tcs; i++)\n+\t\tprintf(\"\\t%4d\", dcb_info.tc_queue.tc_txq[0][i].nb_queue);\n+\tprintf(\"\\n\");\n+}\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex 3661755..ecb411d 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -557,6 +557,7 @@ int tx_queue_id_is_invalid(queueid_t txq_id);\n /* Functions to manage the set of filtered Multicast MAC addresses */\n void mcast_addr_add(uint8_t port_id, struct ether_addr *mc_addr);\n void mcast_addr_remove(uint8_t port_id, struct ether_addr *mc_addr);\n+void port_dcb_info_display(uint8_t port_id);\n \n enum print_warning {\n \tENABLED_WARN = 0,\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex 71d831b..b7659d0 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -50,10 +50,10 @@ If you type a partial command and hit ``<TAB>`` you get a list of the available\n \n    testpmd> show port <TAB>\n \n-       info [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap X\n-       info [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap all\n-       stats [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap X\n-       stats [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap all\n+       info [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap|dcb_tc X\n+       info [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap|dcb_tc all\n+       stats [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap|dcb_tc X\n+       stats [Mul-choice STRING]: show|clear port info|stats|fdir|stat_qmap|dcb_tc all\n        ...\n \n \n@@ -128,7 +128,7 @@ show port\n \n Display information for a given port or all ports::\n \n-   testpmd> show port (info|stats|fdir|stat_qmap) (port_id|all)\n+   testpmd> show port (info|stats|fdir|stat_qmap|dcb_tc) (port_id|all)\n \n The available information categories are:\n \n@@ -140,6 +140,8 @@ The available information categories are:\n \n * ``stat_qmap``: Queue statistics mapping.\n \n+* ``dcb_tc``: DCB information such as TC mapping.\n+\n For example:\n \n .. code-block:: console\n",
    "prefixes": [
        "dpdk-dev",
        "v3",
        "9/9"
    ]
}