get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1456,
    "url": "https://patches.dpdk.org/api/patches/1456/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1416692622-28886-8-git-send-email-thomas.monjalon@6wind.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": "<1416692622-28886-8-git-send-email-thomas.monjalon@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1416692622-28886-8-git-send-email-thomas.monjalon@6wind.com",
    "date": "2014-11-22T21:43:39",
    "name": "[dpdk-dev,07/10] eal: add core list input format",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "88858eb58f30bbb55da8ff4faa71324e87d1bde7",
    "submitter": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/people/1/?format=api",
        "name": "Thomas Monjalon",
        "email": "thomas.monjalon@6wind.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1416692622-28886-8-git-send-email-thomas.monjalon@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1456/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1456/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 D9C8F7FD2;\n\tSat, 22 Nov 2014 22:33:50 +0100 (CET)",
            "from mail-wg0-f49.google.com (mail-wg0-f49.google.com\n\t[74.125.82.49]) by dpdk.org (Postfix) with ESMTP id 2390B7FAD\n\tfor <dev@dpdk.org>; Sat, 22 Nov 2014 22:33:47 +0100 (CET)",
            "by mail-wg0-f49.google.com with SMTP id x12so9280193wgg.36\n\tfor <dev@dpdk.org>; Sat, 22 Nov 2014 13:44:27 -0800 (PST)",
            "from localhost.localdomain (136-92-190-109.dsl.ovh.fr.\n\t[109.190.92.136]) by mx.google.com with ESMTPSA id\n\tcz3sm13724087wjb.23.2014.11.22.13.44.25 for <multiple recipients>\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tSat, 22 Nov 2014 13:44:26 -0800 (PST)"
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=Z5JKrcdIbaddLVTjjFhcePz1NtJhVsufGleTwT1MtFc=;\n\tb=cqQm5BvauEmeCTO0exMpyfiYVeZ23j+6jaqHWAGMVliMYwkml3RK7DkjTTkI0tluBZ\n\t/KvgKQZWWlOxVFVMiWU2BqVhmtBcuSg5zbNIJTT/TzIoGt3hFz31nYLm3k7WkiL19gX2\n\tq64u/XqfmqqrYTfKSIzBn3LK9LKNkD/ejLPj8uWPPM6f3Bn0kJQsJ+cNe9nyZx85YZ3x\n\te8vk8421Yf/57HQpE0lQ59wYcBAh9DTAGWwTnN33uPiRtYtA5t4M8ANUN8HCYr8P6Vit\n\twXTXyLuXU6IxQ7WarspADFYbmgg1T8pck7l8hmKRF6k8l8M42d9rwnCEPQZWkJcv0BHv\n\ttW7Q==",
        "X-Gm-Message-State": "ALoCoQmSp73U/uT2qUvhYA5OLnODzDXA5kufk1wdGGZQgI36qd9XDZ4+l5zZR6H64523hiI15vFS",
        "X-Received": "by 10.180.95.74 with SMTP id di10mr8676519wib.54.1416692667686; \n\tSat, 22 Nov 2014 13:44:27 -0800 (PST)",
        "From": "Thomas Monjalon <thomas.monjalon@6wind.com>",
        "To": "dev@dpdk.org",
        "Date": "Sat, 22 Nov 2014 22:43:39 +0100",
        "Message-Id": "<1416692622-28886-8-git-send-email-thomas.monjalon@6wind.com>",
        "X-Mailer": "git-send-email 2.1.3",
        "In-Reply-To": "<1416692622-28886-1-git-send-email-thomas.monjalon@6wind.com>",
        "References": "<1416692622-28886-1-git-send-email-thomas.monjalon@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH 07/10] eal: add core list input format",
        "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": "From: Didier Pallard <didier.pallard@6wind.com>\n\nIn current version, used cores can only be specified using a bitmask.\nIt will now be possible to specify cores in 2 different ways:\n- Using a bitmask (-c [0x]nnn): bitmask must be in hex format\n- Using a list in following format: -l <c1>[-c2][,c3[-c4],...]\n\nThe letter -l can stand for lcore or list.\n\n-l 0-7,16-23,31 being equivalent to -c 0x80FF00FF\n\nSigned-off-by: Didier Pallard <didier.pallard@6wind.com>\nSigned-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>\n---\n app/test/test_eal_flags.c                  | 28 ++++++++++-\n lib/librte_eal/common/eal_common_options.c | 81 ++++++++++++++++++++++++++++--\n 2 files changed, 103 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/app/test/test_eal_flags.c b/app/test/test_eal_flags.c\nindex 1f95d7f..5ad89c5 100644\n--- a/app/test/test_eal_flags.c\n+++ b/app/test/test_eal_flags.c\n@@ -484,7 +484,7 @@ test_invalid_r_flag(void)\n }\n \n /*\n- * Test that the app doesn't run without the coremask flag. In all cases\n+ * Test that the app doesn't run without the coremask/corelist flags. In all cases\n  * should give an error and fail to run\n  */\n static int\n@@ -504,12 +504,22 @@ test_missing_c_flag(void)\n \n \t/* -c flag but no coremask value */\n \tconst char *argv1[] = { prgname, prefix, mp_flag, \"-n\", \"3\", \"-c\"};\n-\t/* No -c flag at all */\n+\t/* No -c or -l flag at all */\n \tconst char *argv2[] = { prgname, prefix, mp_flag, \"-n\", \"3\"};\n \t/* bad coremask value */\n \tconst char *argv3[] = { prgname, prefix, mp_flag, \"-n\", \"3\", \"-c\", \"error\" };\n \t/* sanity check of tests - valid coremask value */\n \tconst char *argv4[] = { prgname, prefix, mp_flag, \"-n\", \"3\", \"-c\", \"1\" };\n+\t/* -l flag but no corelist value */\n+\tconst char *argv5[] = { prgname, prefix, mp_flag, \"-n\", \"3\", \"-l\"};\n+\tconst char *argv6[] = { prgname, prefix, mp_flag, \"-n\", \"3\", \"-l\", \" \" };\n+\t/* bad corelist values */\n+\tconst char *argv7[] = { prgname, prefix, mp_flag, \"-n\", \"3\", \"-l\", \"error\" };\n+\tconst char *argv8[] = { prgname, prefix, mp_flag, \"-n\", \"3\", \"-l\", \"1-\" };\n+\tconst char *argv9[] = { prgname, prefix, mp_flag, \"-n\", \"3\", \"-l\", \"1,\" };\n+\tconst char *argv10[] = { prgname, prefix, mp_flag, \"-n\", \"3\", \"-l\", \"1#2\" };\n+\t/* sanity check test - valid corelist value */\n+\tconst char *argv11[] = { prgname, prefix, mp_flag, \"-n\", \"3\", \"-l\", \"1-2,3\" };\n \n \tif (launch_proc(argv1) == 0\n \t\t\t|| launch_proc(argv2) == 0\n@@ -521,6 +531,20 @@ test_missing_c_flag(void)\n \t\tprintf(\"Error - process did not run ok with valid coremask value\\n\");\n \t\treturn -1;\n \t}\n+\n+\tif (launch_proc(argv5) == 0\n+\t\t\t|| launch_proc(argv6) == 0\n+\t\t\t|| launch_proc(argv7) == 0\n+\t\t\t|| launch_proc(argv8) == 0\n+\t\t\t|| launch_proc(argv9) == 0\n+\t\t\t|| launch_proc(argv10) == 0) {\n+\t\tprintf(\"Error - process ran without error with invalid -l flag\\n\");\n+\t\treturn -1;\n+\t}\n+\tif (launch_proc(argv11) != 0) {\n+\t\tprintf(\"Error - process did not run ok with valid corelist value\\n\");\n+\t\treturn -1;\n+\t}\n \treturn 0;\n }\n \ndiff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c\nindex 63710b0..18d03e3 100644\n--- a/lib/librte_eal/common/eal_common_options.c\n+++ b/lib/librte_eal/common/eal_common_options.c\n@@ -32,6 +32,7 @@\n  */\n \n #include <stdlib.h>\n+#include <unistd.h>\n #include <string.h>\n #include <syslog.h>\n #include <ctype.h>\n@@ -55,8 +56,9 @@ const char\n eal_short_options[] =\n \t\"b:\" /* pci-blacklist */\n \t\"w:\" /* pci-whitelist */\n-\t\"c:\"\n+\t\"c:\" /* coremask */\n \t\"d:\"\n+\t\"l:\" /* corelist */\n \t\"m:\"\n \t\"n:\"\n \t\"r:\"\n@@ -205,6 +207,67 @@ eal_parse_coremask(const char *coremask)\n }\n \n static int\n+eal_parse_corelist(const char *corelist)\n+{\n+\tstruct rte_config *cfg = rte_eal_get_configuration();\n+\tint i, idx = 0;\n+\tunsigned count = 0;\n+\tchar *end = NULL;\n+\tint min, max;\n+\n+\tif (corelist == NULL)\n+\t\treturn -1;\n+\n+\t/* Remove all blank characters ahead and after */\n+\twhile (isblank(*corelist))\n+\t\tcorelist++;\n+\ti = strnlen(corelist, sysconf(_SC_ARG_MAX));\n+\twhile ((i > 0) && isblank(corelist[i - 1]))\n+\t\ti--;\n+\n+\t/* Reset core roles */\n+\tfor (idx = 0; idx < RTE_MAX_LCORE; idx++)\n+\t\tcfg->lcore_role[idx] = ROLE_OFF;\n+\n+\t/* Get list of cores */\n+\tmin = RTE_MAX_LCORE;\n+\tdo {\n+\t\twhile (isblank(*corelist))\n+\t\t\tcorelist++;\n+\t\tif (*corelist == '\\0')\n+\t\t\treturn -1;\n+\t\terrno = 0;\n+\t\tidx = strtoul(corelist, &end, 10);\n+\t\tif (errno || end == NULL)\n+\t\t\treturn -1;\n+\t\twhile (isblank(*end))\n+\t\t\tend++;\n+\t\tif (*end == '-') {\n+\t\t\tmin = idx;\n+\t\t} else if ((*end == ',') || (*end == '\\0')) {\n+\t\t\tmax = idx;\n+\t\t\tif (min == RTE_MAX_LCORE)\n+\t\t\t\tmin = idx;\n+\t\t\tfor (idx = min; idx <= max; idx++) {\n+\t\t\t\tcfg->lcore_role[idx] = ROLE_RTE;\n+\t\t\t\tif (count == 0)\n+\t\t\t\t\tcfg->master_lcore = idx;\n+\t\t\t\tcount++;\n+\t\t\t}\n+\t\t\tmin = RTE_MAX_LCORE;\n+\t\t} else\n+\t\t\treturn -1;\n+\t\tcorelist = end + 1;\n+\t} while (*end != '\\0');\n+\n+\tif (count == 0)\n+\t\treturn -1;\n+\n+\tlcores_parsed = 1;\n+\treturn 0;\n+}\n+\n+static int\n eal_parse_syslog(const char *facility, struct internal_config *conf)\n {\n \tint i;\n@@ -304,6 +367,13 @@ eal_parse_common_option(int opt, const char *optarg,\n \t\t\treturn -1;\n \t\t}\n \t\tbreak;\n+\t/* corelist */\n+\tcase 'l':\n+\t\tif (eal_parse_corelist(optarg) < 0) {\n+\t\t\tRTE_LOG(ERR, EAL, \"invalid core list\\n\");\n+\t\t\treturn -1;\n+\t\t}\n+\t\tbreak;\n \t/* size of memory */\n \tcase 'm':\n \t\tconf->memory = atoi(optarg);\n@@ -421,8 +491,8 @@ eal_check_common_options(struct internal_config *internal_cfg)\n \tstruct rte_config *cfg = rte_eal_get_configuration();\n \n \tif (!lcores_parsed) {\n-\t\tRTE_LOG(ERR, EAL, \"CPU cores must be enabled with option \"\n-\t\t\t\"-c\\n\");\n+\t\tRTE_LOG(ERR, EAL, \"CPU cores must be enabled with options \"\n+\t\t\t\"-c or -l\\n\");\n \t\treturn -1;\n \t}\n \n@@ -470,6 +540,9 @@ eal_common_usage(void)\n \t       \"[--proc-type primary|secondary|auto]\\n\\n\"\n \t       \"EAL common options:\\n\"\n \t       \"  -c COREMASK  : A hexadecimal bitmask of cores to run on\\n\"\n+\t       \"  -l CORELIST  : List of cores to run on\\n\"\n+\t       \"                 The argument format is <c1>[-c2][,c3[-c4],...]\\n\"\n+\t       \"                 where c1, c2, etc are core indexes between 0 and %d\\n\"\n \t       \"  -n NUM       : Number of memory channels\\n\"\n \t       \"  -v           : Display version information on startup\\n\"\n \t       \"  -m MB        : memory to allocate (see also --\"OPT_SOCKET_MEM\")\\n\"\n@@ -494,5 +567,5 @@ eal_common_usage(void)\n \t       \"  --\"OPT_NO_PCI\"   : disable pci\\n\"\n \t       \"  --\"OPT_NO_HPET\"  : disable hpet\\n\"\n \t       \"  --\"OPT_NO_SHCONF\": no shared config (mmap'd files)\\n\"\n-\t       \"\\n\");\n+\t       \"\\n\", RTE_MAX_LCORE);\n }\n",
    "prefixes": [
        "dpdk-dev",
        "07/10"
    ]
}