get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 18284,
    "url": "http://patches.dpdk.org/api/patches/18284/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1482286826-72737-1-git-send-email-qiming.yang@intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<1482286826-72737-1-git-send-email-qiming.yang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1482286826-72737-1-git-send-email-qiming.yang@intel.com",
    "date": "2016-12-21T02:20:26",
    "name": "[dpdk-dev,v3] app/testpmd: supported offload capabilities query",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9245849e634bb14a9f76cd2a2a409c80f240b425",
    "submitter": {
        "id": 522,
        "url": "http://patches.dpdk.org/api/people/522/?format=api",
        "name": "Qiming Yang",
        "email": "qiming.yang@intel.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1482286826-72737-1-git-send-email-qiming.yang@intel.com/mbox/",
    "series": [],
    "comments": "http://patches.dpdk.org/api/patches/18284/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/18284/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 29BF5FC01;\n\tWed, 21 Dec 2016 03:25:39 +0100 (CET)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 1399D2BB1\n\tfor <dev@dpdk.org>; Wed, 21 Dec 2016 03:25:33 +0100 (CET)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby fmsmga102.fm.intel.com with ESMTP; 20 Dec 2016 18:25:32 -0800",
            "from unknown (HELO dpdk7.bj.intel.com) ([172.16.182.76])\n\tby fmsmga002.fm.intel.com with ESMTP; 20 Dec 2016 18:25:32 -0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.33,381,1477983600\"; d=\"scan'208\";\n\ta=\"1102279171\"",
        "From": "Qiming Yang <qiming.yang@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "jingjing.wu@intel.com,\n\tQiming Yang <qiming.yang@intel.com>",
        "Date": "Wed, 21 Dec 2016 10:20:26 +0800",
        "Message-Id": "<1482286826-72737-1-git-send-email-qiming.yang@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1481008055-68096-1-git-send-email-qiming.yang@intel.com>",
        "References": "<1481008055-68096-1-git-send-email-qiming.yang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3] app/testpmd: supported offload capabilities\n\tquery",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <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": "Add two new commands \"show port capa <port>\" and \"show\nport capa all\"to diaplay what offload capabilities supported\nin ports. It will not only display all the capabilities of\nthe port, but also the enabling condition for each capability\nin the running time.\n\nSigned-off-by: Qiming Yang <qiming.yang@intel.com>\n---\nv2 changes:\n* fixed the output style as Ferruh's patch show and add some\n  descriptions in testpmd_funcs.rst for new functions.\nv3 changes:\n* add new command in cmd_help_long_parsed.\n---\n---\n app/test-pmd/cmdline.c                      |  17 ++-\n app/test-pmd/config.c                       | 172 ++++++++++++++++++++++++++++\n app/test-pmd/testpmd.h                      |   1 +\n doc/guides/testpmd_app_ug/testpmd_funcs.rst |  12 +-\n 4 files changed, 192 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 63b55dc..21ffa0a 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|dcb_tc) (port_id|all)\\n\"\n+\t\t\t\"show port (info|stats|xstats|fdir|stat_qmap|dcb_tc|capa) (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@@ -5766,6 +5766,9 @@ static void cmd_showportall_parsed(void *parsed_result,\n \telse if (!strcmp(res->what, \"dcb_tc\"))\n \t\tFOREACH_PORT(i, ports)\n \t\t\tport_dcb_info_display(i);\n+\telse if (!strcmp(res->what, \"capa\"))\n+\t\tFOREACH_PORT(i, ports)\n+\t\t\tport_offload_capa_display(i);\n }\n \n cmdline_parse_token_string_t cmd_showportall_show =\n@@ -5775,13 +5778,14 @@ 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#dcb_tc\");\n+\t\t\t\t \"info#stats#xstats#fdir#stat_qmap#dcb_tc#capa\");\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|dcb_tc all\",\n+\t.help_str = \"show|clear port\"\n+\t\"info|stats|xstats|fdir|stat_qmap|dcb_tc|capa all\",\n \t.tokens = {\n \t\t(void *)&cmd_showportall_show,\n \t\t(void *)&cmd_showportall_port,\n@@ -5821,6 +5825,8 @@ static void cmd_showport_parsed(void *parsed_result,\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+\telse if (!strcmp(res->what, \"capa\"))\n+\t\tport_offload_capa_display(res->portnum);\n }\n \n cmdline_parse_token_string_t cmd_showport_show =\n@@ -5830,14 +5836,15 @@ 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#dcb_tc\");\n+\t\t\t\t \"info#stats#xstats#fdir#stat_qmap#dcb_tc#capa\");\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|dcb_tc X (X = port number)\",\n+\t.help_str = \"show|clear port\"\n+\t\"info|stats|xstats|fdir|stat_qmap|dcb_tc|capa <port_id>\",\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 36c47ab..9571426 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -536,6 +536,178 @@ port_infos_display(portid_t port_id)\n \t\tdev_info.tx_desc_lim.nb_min);\n \tprintf(\"TXDs number alignment: %hu\\n\", dev_info.tx_desc_lim.nb_align);\n }\n+void\n+port_offload_capa_display(portid_t port_id)\n+{\n+\tstruct rte_eth_dev *dev;\n+\tstruct rte_eth_dev_info dev_info;\n+\tstatic const char *info_border = \"************\";\n+\n+\tif (port_id_is_invalid(port_id, ENABLED_WARN))\n+\t\treturn;\n+\n+\tdev = &rte_eth_devices[port_id];\n+\trte_eth_dev_info_get(port_id, &dev_info);\n+\n+\tprintf(\"\\n%s Port %d supported offload features: %s\\n\",\n+\t\tinfo_border, port_id, info_border);\n+\n+\tif (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_VLAN_STRIP) {\n+\t\tprintf(\"VLAN stripped:                 \");\n+\t\tif (dev->data->dev_conf.rxmode.hw_vlan_strip)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_IPV4_CKSUM) {\n+\t\tprintf(\"RX IPv4 checksum:              \");\n+\t\tif (dev->data->dev_conf.rxmode.hw_ip_checksum)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_UDP_CKSUM) {\n+\t\tprintf(\"RX UDP checksum:               \");\n+\t\tif (dev->data->dev_conf.rxmode.hw_ip_checksum)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_CKSUM) {\n+\t\tprintf(\"TCP checksum:                  \");\n+\t\tif (dev->data->dev_conf.rxmode.hw_ip_checksum)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_TCP_LRO) {\n+\t\tprintf(\"Large receive offload:         \");\n+\t\tif (dev->data->dev_conf.rxmode.enable_lro)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_QINQ_STRIP) {\n+\t\tprintf(\"Double VLANs stripped:         \");\n+\t\tif (dev->data->dev_conf.rxmode.hw_vlan_extend)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.rx_offload_capa & DEV_RX_OFFLOAD_OUTER_IPV4_CKSUM)\n+\t\tprintf(\"Outer IPv4 checksum:           \");\n+\n+\tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VLAN_INSERT) {\n+\t\tprintf(\"VLAN insert:                   \");\n+\t\tif (ports[port_id].tx_ol_flags & TESTPMD_TX_OFFLOAD_INSERT_VLAN)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IPV4_CKSUM) {\n+\t\tprintf(\"TX IPv4 checksum:              \");\n+\t\tif (ports[port_id].tx_ol_flags & TESTPMD_TX_OFFLOAD_IP_CKSUM)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_UDP_CKSUM) {\n+\t\tprintf(\"TX UDP checksum:               \");\n+\t\tif (ports[port_id].tx_ol_flags & TESTPMD_TX_OFFLOAD_UDP_CKSUM)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_CKSUM) {\n+\t\tprintf(\"TX TCP checksum:               \");\n+\t\tif (ports[port_id].tx_ol_flags & TESTPMD_TX_OFFLOAD_TCP_CKSUM)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_SCTP_CKSUM) {\n+\t\tprintf(\"TX SCTP checksum:              \");\n+\t\tif (ports[port_id].tx_ol_flags & TESTPMD_TX_OFFLOAD_SCTP_CKSUM)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_TCP_TSO) {\n+\t\tprintf(\"TX TCP segmentation:           \");\n+\t\tif (ports[port_id].tso_segsz != 0)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_UDP_TSO) {\n+\t\tprintf(\"UDP segmentation:              \");\n+\t\tif (ports[port_id].tso_segsz != 0)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_OUTER_IPV4_CKSUM) {\n+\t\tprintf(\"Outer IPv4 checksum:           \");\n+\t\tif (ports[port_id].tx_ol_flags & TESTPMD_TX_OFFLOAD_OUTER_IP_CKSUM)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_QINQ_INSERT) {\n+\t\tprintf(\"Double VLANs insert:           \");\n+\t\tif (ports[port_id].tx_ol_flags & TESTPMD_TX_OFFLOAD_INSERT_QINQ)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_VXLAN_TNL_TSO) {\n+\t\tprintf(\"VXLAN TSO for tunnel packet:   \");\n+\t\tif (ports[port_id].tunnel_tso_segsz)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_GRE_TNL_TSO) {\n+\t\tprintf(\"Generic TSO for tunnel packet: \");\n+\t\tif (ports[port_id].tunnel_tso_segsz)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_IPIP_TNL_TSO) {\n+\t\tprintf(\"IPIP TSO for tunnel packet:    \");\n+\t\tif (ports[port_id].tunnel_tso_segsz)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+\tif (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_GENEVE_TNL_TSO) {\n+\t\tprintf(\"GENEVE TSO for tunnel packet:  \");\n+\t\tif (ports[port_id].tunnel_tso_segsz)\n+\t\t\tprintf(\"on\\n\");\n+\t\telse\n+\t\t\tprintf(\"off\\n\");\n+\t}\n+\n+}\n \n int\n port_id_is_invalid(portid_t port_id, enum print_warning warning)\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex 9c1e703..c59bb03 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -484,6 +484,7 @@ void nic_xstats_display(portid_t port_id);\n void nic_xstats_clear(portid_t port_id);\n void nic_stats_mapping_display(portid_t port_id);\n void port_infos_display(portid_t port_id);\n+void port_offload_capa_display(portid_t port_id);\n void rx_queue_infos_display(portid_t port_idi, uint16_t queue_id);\n void tx_queue_infos_display(portid_t port_idi, uint16_t queue_id);\n void fwd_lcores_config_display(void);\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex f1c269a..6f4dd4a 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -51,10 +51,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|xstats|fdir|stat_qmap|dcb_tc X\n-       info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc all\n-       stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc X\n-       stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc all\n+       info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc|capa X\n+       info [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc|capa all\n+       stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc|capa X\n+       stats [Mul-choice STRING]: show|clear port info|stats|xstats|fdir|stat_qmap|dcb_tc|capa all\n        ...\n \n \n@@ -131,7 +131,7 @@ show port\n \n Display information for a given port or all ports::\n \n-   testpmd> show port (info|stats|xstats|fdir|stat_qmap|dcb_tc) (port_id|all)\n+   testpmd> show port (info|stats|xstats|fdir|stat_qmap|dcb_tc|capa) (port_id|all)\n \n The available information categories are:\n \n@@ -147,6 +147,8 @@ The available information categories are:\n \n * ``dcb_tc``: DCB information such as TC mapping.\n \n+* ``capa``: Supported offload capabilities.\n+\n For example:\n \n .. code-block:: console\n",
    "prefixes": [
        "dpdk-dev",
        "v3"
    ]
}