get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 42902,
    "url": "http://patches.dpdk.org/api/patches/42902/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/55bada19d99b0d3edd5ca31c9a9d897162a3dec6.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": "<55bada19d99b0d3edd5ca31c9a9d897162a3dec6.1531345404.git.gaetan.rivet@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/55bada19d99b0d3edd5ca31c9a9d897162a3dec6.1531345404.git.gaetan.rivet@6wind.com",
    "date": "2018-07-11T21:44:59",
    "name": "[v11,09/25] eal/dev: add device iterator interface",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "56f6c5bd99907d64249459b6ac15c48a709b1e07",
    "submitter": {
        "id": 269,
        "url": "http://patches.dpdk.org/api/people/269/?format=api",
        "name": "Gaëtan Rivet",
        "email": "gaetan.rivet@6wind.com"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/55bada19d99b0d3edd5ca31c9a9d897162a3dec6.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/42902/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/42902/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 460761B5B4;\n\tWed, 11 Jul 2018 23:45:58 +0200 (CEST)",
            "from mail-wr1-f67.google.com (mail-wr1-f67.google.com\n\t[209.85.221.67]) by dpdk.org (Postfix) with ESMTP id ACDCA1B539\n\tfor <dev@dpdk.org>; Wed, 11 Jul 2018 23:45:49 +0200 (CEST)",
            "by mail-wr1-f67.google.com with SMTP id g6-v6so10691651wrp.0\n\tfor <dev@dpdk.org>; Wed, 11 Jul 2018 14:45:49 -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.47\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 11 Jul 2018 14:45:47 -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\tbh=C4kfmhhDec3yERy3OYFtMnirjd6NayeqAesuv3kzo7U=;\n\tb=gy6CO9u0q4m6939Fos37SmigNznPBtuHIFP3Rwa5Q63hsczapkuWISb6RlT6kg7tFG\n\tQlYaDYnokJhsw7474uwpuh1hPv9YM8cC2Jp5Doh6t/WppFCckWmWmSvdt7LaEUEZpP04\n\tk0lqpqNnwsrkseHvKH9hBRXnYtxRXpVtbTF8l/LjXtFJ3RfFSrcipb1k4066j8Z3aKor\n\tGPjvGLETNVTUvqEUBLRa6+n/nS1wYIUkGVP14mcCDfZA38Dp+qEQiDGnLtb/BHcOV5Lj\n\tl4blZ2374IGpv1Pie6qqED1nH0a9I4wS5Yp2S9WZ8N368BztQeKgD9R10uEoxh/zbEiO\n\ttP6Q==",
        "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;\n\tbh=C4kfmhhDec3yERy3OYFtMnirjd6NayeqAesuv3kzo7U=;\n\tb=QgEE9Unnhij4eEF1jpuDb4nKAnh/NIc8mMQdMDvKlZY0V/OCDtC6d2uZ7hONlDQo+U\n\tM9NT/Dwv6Z/LCqtC4pak2sB1qnJNyGA7YzLi947sXQ32V2hvHnmYUVQ97eIg926giGdu\n\t6a69SMCbboJ3rfP+7xJb1wNYTK/+GYh17Tim0t3xrBJoOyIxeZA9U8UBw5sGv2EAjv1F\n\tcvG8eWhFn4Vk3cqiqy8DNfyKUUhRyaNLJKmEz9iclYNsRjs8mnqaMYdFJZmeHl9HfBNP\n\tGp1fv97qMZDBZBzKtCiyB6mE/GKD8jZ2P7x4xt/MK4ftUlUIVJZaJ8Fs0HScdmsWlJX/\n\ttAhg==",
        "X-Gm-Message-State": "AOUpUlErzl8fDrJIyHUsGmDcQ1fwE6mVgxwKdHqbjR3/R09W03+nhP4D\n\tM3k9CGSZAeRaVT7W35sSiCmxxvzq",
        "X-Google-Smtp-Source": "AAOMgpcKdUXT000vQvkpenPvkqzt5xw6u7LaqF8frDufcnf8uPcssp4N73Mp0fRWlQvmEp6Mqm6Eng==",
        "X-Received": "by 2002:adf:92a5:: with SMTP id\n\t34-v6mr224764wrn.83.1531345549017; \n\tWed, 11 Jul 2018 14:45:49 -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:44:59 +0200",
        "Message-Id": "<55bada19d99b0d3edd5ca31c9a9d897162a3dec6.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>",
        "Subject": "[dpdk-dev] [PATCH v11 09/25] eal/dev: add device iterator interface",
        "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": "A device iterator allows iterating over a set of devices.\nThis set is defined by the two descriptions offered,\n\n  * rte_bus\n  * rte_class\n\nOnly one description can be provided, or both. It is not allowed to\nprovide no description at all.\n\nEach layer of abstraction then performs a filter based on the\ndescription provided. This filtering allows iterating on their internal\nset of devices, stopping when a match is valid and returning the current\niteration context.\n\nThis context allows starting the next iteration from the same point and\ngoing forward.\n\nSigned-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>\n---\n lib/librte_eal/common/include/rte_bus.h   |  1 +\n lib/librte_eal/common/include/rte_class.h |  1 +\n lib/librte_eal/common/include/rte_dev.h   | 47 +++++++++++++++++++++++\n 3 files changed, 49 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/common/include/rte_bus.h b/lib/librte_eal/common/include/rte_bus.h\nindex eb9eded4e..747baf140 100644\n--- a/lib/librte_eal/common/include/rte_bus.h\n+++ b/lib/librte_eal/common/include/rte_bus.h\n@@ -211,6 +211,7 @@ struct rte_bus {\n \trte_bus_parse_t parse;       /**< Parse a device name */\n \tstruct rte_bus_conf conf;    /**< Bus configuration */\n \trte_bus_get_iommu_class_t get_iommu_class; /**< Get iommu class */\n+\trte_dev_iterate_t dev_iterate; /**< Device iterator. */\n };\n \n /**\ndiff --git a/lib/librte_eal/common/include/rte_class.h b/lib/librte_eal/common/include/rte_class.h\nindex a79f3152e..85dad5a11 100644\n--- a/lib/librte_eal/common/include/rte_class.h\n+++ b/lib/librte_eal/common/include/rte_class.h\n@@ -35,6 +35,7 @@ TAILQ_HEAD(rte_class_list, rte_class);\n struct rte_class {\n \tTAILQ_ENTRY(rte_class) next; /**< Next device class in linked list */\n \tconst char *name; /**< Name of the class */\n+\trte_dev_iterate_t dev_iterate; /**< Device iterator. */\n };\n \n /**\ndiff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h\nindex ba6e445fc..49000abac 100644\n--- a/lib/librte_eal/common/include/rte_dev.h\n+++ b/lib/librte_eal/common/include/rte_dev.h\n@@ -284,6 +284,53 @@ __attribute__((used)) = str\n static const char DRV_EXP_TAG(name, kmod_dep_export)[] \\\n __attribute__((used)) = str\n \n+/**\n+ * Iteration context.\n+ *\n+ * This context carries over the current iteration state.\n+ */\n+struct rte_dev_iterator {\n+\tconst char *dev_str; /**< device string. */\n+\tconst char *bus_str; /**< bus-related part of device string. */\n+\tconst char *cls_str; /**< class-related part of device string. */\n+\tstruct rte_bus *bus; /**< bus handle. */\n+\tstruct rte_class *cls; /**< class handle. */\n+\tstruct rte_device *device; /**< current position. */\n+\tvoid *class_device; /**< additional specialized context. */\n+};\n+\n+/**\n+ * Device iteration function.\n+ *\n+ * Find the next device matching properties passed in parameters.\n+ * The function takes an additional ``start`` parameter, that is\n+ * used as starting context when relevant.\n+ *\n+ * The function returns the current element in the iteration.\n+ * This return value will potentially be used as a start parameter\n+ * in subsequent calls to the function.\n+ *\n+ * The additional iterator parameter is only there if a specific\n+ * implementation needs additional context. It must not be modified by\n+ * the iteration function itself.\n+ *\n+ * @param start\n+ *   Starting iteration context.\n+ *\n+ * @param devstr\n+ *   Device description string.\n+ *\n+ * @param it\n+ *   Device iterator.\n+ *\n+ * @return\n+ *   The address of the current element matching the device description\n+ *   string.\n+ */\n+typedef void *(*rte_dev_iterate_t)(const void *start,\n+\t\t\t\t   const char *devstr,\n+\t\t\t\t   const struct rte_dev_iterator *it);\n+\n #ifdef __cplusplus\n }\n #endif\n",
    "prefixes": [
        "v11",
        "09/25"
    ]
}