get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 24572,
    "url": "https://patches.dpdk.org/api/patches/24572/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/ce74c2d6064dc73c95ff55e0b5c1cea41366676c.1495642399.git.gaetan.rivet@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": "<ce74c2d6064dc73c95ff55e0b5c1cea41366676c.1495642399.git.gaetan.rivet@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/ce74c2d6064dc73c95ff55e0b5c1cea41366676c.1495642399.git.gaetan.rivet@6wind.com",
    "date": "2017-05-24T16:16:49",
    "name": "[dpdk-dev,v2,14/14] devargs: introduce cleaner parsing helper",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "29caa1a5cca3fdb80659335080763c152489f707",
    "submitter": {
        "id": 269,
        "url": "https://patches.dpdk.org/api/people/269/?format=api",
        "name": "Gaëtan Rivet",
        "email": "gaetan.rivet@6wind.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/ce74c2d6064dc73c95ff55e0b5c1cea41366676c.1495642399.git.gaetan.rivet@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/24572/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/24572/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 92B569998;\n\tWed, 24 May 2017 18:17:55 +0200 (CEST)",
            "from mail-wr0-f170.google.com (mail-wr0-f170.google.com\n\t[209.85.128.170]) by dpdk.org (Postfix) with ESMTP id 2AEE59177\n\tfor <dev@dpdk.org>; Wed, 24 May 2017 18:17:16 +0200 (CEST)",
            "by mail-wr0-f170.google.com with SMTP id j27so4272704wre.1\n\tfor <dev@dpdk.org>; Wed, 24 May 2017 09:17:16 -0700 (PDT)",
            "from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com.\n\t[62.23.145.78]) by smtp.gmail.com with ESMTPSA id\n\t17sm5816909wml.32.2017.05.24.09.17.13\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tWed, 24 May 2017 09:17:13 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:in-reply-to:references;\n\tbh=SCezPnAHRY3PUDDcmOtRiSG+AZcN8/l8GGmvvKBRENE=;\n\tb=Xdx1Xv2fS3BuC+YfrhaVpTeCPlc/aYq6yFYvyqNfEOdDQrSRuZsrB7nkmgcVu+VXkh\n\tX38fEj0fuBCWEcT1x2v5qYOivdhgrwcyZky+zcLwVEksJdGTpuf2YsmKeL5lskA6SvGw\n\taHmlPvG6LzmYg6q7lSV+wz4lE4PXwkUt5cZKy+ReBJnPucIFQy8q2uiHSsKzv4mffq4O\n\tUko8/uISpeRcO3Ab/vUStwJERtwNHIMyObEeW6e+UjAUv6GcC8FC7679VFuOTYSPdPBr\n\ttqrehjOHCDOQpiFMNG2/c0o1aLGno+7Jr+Fxk73u0Cr2RW9Gdm6iDl13SiqLN4QOVk0K\n\tA1gA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:in-reply-to:references;\n\tbh=SCezPnAHRY3PUDDcmOtRiSG+AZcN8/l8GGmvvKBRENE=;\n\tb=XJEbzuArrrcfp7I/rSghWgKKD/wiv6ZnWzXI3KBP6PqVRSODM8CU1Awzrg4Xrm1cHL\n\tAG3JLz9UzIFRNQBDqO/iRiUyhMnqd84pMv3GoZEh5wJ4loFWy66sHuKSUCD7S7Nkjo6v\n\tR/c8cSUFAXCUGaBz8Z3d97FWrNHie4rcdFkVZid/AtiHL4QML6M8IsZf4wtpI1fhpgvi\n\tif5F4ZPa0OWUxeHySeyG/xtqYxtdxwtqBP9YZgiFiV2mPH/W6+fA2OnDYWwMkgFu2hjz\n\tJP/whB7dMc1cn0DiE9UwpiqXWGDfG1bYLJUfGqQir1Sxck8SbarPMtZ6t1tTDMHh7Q3B\n\thIRw==",
        "X-Gm-Message-State": "AODbwcC3FcTP4ig+W38gKdWPIW9d0OhCncrBoliTAburOGkd3VpVhhsE\n\tZTGFM8s076GaTKxl",
        "X-Received": "by 10.223.175.17 with SMTP id z17mr19549226wrc.11.1495642634800; \n\tWed, 24 May 2017 09:17:14 -0700 (PDT)",
        "From": "Gaetan Rivet <gaetan.rivet@6wind.com>",
        "To": "dev@dpdk.org",
        "Cc": "Gaetan Rivet <gaetan.rivet@6wind.com>",
        "Date": "Wed, 24 May 2017 18:16:49 +0200",
        "Message-Id": "<ce74c2d6064dc73c95ff55e0b5c1cea41366676c.1495642399.git.gaetan.rivet@6wind.com>",
        "X-Mailer": "git-send-email 2.1.4",
        "In-Reply-To": [
            "<cover.1495642399.git.gaetan.rivet@6wind.com>",
            "<cover.1495642399.git.gaetan.rivet@6wind.com>"
        ],
        "References": [
            "<cover.1495629181.git.gaetan.rivet@6wind.com>\n\t<cover.1495642399.git.gaetan.rivet@6wind.com>",
            "<cover.1495642399.git.gaetan.rivet@6wind.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v2 14/14] devargs: introduce cleaner parsing\n\thelper",
        "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": "Introduce a more versatile helper to parse device strings. This\nhelper expects a generic rte_devargs structure as storage in order not\nto require any API changes in the future, should this structure be\nupdated.\n\nThe old equivalent function is thus being deprecated, as its API does\nnot allow to accompany current rte_devargs evolutions.\n\nA deprecation notice is issued.\n\nThis new helper will parse bus information as well as device name and\ndevice parameters. It does not allocate an rte_devargs structure and\nexpects one to be given as input.\n\nSigned-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>\n---\n doc/guides/rel_notes/deprecation.rst        |  5 ++\n lib/librte_eal/common/eal_common_devargs.c  | 86 ++++++++++++++++++++---------\n lib/librte_eal/common/include/rte_devargs.h | 20 +++++++\n 3 files changed, 85 insertions(+), 26 deletions(-)",
    "diff": "diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst\nindex ba9b5a2..f90cd87 100644\n--- a/doc/guides/rel_notes/deprecation.rst\n+++ b/doc/guides/rel_notes/deprecation.rst\n@@ -128,3 +128,8 @@ Deprecation Notices\n   The non-\"do-sig\" versions of the hash tables will be removed\n   (including the ``signature_offset`` parameter)\n   and the \"do-sig\" versions renamed accordingly.\n+\n+* eal: the following function is deprecated starting from 17.08 and will\n+  be removed in 17.11:\n+\n+  - ``rte_eal_parse_devargs_str``, replaced by ``rte_eal_devargs_parse``\ndiff --git a/lib/librte_eal/common/eal_common_devargs.c b/lib/librte_eal/common/eal_common_devargs.c\nindex d423125..7bca015 100644\n--- a/lib/librte_eal/common/eal_common_devargs.c\n+++ b/lib/librte_eal/common/eal_common_devargs.c\n@@ -77,44 +77,80 @@ rte_eal_parse_devargs_str(const char *devargs_str,\n \treturn 0;\n }\n \n-/* store a whitelist parameter for later parsing */\n int\n-rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)\n+rte_eal_devargs_parse(const char *dev,\n+\t\t      struct rte_devargs *da)\n {\n-\tstruct rte_devargs *devargs = NULL;\n-\tconst char *dev = devargs_str;\n \tstruct rte_bus *bus;\n-\tchar *buf = NULL;\n+\tconst char *c;\n+\tconst size_t maxlen = sizeof(da->name);\n \tsize_t i;\n-\tint ret;\n-\n-\t/* use malloc instead of rte_malloc as it's called early at init */\n-\tdevargs = malloc(sizeof(*devargs));\n-\tif (devargs == NULL)\n-\t\tgoto fail;\n-\n-\tmemset(devargs, 0, sizeof(*devargs));\n-\tdevargs->type = devtype;\n \n+\tif ((dev) == NULL || (da) == NULL)\n+\t\treturn -EINVAL;\n+\tc = dev;\n+\t/* Retrieve eventual bus info */\n \tbus = rte_bus_from_name(dev);\n \tif (bus) {\n \t\ti = rte_bus_name_valid(dev);\n-\t\tdev += i + 1;\n-\t} else {\n-\t\tbus = rte_bus_from_dev(dev);\n+\t\tif (dev[i] == '\\0') {\n+\t\t\tfprintf(stderr, \"WARNING: device name matches a bus name.\\n\");\n+\t\t\tbus = NULL;\n+\t\t} else {\n+\t\t\tc = &dev[i+1];\n+\t\t}\n+\t}\n+\t/* Store device name */\n+\ti = 0;\n+\twhile (c[i] != '\\0' && c[i] != ',') {\n+\t\tda->name[i] = c[i];\n+\t\ti++;\n+\t\tif (i == maxlen) {\n+\t\t\tfprintf(stderr, \"WARNING: Parsing \\\"%s\\\": device name should be shorter than %zu\\n\",\n+\t\t\t\tdev, maxlen);\n+\t\t\tda->name[i-1] = '\\0';\n+\t\t\treturn -EINVAL;\n+\t\t}\n+\t}\n+\tda->name[i] = '\\0';\n+\tif (!bus) {\n+\t\tbus = rte_bus_from_dev(da->name);\n \t\tif (!bus) {\n-\t\t\tfprintf(stderr, \"ERROR: failed to parse bus info from device declaration\\n\");\n-\t\t\tgoto fail;\n+\t\t\tfprintf(stderr, \"ERROR: failed to parse bus info from device \\\"%s\\\"\\n\",\n+\t\t\t\tda->name);\n+\t\t\treturn -EFAULT;\n \t\t}\n \t}\n-\tdevargs->bus = bus;\n-\tif (rte_eal_parse_devargs_str(dev, &buf, &devargs->args))\n+\tda->bus = bus;\n+\t/* Parse eventual device arguments */\n+\tif (c[i] == ',')\n+\t\tda->args = strdup(&c[i+1]);\n+\telse\n+\t\tda->args = strdup(\"\");\n+\tif (da->args == NULL) {\n+\t\tfprintf(stderr, \"ERROR: not enough memory to parse arguments\\n\");\n+\t\treturn -ENOMEM;\n+\t}\n+\treturn 0;\n+}\n+\n+/* store a whitelist parameter for later parsing */\n+int\n+rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)\n+{\n+\tstruct rte_devargs *devargs = NULL;\n+\tconst char *dev = devargs_str;\n+\tstruct rte_bus *bus;\n+\n+\t/* use calloc instead of rte_zmalloc as it's called early at init */\n+\tdevargs = calloc(1, sizeof(*devargs));\n+\tif (devargs == NULL)\n \t\tgoto fail;\n \n-\t/* save device name. */\n-\tret = snprintf(devargs->name, sizeof(devargs->name), \"%s\", buf);\n-\tif (ret < 0 || ret >= (int)sizeof(devargs->name))\n+\tif (rte_eal_devargs_parse(dev, devargs))\n \t\tgoto fail;\n+\tdevargs->type = devtype;\n+\tbus = devargs->bus;\n \tif (devargs->type == RTE_DEVTYPE_WHITELISTED) {\n \t\tif (bus->conf.scan_mode == RTE_BUS_SCAN_UNDEFINED) {\n \t\t\tbus->conf.scan_mode = RTE_BUS_SCAN_WHITELIST;\n@@ -131,12 +167,10 @@ rte_eal_devargs_add(enum rte_devtype devtype, const char *devargs_str)\n \t\t}\n \t}\n \n-\tfree(buf);\n \tTAILQ_INSERT_TAIL(&devargs_list, devargs, next);\n \treturn 0;\n \n fail:\n-\tfree(buf);\n \tif (devargs) {\n \t\tfree(devargs->args);\n \t\tfree(devargs);\ndiff --git a/lib/librte_eal/common/include/rte_devargs.h b/lib/librte_eal/common/include/rte_devargs.h\nindex 6e9e134..2ab8864 100644\n--- a/lib/librte_eal/common/include/rte_devargs.h\n+++ b/lib/librte_eal/common/include/rte_devargs.h\n@@ -119,6 +119,26 @@ int rte_eal_parse_devargs_str(const char *devargs_str,\n \t\t\t\tchar **drvname, char **drvargs);\n \n /**\n+ * Parse a device string.\n+ *\n+ * Verify that a bus is capable of handling the device passed\n+ * in argument. Store which bus will handle the device, its name\n+ * and the eventual device parameters.\n+ *\n+ * @param dev\n+ *   The device declaration string.\n+ * @param da\n+ *   The devargs structure holding the device information.\n+ *\n+ * @return\n+ *   - 0 on success.\n+ *   - Negative errno on error.\n+ */\n+int\n+rte_eal_devargs_parse(const char *dev,\n+\t\t      struct rte_devargs *da);\n+\n+/**\n  * Add a device to the user device list\n  *\n  * For PCI devices, the format of arguments string is \"PCI_ADDR\" or\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "14/14"
    ]
}