get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1871,
    "url": "https://patches.dpdk.org/api/patches/1871/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1418106629-22227-16-git-send-email-mukawa@igel.co.jp/",
    "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": "<1418106629-22227-16-git-send-email-mukawa@igel.co.jp>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1418106629-22227-16-git-send-email-mukawa@igel.co.jp",
    "date": "2014-12-09T06:30:16",
    "name": "[dpdk-dev,v3,15/28] eal/pci: Add probe and close function for virtual drivers",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f36054790c96d4e2929c90ddabcda9edd281444e",
    "submitter": {
        "id": 64,
        "url": "https://patches.dpdk.org/api/people/64/?format=api",
        "name": "Tetsuya Mukawa",
        "email": "mukawa@igel.co.jp"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1418106629-22227-16-git-send-email-mukawa@igel.co.jp/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1871/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1871/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 16238805A;\n\tTue,  9 Dec 2014 07:31:31 +0100 (CET)",
            "from mail-pa0-f48.google.com (mail-pa0-f48.google.com\n\t[209.85.220.48]) by dpdk.org (Postfix) with ESMTP id CAD6680AB\n\tfor <dev@dpdk.org>; Tue,  9 Dec 2014 07:31:22 +0100 (CET)",
            "by mail-pa0-f48.google.com with SMTP id rd3so6793466pab.21\n\tfor <dev@dpdk.org>; Mon, 08 Dec 2014 22:31:22 -0800 (PST)",
            "from eris.hq.igel.co.jp (napt.igel.co.jp. [219.106.231.132])\n\tby mx.google.com with ESMTPSA id\n\tf12sm403088pat.43.2014.12.08.22.31.19 for <multiple recipients>\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tMon, 08 Dec 2014 22:31:21 -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=T+Jw7o/H77J9uTM+MM797jtzpPwM56Ch+U+0dr5zwdU=;\n\tb=CUSsx0MwSnCAOhNXcXpUJvhWDkMX5Z/vu9eqSkw0oH4FtOmQ+oRUPWynaXCy+Vw9Nd\n\teoSpu9YGSINn76mWmaTNuBHu0a5C4QVQOEQUKSlMp5ZV/AFX1WyioXdREkvlyLFsUO9u\n\teKlengg2/gnAJzvbW+17e+GHtJqnhej+S1NFQw+Tae4v3Z6nrQujxqbZGpfPlk4c9ua6\n\twdW54W91oGZ/G3cAclNzplGgixNL8rBxkGa6iWwJI+Epv7HnriBCnfnuc+zfEYvGdLL/\n\t4YlXulQVKPIBqLW6kIfNEwAHV5PL3BnX3mxIdY9cyKQuNP6pZjz8DMRrp3lc/Y4rS1YU\n\teb9w==",
        "X-Gm-Message-State": "ALoCoQmYvLIMqWXhFs/4Y1zbnhy5mOoT9U5P+bd8I5I1pzaKHSf1c+53hE+uc/Q3WpFDcH/cMdRG",
        "X-Received": "by 10.70.134.36 with SMTP id ph4mr27558750pdb.29.1418106682158; \n\tMon, 08 Dec 2014 22:31:22 -0800 (PST)",
        "From": "Tetsuya Mukawa <mukawa@igel.co.jp>",
        "To": "dev@dpdk.org",
        "Date": "Tue,  9 Dec 2014 15:30:16 +0900",
        "Message-Id": "<1418106629-22227-16-git-send-email-mukawa@igel.co.jp>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1418106629-22227-1-git-send-email-mukawa@igel.co.jp>",
        "References": "<1416474399-16851-1-git-send-email-mukawa@igel.co.jp>\n\t<1418106629-22227-1-git-send-email-mukawa@igel.co.jp>",
        "Cc": "nakajima.yoshihiro@lab.ntt.co.jp, menrigh@brocade.com,\n\tmasutani.hitoshi@lab.ntt.co.jp",
        "Subject": "[dpdk-dev] [PATCH v3 15/28] eal/pci: Add probe and close function\n\tfor virtual drivers",
        "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": "The patch adds rte_eal_dev_init_one() and rte_eal_dev_close_one().\nThese are used for attaching and detaching virtual devices.\n\nSigned-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>\n---\n lib/librte_eal/common/eal_common_dev.c  | 66 +++++++++++++++++++++++++++++++++\n lib/librte_eal/common/include/rte_dev.h |  6 +++\n lib/librte_eal/linuxapp/eal/Makefile    |  1 +\n 3 files changed, 73 insertions(+)",
    "diff": "diff --git a/lib/librte_eal/common/eal_common_dev.c b/lib/librte_eal/common/eal_common_dev.c\nindex eae5656..f573a54 100644\n--- a/lib/librte_eal/common/eal_common_dev.c\n+++ b/lib/librte_eal/common/eal_common_dev.c\n@@ -32,10 +32,13 @@\n  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n  */\n \n+#include <stdio.h>\n+#include <limits.h>\n #include <string.h>\n #include <inttypes.h>\n #include <sys/queue.h>\n \n+#include <rte_ethdev.h>\n #include <rte_dev.h>\n #include <rte_devargs.h>\n #include <rte_debug.h>\n@@ -107,3 +110,66 @@ rte_eal_dev_init(void)\n \t}\n \treturn 0;\n }\n+\n+/* So far, linux only supports DPDK hotplug function. */\n+#if defined(RTE_LIBRTE_EAL_HOTPLUG) && defined(RTE_LIBRTE_EAL_LINUXAPP)\n+\n+#define INVOKE_PROBE\t(0)\n+#define INVOKE_CLOSE\t(1)\n+\n+static void\n+rte_eal_dev_invoke(struct rte_driver *driver,\n+\t\tstruct rte_devargs *devargs, int type)\n+{\n+\tif ((driver == NULL) || (devargs == NULL))\n+\t\treturn;\n+\n+\tswitch (type) {\n+\tcase INVOKE_PROBE:\n+\t\tdriver->init(devargs->virtual.drv_name, devargs->args);\n+\t\tbreak;\n+\tcase INVOKE_CLOSE:\n+\t\tdriver->close(devargs->virtual.drv_name, devargs->args);\n+\t\tbreak;\n+\t}\n+}\n+\n+static int\n+rte_eal_dev_find_and_invoke(const char *name, int type)\n+{\n+\tstruct rte_devargs *devargs;\n+\tstruct rte_driver *driver;\n+\n+\tif (name == NULL)\n+\t\treturn -EINVAL;\n+\n+\t/* call the init function for each virtual device */\n+\tTAILQ_FOREACH(devargs, &devargs_list, next) {\n+\n+\t\tif (devargs->type != RTE_DEVTYPE_VIRTUAL)\n+\t\t\tcontinue;\n+\n+\t\tif (strncmp(name, devargs->virtual.drv_name, strlen(name)))\n+\t\t\tcontinue;\n+\n+\t\tTAILQ_FOREACH(driver, &dev_driver_list, next) {\n+\t\t\tif (driver->type != PMD_VDEV)\n+\t\t\t\tcontinue;\n+\n+\t\t\t/* search a driver prefix in virtual device name */\n+\t\t\tif (!strncmp(driver->name, devargs->virtual.drv_name,\n+\t\t\t\t\tstrlen(driver->name))) {\n+\t\t\t\trte_eal_dev_invoke(driver, devargs, type);\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\n+\t\tif (driver == NULL) {\n+\t\t\tRTE_LOG(WARNING, EAL, \"no driver found for %s\\n\",\n+\t\t\t\t  devargs->virtual.drv_name);\n+\t\t}\n+\t\treturn 0;\n+\t}\n+\treturn 1;\n+}\n+#endif /* RTE_LIBRTE_EAL_HOTPLUG & RTE_LIBRTE_EAL_LINUXAPP */\ndiff --git a/lib/librte_eal/common/include/rte_dev.h b/lib/librte_eal/common/include/rte_dev.h\nindex f7e3a10..71d40c3 100644\n--- a/lib/librte_eal/common/include/rte_dev.h\n+++ b/lib/librte_eal/common/include/rte_dev.h\n@@ -57,6 +57,11 @@ TAILQ_HEAD(rte_driver_list, rte_driver);\n typedef int (rte_dev_init_t)(const char *name, const char *args);\n \n /**\n+ * Close function called for each device driver once.\n+ */\n+typedef int (rte_dev_close_t)(const char *name, const char *args);\n+\n+/**\n  * Driver type enumeration\n  */\n enum pmd_type {\n@@ -72,6 +77,7 @@ struct rte_driver {\n \tenum pmd_type type;\t\t   /**< PMD Driver type */\n \tconst char *name;                   /**< Driver name. */\n \trte_dev_init_t *init;              /**< Device init. function. */\n+\trte_dev_close_t *close;            /**< Device close. function. */\n };\n \n /**\ndiff --git a/lib/librte_eal/linuxapp/eal/Makefile b/lib/librte_eal/linuxapp/eal/Makefile\nindex 72ecf3a..0ec83b5 100644\n--- a/lib/librte_eal/linuxapp/eal/Makefile\n+++ b/lib/librte_eal/linuxapp/eal/Makefile\n@@ -41,6 +41,7 @@ CFLAGS += -I$(RTE_SDK)/lib/librte_eal/common/include\n CFLAGS += -I$(RTE_SDK)/lib/librte_ring\n CFLAGS += -I$(RTE_SDK)/lib/librte_mempool\n CFLAGS += -I$(RTE_SDK)/lib/librte_malloc\n+CFLAGS += -I$(RTE_SDK)/lib/librte_mbuf\n CFLAGS += -I$(RTE_SDK)/lib/librte_ether\n CFLAGS += -I$(RTE_SDK)/lib/librte_ivshmem\n CFLAGS += -I$(RTE_SDK)/lib/librte_pmd_ring\n",
    "prefixes": [
        "dpdk-dev",
        "v3",
        "15/28"
    ]
}