get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 65711,
    "url": "https://patches.dpdk.org/api/patches/65711/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1581355176-25132-1-git-send-email-hariprasad.govindharajan@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": "<1581355176-25132-1-git-send-email-hariprasad.govindharajan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1581355176-25132-1-git-send-email-hariprasad.govindharajan@intel.com",
    "date": "2020-02-10T17:19:36",
    "name": "[v7] app/testpmd: add portlist option",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "88cba33d6b06b61d7a77a1d01d03a6f3a2bb73ff",
    "submitter": {
        "id": 1311,
        "url": "https://patches.dpdk.org/api/people/1311/?format=api",
        "name": "Hariprasad Govindharajan",
        "email": "hariprasad.govindharajan@intel.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1581355176-25132-1-git-send-email-hariprasad.govindharajan@intel.com/mbox/",
    "series": [
        {
            "id": 8487,
            "url": "https://patches.dpdk.org/api/series/8487/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=8487",
            "date": "2020-02-10T17:19:36",
            "name": "[v7] app/testpmd: add portlist option",
            "version": 7,
            "mbox": "https://patches.dpdk.org/series/8487/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/65711/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/65711/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.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 C392DA051C;\n\tMon, 10 Feb 2020 18:19:44 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 2E7CE37B7;\n\tMon, 10 Feb 2020 18:19:44 +0100 (CET)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n by dpdk.org (Postfix) with ESMTP id 47FC63195\n for <dev@dpdk.org>; Mon, 10 Feb 2020 18:19:42 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 10 Feb 2020 09:19:41 -0800",
            "from silpixa00393944.ir.intel.com ([10.237.223.184])\n by fmsmga001.fm.intel.com with ESMTP; 10 Feb 2020 09:19:38 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.70,425,1574150400\"; d=\"scan'208\";a=\"347088075\"",
        "From": "Hariprasad Govindharajan <hariprasad.govindharajan@intel.com>",
        "To": "Wenzhuo Lu <wenzhuo.lu@intel.com>, Jingjing Wu <jingjing.wu@intel.com>,\n Bernard Iremonger <bernard.iremonger@intel.com>,\n John McNamara <john.mcnamara@intel.com>,\n Marko Kovacevic <marko.kovacevic@intel.com>",
        "Cc": "dev@dpdk.org, ferruh.yigit@intel.com, stephen@networkplumber.org,\n david.marchand@redhat.com,\n Hariprasad Govindharajan <hariprasad.govindharajan@intel.com>",
        "Date": "Mon, 10 Feb 2020 17:19:36 +0000",
        "Message-Id": "\n <1581355176-25132-1-git-send-email-hariprasad.govindharajan@intel.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "\n <1580121053-26083-2-git-send-email-hariprasad.govindharajan@intel.com>",
        "References": "\n <1580121053-26083-2-git-send-email-hariprasad.govindharajan@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v7] app/testpmd: add portlist option",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "In current version, we are setting the ports\nusing portmask. With portmask, we can use only\nupto 64 ports. This portlist option enables the user\nto use more than 64 ports.\nNow we can specify the ports in 2 different ways\n - Using portmask (-p [0x]nnn): mask must be in hex format\n - Using portlist in the following format\n --portlist <p1>[-p2][,p3[-p4],...]\n\n --portmask 0x2 is same as --portlist 1\n --portmask 0x3 is same as --portlist 0-1\n\nSigned-off-by: Hariprasad Govindharajan <hariprasad.govindharajan@intel.com>\n---\nv7:\nmoved the port validation outside the parser function.\nadded meaningful comments describing the new functionality.\nrenamed the variables with meaningful names\n\nv6:\noptimized the code to check for duplicates\n\nv5:\nadded a check to validate the ports available before\nsetting them. also added comments in the testpmd file\nfor the new function\n\nv4:\nthe parser is modified so that we don't ues 2 arrays\nto convert the listed port values\n\nv3:\nsquashed the 2 patches and made it 1 patch with\nchanges only in testpmd. Also working on optmizing\nthe parser\n\nv2:\nmoved the parser function to testpmd\n---\n app/test-pmd/config.c                 | 114 ++++++++++++++++++++++++++++++++++\n app/test-pmd/parameters.c             |   5 ++\n app/test-pmd/testpmd.h                |   3 +\n doc/guides/testpmd_app_ug/run_app.rst |   7 +++\n 4 files changed, 129 insertions(+)",
    "diff": "diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex 9669cbd..962984b 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -2587,6 +2587,120 @@ set_fwd_ports_list(unsigned int *portlist, unsigned int nb_pt)\n \t}\n }\n \n+/**\n+ * Parse the user input and obtain the list of forwarding ports\n+ *\n+ * @param[in] list\n+ *   String containing the user input. User can specify\n+ *   in these formats 1,3,5 or 1-3 or 1-2,5 or 3,5-6.\n+ *   For example, if the user wants to use all the available\n+ *   4 ports in his system, then the input can be 0-3 or 0,1,2,3.\n+ *   If the user wants to use only the ports 1,2 then the input\n+ *   is 1,2.\n+ *   valid characters are '-' and ','\n+ *   invalid chars like '.' or '#' will result in\n+ *   EAL: Error - exiting with code: 1\n+ *     Cause: Invalid fwd port list\n+ * @param[out] values\n+ *   This array will be filled with a list of port IDs\n+ *   based on the user input\n+ *   Note that duplicate entries are discarded and only the first\n+ *   count entries in this array are port IDs and all the rest\n+ *   will contain default values\n+ * @param[in] maxsize\n+ *   This parameter denotes 2 things\n+ *   1) Size of the values array\n+ *   2) Maximum value of each element in the values array\n+ * @return\n+ *   -On success, returns total count of port IDs\n+ *   -On failure, returns -1.\n+ */\n+static int\n+parse_port_list(const char *list, unsigned int *values, int maxsize)\n+{\n+\tint count = 0;\n+\tchar *end = NULL;\n+\tint min, max;\n+\tint value, i;\n+\tunsigned int marked[maxsize];\n+\n+\tfor (i = 0; i < maxsize; i++)\n+\t\tmarked[i] = 0;\n+\n+\tif (list == NULL || values == NULL || maxsize < 0)\n+\t\treturn -1;\n+\n+\t/* Remove all blank characters ahead */\n+\twhile (isblank(*list))\n+\t\tlist++;\n+\n+\tmin = maxsize;\n+\n+\tdo {\n+\t\twhile (isblank(*list))\n+\t\t\tlist++;\n+\t\tif (*list == '\\0')\n+\t\t\treturn -1;\n+\t\terrno = 0;\n+\t\tvalue = strtol(list, &end, 10);\n+\t\tif (errno || end == NULL)\n+\t\t\treturn -1;\n+\t\tif (value < 0 || value >= maxsize)\n+\t\t\treturn -1;\n+\t\twhile (isblank(*end))\n+\t\t\tend++;\n+\t\tif (*end == '-') {\n+\t\t\tmin = value;\n+\t\t} else if ((*end == ',') || (*end == '\\0')) {\n+\t\t\tmax = value;\n+\t\t\tif (min == maxsize)\n+\t\t\t\tmin = value;\n+\t\t\tfor (i = min; i <= max; i++) {\n+\t\t\t\tif (count < maxsize) {\n+\t\t\t\t\tif (marked[i])\n+\t\t\t\t\t\tcontinue;\n+\t\t\t\t\tvalues[count] = i;\n+\t\t\t\t\tmarked[i] = 1;\n+\t\t\t\t\tcount++;\n+\t\t\t\t}\n+\t\t\t}\n+\t\t\tmin = maxsize;\n+\t\t} else\n+\t\t\treturn -1;\n+\t\tlist = end + 1;\n+\t} while (*end != '\\0');\n+\n+\tif (count == 0)\n+\t\treturn -1;\n+\treturn count;\n+}\n+\n+void\n+parse_fwd_portlist(const char *portlist)\n+{\n+\tint portcount;\n+\tunsigned int portindex[RTE_MAX_ETHPORTS];\n+\tint i, valid_port_count = 0;\n+\n+\tportcount = parse_port_list(portlist, portindex, RTE_MAX_ETHPORTS);\n+\tif (portcount < 0)\n+\t\trte_exit(EXIT_FAILURE, \"Invalid fwd port list\\n\");\n+\n+\t/*\n+\t * Here we verify the validity of the ports\n+\t * and thereby calculate the total number of\n+\t * valid ports\n+\t */\n+\tfor (i = 0; i < portcount && valid_port_count < portcount; i++) {\n+\t\tif (rte_eth_dev_is_valid_port(portindex[i])) {\n+\t\t\tportindex[valid_port_count] = portindex[i];\n+\t\t\tvalid_port_count++;\n+\t\t}\n+\t}\n+\n+\tset_fwd_ports_list(portindex, valid_port_count);\n+}\n+\n void\n set_fwd_ports_mask(uint64_t portmask)\n {\ndiff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c\nindex 6340104..404dba2 100644\n--- a/app/test-pmd/parameters.c\n+++ b/app/test-pmd/parameters.c\n@@ -57,6 +57,7 @@ usage(char* progname)\n \t       \"[--help|-h] | [--auto-start|-a] | [\"\n \t       \"--tx-first | --stats-period=PERIOD | \"\n \t       \"--coremask=COREMASK --portmask=PORTMASK --numa \"\n+\t       \"--portlist=PORTLIST \"\n \t       \"--mbuf-size= | --total-num-mbufs= | \"\n \t       \"--nb-cores= | --nb-ports= | \"\n #ifdef RTE_LIBRTE_CMDLINE\n@@ -92,6 +93,7 @@ usage(char* progname)\n \t       \"packet forwarding.\\n\");\n \tprintf(\"  --portmask=PORTMASK: hexadecimal bitmask of ports used \"\n \t       \"by the packet forwarding test.\\n\");\n+\tprintf(\"  --portlist=PORTLIST: list of forwarding ports\\n\");\n \tprintf(\"  --numa: enable NUMA-aware allocation of RX/TX rings and of \"\n \t       \"RX memory buffers (mbufs).\\n\");\n \tprintf(\"  --port-numa-config=(port,socket)[,(port,socket)]: \"\n@@ -587,6 +589,7 @@ launch_args_parse(int argc, char** argv)\n \t\t{ \"nb-ports\",\t\t\t1, 0, 0 },\n \t\t{ \"coremask\",\t\t\t1, 0, 0 },\n \t\t{ \"portmask\",\t\t\t1, 0, 0 },\n+\t\t{ \"portlist\",\t\t\t1, 0, 0 },\n \t\t{ \"numa\",\t\t\t0, 0, 0 },\n \t\t{ \"no-numa\",\t\t\t0, 0, 0 },\n \t\t{ \"mp-anon\",\t\t\t0, 0, 0 },\n@@ -825,6 +828,8 @@ launch_args_parse(int argc, char** argv)\n \t\t\t\tparse_fwd_coremask(optarg);\n \t\t\tif (!strcmp(lgopts[opt_idx].name, \"portmask\"))\n \t\t\t\tparse_fwd_portmask(optarg);\n+\t\t\tif (!strcmp(lgopts[opt_idx].name, \"portlist\"))\n+\t\t\t\tparse_fwd_portlist(optarg);\n \t\t\tif (!strcmp(lgopts[opt_idx].name, \"no-numa\"))\n \t\t\t\tnuma_support = 0;\n \t\t\tif (!strcmp(lgopts[opt_idx].name, \"numa\"))\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex 3dd5fc7..33ef3e2 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -614,6 +614,9 @@ lcore_num(void)\n \trte_panic(\"lcore_id of current thread not found in fwd_lcores_cpuids\\n\");\n }\n \n+void\n+parse_fwd_portlist(const char *port);\n+\n static inline struct fwd_lcore *\n current_fwd_lcore(void)\n {\ndiff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst\nindex 9ab4d70..727ef52 100644\n--- a/doc/guides/testpmd_app_ug/run_app.rst\n+++ b/doc/guides/testpmd_app_ug/run_app.rst\n@@ -77,6 +77,13 @@ The command line options are:\n \n     Set the hexadecimal bitmask of the ports used by the packet forwarding test.\n \n+*   ``--portlist=X``\n+\n+      Set the forwarding ports based on the user input used by the packet forwarding test.\n+      '-' denotes a range of ports to set including the two specified port IDs\n+      ',' separates multiple port values.\n+      Possible examples like --portlist=0,1 or --portlist=0-2 or --portlist=0,1-2 etc\n+\n *   ``--numa``\n \n     Enable NUMA-aware allocation of RX/TX rings and of RX memory buffers\n",
    "prefixes": [
        "v7"
    ]
}