get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 42906,
    "url": "http://patches.dpdk.org/api/patches/42906/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/e30f783a6dc3f385b878b2f7a7e62a184ed904e4.1531345404.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": "<e30f783a6dc3f385b878b2f7a7e62a184ed904e4.1531345404.git.gaetan.rivet@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/e30f783a6dc3f385b878b2f7a7e62a184ed904e4.1531345404.git.gaetan.rivet@6wind.com",
    "date": "2018-07-11T21:45:03",
    "name": "[v11,13/25] bus/pci: implement device iteration and comparison",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f5c99841aa1ca2ca7beca12ac34dc8d3cea5a72d",
    "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/e30f783a6dc3f385b878b2f7a7e62a184ed904e4.1531345404.git.gaetan.rivet@6wind.com/mbox/",
    "series": [
        {
            "id": 533,
            "url": "http://patches.dpdk.org/api/series/533/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=533",
            "date": "2018-07-11T21:44:50",
            "name": "Device querying",
            "version": 11,
            "mbox": "http://patches.dpdk.org/series/533/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/42906/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/42906/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 E2C591B5E5;\n\tWed, 11 Jul 2018 23:46:07 +0200 (CEST)",
            "from mail-wm0-f65.google.com (mail-wm0-f65.google.com\n\t[74.125.82.65]) by dpdk.org (Postfix) with ESMTP id BB7221B590\n\tfor <dev@dpdk.org>; Wed, 11 Jul 2018 23:45:54 +0200 (CEST)",
            "by mail-wm0-f65.google.com with SMTP id v128-v6so3681717wme.5\n\tfor <dev@dpdk.org>; Wed, 11 Jul 2018 14:45:54 -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\th5-v6sm10550936wrr.19.2018.07.11.14.45.52\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 11 Jul 2018 14:45:52 -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:content-transfer-encoding;\n\tbh=h0xkCD8pXmexmiB8DVL8tN3zJgZ4vg1US2nLekosT40=;\n\tb=RWokiLZwLxhOlTEc6IVE7CGAtoB5iewUpurHEUV/yAyjj8OJTw1hWRFCRhyYzRvgp3\n\tIajGmuDmeLpM+1/VW5BISada1t4pobst0ENJQWsQ6IMMk8rK5fYHwFXGgYU/4pac8HcW\n\tvNFIakQY/HZSL6z2JLkva/1qUWyXKkL6Elx9346aoQPLG+k7/Qg6wUPXBv3iLuweaZVg\n\tuLj2G/GaA5TWZ+auvBSjI9ZK8HUu96QYc/At2EA/mq3Zs/60f8ZHo5HoMNY63JfjYUvj\n\t1Kf+HKSe+BueSoJSiovJ4cLSwJ8ZA0tkgzIIluCPtd4pQFs9qJU4Gs1wTX9bfFKe9DQg\n\tjckQ==",
        "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:content-transfer-encoding;\n\tbh=h0xkCD8pXmexmiB8DVL8tN3zJgZ4vg1US2nLekosT40=;\n\tb=dNHSIsdCfY2AB3rGZdHz3iOyAw75phyWpzA1wXgJ2p4Lr42hifisJFkXU7NLsfx7E3\n\t5UZZDmyw5eNJzZOBT432Dqv224r54te52c44b6UoZLk6NGgmsoiF95pg1YCY3OHlMUxA\n\ttjQIZSvabcCZzEfw0plgCIxM4CIlTb4acnGsJTl7CkVJ+jW884KJJcVIO2tXS3TFNCMj\n\tHHNZ5e3DvmFszZrzYIxbpng3c35X1Tm0eT1m5ehKs61VElbl2z32egs82eClFvtQhnhA\n\t3sjlEUODAZDuM9StZ4+hPaqdQYnCXXJFjrRF/yEmhXIWHt3H6LdzFN2eBiD1GUGJj1Yn\n\tTnmA==",
        "X-Gm-Message-State": "AOUpUlGT+ykyRCPwDZMCdjVtNS1WOLxo3uaRKkeioP1W1g7DYXVZUc4c\n\t3hVmdRa083tFwxWi4JccmbR+0qzp",
        "X-Google-Smtp-Source": "AAOMgpd9Y+V3+UqlUUUC8SMZ9JvVPGZUIiYCUmTCI606R5ac2J6jVgE/NSO2M3rdtk26Fz74R9aRYQ==",
        "X-Received": "by 2002:a1c:149:: with SMTP id 70-v6mr161540wmb.2.1531345554029; \n\tWed, 11 Jul 2018 14:45:54 -0700 (PDT)",
        "From": "Gaetan Rivet <gaetan.rivet@6wind.com>",
        "To": "dev@dpdk.org",
        "Cc": "Gaetan Rivet <gaetan.rivet@6wind.com>",
        "Date": "Wed, 11 Jul 2018 23:45:03 +0200",
        "Message-Id": "<e30f783a6dc3f385b878b2f7a7e62a184ed904e4.1531345404.git.gaetan.rivet@6wind.com>",
        "X-Mailer": "git-send-email 2.18.0",
        "In-Reply-To": "<cover.1531345404.git.gaetan.rivet@6wind.com>",
        "References": "<cover.1531345404.git.gaetan.rivet@6wind.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v11 13/25] bus/pci: implement device iteration\n\tand comparison",
        "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/pci/Makefile     |  3 +-\n drivers/bus/pci/meson.build  |  6 +++-\n drivers/bus/pci/pci_common.c |  3 +-\n drivers/bus/pci/pci_params.c | 53 ++++++++++++++++++++++++++++++++++++\n drivers/bus/pci/private.h    | 25 +++++++++++++++++\n 5 files changed, 86 insertions(+), 4 deletions(-)\n create mode 100644 drivers/bus/pci/pci_params.c",
    "diff": "diff --git a/drivers/bus/pci/Makefile b/drivers/bus/pci/Makefile\nindex cf373068a..4de953f8f 100644\n--- a/drivers/bus/pci/Makefile\n+++ b/drivers/bus/pci/Makefile\n@@ -26,10 +26,11 @@ CFLAGS += -I$(RTE_SDK)/lib/librte_eal/$(SYSTEM)app/eal\n CFLAGS += -DALLOW_EXPERIMENTAL_API\n \n LDLIBS += -lrte_eal -lrte_mbuf -lrte_mempool -lrte_ring\n-LDLIBS += -lrte_ethdev -lrte_pci\n+LDLIBS += -lrte_ethdev -lrte_pci -lrte_kvargs\n \n include $(RTE_SDK)/drivers/bus/pci/$(SYSTEM)/Makefile\n SRCS-$(CONFIG_RTE_LIBRTE_PCI_BUS) := $(addprefix $(SYSTEM)/,$(SRCS))\n+SRCS-$(CONFIG_RTE_LIBRTE_PCI_BUS) += pci_params.c\n SRCS-$(CONFIG_RTE_LIBRTE_PCI_BUS) += pci_common.c\n SRCS-$(CONFIG_RTE_LIBRTE_PCI_BUS) += pci_common_uio.c\n \ndiff --git a/drivers/bus/pci/meson.build b/drivers/bus/pci/meson.build\nindex 72939e598..23d6a5fec 100644\n--- a/drivers/bus/pci/meson.build\n+++ b/drivers/bus/pci/meson.build\n@@ -3,7 +3,9 @@\n \n deps += ['pci']\n install_headers('rte_bus_pci.h')\n-sources = files('pci_common.c', 'pci_common_uio.c')\n+sources = files('pci_common.c',\n+\t'pci_common_uio.c',\n+\t'pci_params.c')\n if host_machine.system() == 'linux'\n \tsources += files('linux/pci.c',\n \t\t\t'linux/pci_uio.c',\n@@ -17,3 +19,5 @@ endif\n \n # memseg walk is not part of stable API yet\n allow_experimental_apis = true\n+\n+deps += ['kvargs']\ndiff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c\nindex 94b0f4143..5b7854490 100644\n--- a/drivers/bus/pci/pci_common.c\n+++ b/drivers/bus/pci/pci_common.c\n@@ -29,8 +29,6 @@\n \n static void rte_pci_remove_device(struct rte_pci_device *pci_device);\n \n-extern struct rte_pci_bus rte_pci_bus;\n-\n #define SYSFS_PCI_DEVICES \"/sys/bus/pci/devices\"\n \n const char *rte_pci_get_sysfs_path(void)\n@@ -437,6 +435,7 @@ struct rte_pci_bus rte_pci_bus = {\n \t\t.unplug = pci_unplug,\n \t\t.parse = pci_parse,\n \t\t.get_iommu_class = rte_pci_get_iommu_class,\n+\t\t.dev_iterate = rte_pci_dev_iterate,\n \t},\n \t.device_list = TAILQ_HEAD_INITIALIZER(rte_pci_bus.device_list),\n \t.driver_list = TAILQ_HEAD_INITIALIZER(rte_pci_bus.driver_list),\ndiff --git a/drivers/bus/pci/pci_params.c b/drivers/bus/pci/pci_params.c\nnew file mode 100644\nindex 000000000..0fde75803\n--- /dev/null\n+++ b/drivers/bus/pci/pci_params.c\n@@ -0,0 +1,53 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2018 Gaëtan Rivet\n+ */\n+\n+#include <rte_bus.h>\n+#include <rte_dev.h>\n+#include <rte_errno.h>\n+#include <rte_kvargs.h>\n+#include <rte_pci.h>\n+\n+#include \"private.h\"\n+\n+enum pci_params {\n+\tRTE_PCI_PARAMS_MAX,\n+};\n+\n+static const char * const pci_params_keys[] = {\n+\t[RTE_PCI_PARAMS_MAX] = NULL,\n+};\n+\n+static int\n+pci_dev_match(const struct rte_device *dev,\n+\t      const void *_kvlist)\n+{\n+\tconst struct rte_kvargs *kvlist = _kvlist;\n+\n+\t(void) dev;\n+\t(void) kvlist;\n+\treturn 0;\n+}\n+\n+void *\n+rte_pci_dev_iterate(const void *start,\n+\t\t    const char *str,\n+\t\t    const struct rte_dev_iterator *it __rte_unused)\n+{\n+\trte_bus_find_device_t find_device;\n+\tstruct rte_kvargs *kvargs = NULL;\n+\tstruct rte_device *dev;\n+\n+\tif (str != NULL) {\n+\t\tkvargs = rte_kvargs_parse(str, pci_params_keys);\n+\t\tif (kvargs == NULL) {\n+\t\t\tRTE_LOG(ERR, EAL, \"cannot parse argument list\\n\");\n+\t\t\trte_errno = EINVAL;\n+\t\t\treturn NULL;\n+\t\t}\n+\t}\n+\tfind_device = rte_pci_bus.bus.find_device;\n+\tdev = find_device(start, pci_dev_match, kvargs);\n+\trte_kvargs_free(kvargs);\n+\treturn dev;\n+}\ndiff --git a/drivers/bus/pci/private.h b/drivers/bus/pci/private.h\nindex 8ddd03e16..0e689fa74 100644\n--- a/drivers/bus/pci/private.h\n+++ b/drivers/bus/pci/private.h\n@@ -10,6 +10,8 @@\n #include <rte_pci.h>\n #include <rte_bus_pci.h>\n \n+extern struct rte_pci_bus rte_pci_bus;\n+\n struct rte_pci_driver;\n struct rte_pci_device;\n \n@@ -166,4 +168,27 @@ rte_pci_match(const struct rte_pci_driver *pci_drv,\n enum rte_iova_mode\n rte_pci_get_iommu_class(void);\n \n+/*\n+ * Iterate over internal devices,\n+ * matching any device against the provided\n+ * string.\n+ *\n+ * @param start\n+ *   Iteration starting point.\n+ *\n+ * @param str\n+ *   Device string to match against.\n+ *\n+ * @param it\n+ *   (unused) iterator structure.\n+ *\n+ * @return\n+ *   A pointer to the next matching device if any.\n+ *   NULL otherwise.\n+ */\n+void *\n+rte_pci_dev_iterate(const void *start,\n+\t\t    const char *str,\n+\t\t    const struct rte_dev_iterator *it);\n+\n #endif /* _PCI_PRIVATE_H_ */\n",
    "prefixes": [
        "v11",
        "13/25"
    ]
}