get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 41602,
    "url": "http://patches.dpdk.org/api/patches/41602/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/c517916ef6adc289b95249d06a8c5962c6ca2fef.1530031921.git.gaetan.rivet@6wind.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": "<c517916ef6adc289b95249d06a8c5962c6ca2fef.1530031921.git.gaetan.rivet@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/c517916ef6adc289b95249d06a8c5962c6ca2fef.1530031921.git.gaetan.rivet@6wind.com",
    "date": "2018-06-26T16:56:19",
    "name": "[v8,16/21] bus/vdev: implement device iteration",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "006dc26869453e7faba26a45d076a9f302f60594",
    "submitter": {
        "id": 269,
        "url": "http://patches.dpdk.org/api/people/269/?format=api",
        "name": "Gaëtan Rivet",
        "email": "gaetan.rivet@6wind.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/c517916ef6adc289b95249d06a8c5962c6ca2fef.1530031921.git.gaetan.rivet@6wind.com/mbox/",
    "series": [
        {
            "id": 249,
            "url": "http://patches.dpdk.org/api/series/249/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=249",
            "date": "2018-06-26T16:56:03",
            "name": "Device querying",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/249/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/41602/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/41602/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3785A1BE74;\n\tTue, 26 Jun 2018 18:57:31 +0200 (CEST)",
            "from mail-wm0-f68.google.com (mail-wm0-f68.google.com\n\t[74.125.82.68]) by dpdk.org (Postfix) with ESMTP id 65D841BDEC\n\tfor <dev@dpdk.org>; Tue, 26 Jun 2018 18:57:12 +0200 (CEST)",
            "by mail-wm0-f68.google.com with SMTP id z13-v6so2597921wma.5\n\tfor <dev@dpdk.org>; Tue, 26 Jun 2018 09:57:12 -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\tp5-v6sm2680880wre.83.2018.06.26.09.57.09\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 26 Jun 2018 09:57:10 -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:mime-version:in-reply-to:references:content-transfer-encoding;\n\tbh=6zLB/7Lvj/weV9uPcrzjEA180HzB3jVsaOXY8Z/yJZQ=;\n\tb=P1Xm7k7O+qvFUva/haIQO3C+MxOB30TqbNq08aLcznDP0j0eEvgvotcciwK9SvWcJ+\n\tG66Fhh5OTdrkrxniXS7u030K0pxsigYF9VcztMILFpRTjirfa2QgDTnOEbM0bWxpPlRs\n\tsccXRn6o0dpk0uc3OIgzfEUcj7jL3+DHQgGYLvmYWYBspC+FqpHoIZT80al6ekz2hmi7\n\tZhbt8rOJAc3gpH54tFWI4//SFUnWYyFZoB9uCCXF5fHOn89Cm5PMlhiVN8xoqvb9tdiN\n\t/pMy9ptbgbll+DtqVOFBhZIUg8+ZErP0N9BE/NuVP32RhPfjOzS7N/LoEuzplin3eQnx\n\tnR/A==",
        "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:mime-version:in-reply-to:references\n\t:content-transfer-encoding;\n\tbh=6zLB/7Lvj/weV9uPcrzjEA180HzB3jVsaOXY8Z/yJZQ=;\n\tb=aGS/LYPFuwGY7NmFaLs53+yq7ZpxK2RfAll2OWDNg+W3VyyKCPfrziTY5D8CQA2n8W\n\tj+Gy8HKf8qmQs5RHmuMRqVDX7EN7HXrjTl/hqgCeSafRwH6406hYT7t83zufdU5lz64d\n\t2p5CXeiI7IV/HhcXy0PYt1cs6rIcdGIH8ayTOzr5lBOTZu6cq25FTYRf5UehH155IM9D\n\tT3aLyryOaksUTk4wOq86xcbU0+I2JU8EILtF4JGJbXpb0ER21lzUSwI0J4lQDy+3HmWW\n\tCKpicdUwocpcEW7Q6OepDe0BJt9swDh7bR0x6iCY9WB0oW2zq83nh1MTXR4Fh1Ml3Yye\n\toxrQ==",
        "X-Gm-Message-State": "APt69E0KBevCpSo81sxn/Z8ZVIlFlPqL252xQOXBINTe0TFPOggfCVaO\n\tFM2omX5KuMJ4eDioR96f/xeHjafQ",
        "X-Google-Smtp-Source": "AAOMgpeNQU/uk7cNM6m4MqSzMMpXpyg/1+LxN4ceRBebR2gDhDDHIS+iWfUJd9Aw6xASmYUR6kOd3g==",
        "X-Received": "by 2002:a1c:8410:: with SMTP id\n\tg16-v6mr2272696wmd.26.1530032231626; \n\tTue, 26 Jun 2018 09:57:11 -0700 (PDT)",
        "From": "Gaetan Rivet <gaetan.rivet@6wind.com>",
        "To": "dev@dpdk.org",
        "Cc": "Gaetan Rivet <gaetan.rivet@6wind.com>",
        "Date": "Tue, 26 Jun 2018 18:56:19 +0200",
        "Message-Id": "<c517916ef6adc289b95249d06a8c5962c6ca2fef.1530031921.git.gaetan.rivet@6wind.com>",
        "X-Mailer": "git-send-email 2.11.0",
        "In-Reply-To": [
            "<cover.1530031921.git.gaetan.rivet@6wind.com>",
            "<cover.1530031921.git.gaetan.rivet@6wind.com>"
        ],
        "References": [
            "<cover.1521124599.git.gaetan.rivet@6wind.com>\n\t<cover.1530031921.git.gaetan.rivet@6wind.com>",
            "<cover.1530031921.git.gaetan.rivet@6wind.com>"
        ],
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v8 16/21] bus/vdev: implement device iteration",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>\n---\n drivers/bus/vdev/Makefile       |  3 ++-\n drivers/bus/vdev/vdev.c         | 10 ++++----\n drivers/bus/vdev/vdev_params.c  | 51 +++++++++++++++++++++++++++++++++++++++++\n drivers/bus/vdev/vdev_private.h | 26 +++++++++++++++++++++\n 4 files changed, 85 insertions(+), 5 deletions(-)\n create mode 100644 drivers/bus/vdev/vdev_params.c\n create mode 100644 drivers/bus/vdev/vdev_private.h",
    "diff": "diff --git a/drivers/bus/vdev/Makefile b/drivers/bus/vdev/Makefile\nindex bd0bb8955..1f9cd7ebe 100644\n--- a/drivers/bus/vdev/Makefile\n+++ b/drivers/bus/vdev/Makefile\n@@ -19,8 +19,9 @@ EXPORT_MAP := rte_bus_vdev_version.map\n LIBABIVER := 1\n \n SRCS-y += vdev.c\n+SRCS-y += vdev_params.c\n \n-LDLIBS += -lrte_eal\n+LDLIBS += -lrte_eal -lrte_kvargs\n \n #\n # Export include files\ndiff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c\nindex 6139dd551..e8518833d 100644\n--- a/drivers/bus/vdev/vdev.c\n+++ b/drivers/bus/vdev/vdev.c\n@@ -23,6 +23,7 @@\n \n #include \"rte_bus_vdev.h\"\n #include \"vdev_logs.h\"\n+#include \"vdev_private.h\"\n \n #define VDEV_MP_KEY\t\"bus_vdev_mp\"\n \n@@ -493,9 +494,9 @@ vdev_probe(void)\n \treturn ret;\n }\n \n-static struct rte_device *\n-vdev_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,\n-\t\t const void *data)\n+struct rte_device *\n+rte_vdev_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,\n+\t\t     const void *data)\n {\n \tconst struct rte_vdev_device *vstart;\n \tstruct rte_vdev_device *dev;\n@@ -532,10 +533,11 @@ vdev_unplug(struct rte_device *dev)\n static struct rte_bus rte_vdev_bus = {\n \t.scan = vdev_scan,\n \t.probe = vdev_probe,\n-\t.find_device = vdev_find_device,\n+\t.find_device = rte_vdev_find_device,\n \t.plug = vdev_plug,\n \t.unplug = vdev_unplug,\n \t.parse = vdev_parse,\n+\t.dev_iterate = rte_vdev_dev_iterate,\n };\n \n RTE_REGISTER_BUS(vdev, rte_vdev_bus);\ndiff --git a/drivers/bus/vdev/vdev_params.c b/drivers/bus/vdev/vdev_params.c\nnew file mode 100644\nindex 000000000..842a4684e\n--- /dev/null\n+++ b/drivers/bus/vdev/vdev_params.c\n@@ -0,0 +1,51 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2018 Gaëtan Rivet\n+ */\n+\n+#include <rte_dev.h>\n+#include <rte_bus.h>\n+#include <rte_kvargs.h>\n+#include <rte_errno.h>\n+\n+#include \"vdev_logs.h\"\n+#include \"vdev_private.h\"\n+\n+enum vdev_params {\n+\tRTE_VDEV_PARAMS_MAX,\n+};\n+\n+static const char * const vdev_params_keys[] = {\n+\t[RTE_VDEV_PARAMS_MAX] = NULL,\n+};\n+\n+static int\n+vdev_dev_match(const struct rte_device *dev,\n+\t       const void *_kvlist)\n+{\n+\tconst struct rte_kvargs *kvlist = _kvlist;\n+\n+\t(void) kvlist;\n+\t(void) dev;\n+\treturn 0;\n+}\n+\n+void *\n+rte_vdev_dev_iterate(const void *start,\n+\t\t     const char *str,\n+\t\t     const struct rte_dev_iterator *it __rte_unused)\n+{\n+\tstruct rte_kvargs *kvargs = NULL;\n+\tstruct rte_device *dev;\n+\n+\tif (str != NULL) {\n+\t\tkvargs = rte_kvargs_parse(str, vdev_params_keys);\n+\t\tif (kvargs == NULL) {\n+\t\t\tVDEV_LOG(ERR, \"cannot parse argument list\\n\");\n+\t\t\trte_errno = EINVAL;\n+\t\t\treturn NULL;\n+\t\t}\n+\t}\n+\tdev = rte_vdev_find_device(start, vdev_dev_match, kvargs);\n+\trte_kvargs_free(kvargs);\n+\treturn dev;\n+}\ndiff --git a/drivers/bus/vdev/vdev_private.h b/drivers/bus/vdev/vdev_private.h\nnew file mode 100644\nindex 000000000..ba6dc48ff\n--- /dev/null\n+++ b/drivers/bus/vdev/vdev_private.h\n@@ -0,0 +1,26 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2018 Gaëtan Rivet\n+ */\n+\n+#ifndef _VDEV_PRIVATE_H_\n+#define _VDEV_PRIVATE_H_\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+struct rte_device *\n+rte_vdev_find_device(const struct rte_device *start,\n+\t\t     rte_dev_cmp_t cmp,\n+\t\t     const void *data);\n+\n+void *\n+rte_vdev_dev_iterate(const void *start,\n+\t\t     const char *str,\n+\t\t     const struct rte_dev_iterator *it);\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* _VDEV_PRIVATE_H_ */\n",
    "prefixes": [
        "v8",
        "16/21"
    ]
}