get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 8144,
    "url": "https://patches.dpdk.org/api/patches/8144/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/f5fa31c5e2778b96baf01fdc95dfa2fdc979cd19.1446056748.git.pboldin@mirantis.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": "<f5fa31c5e2778b96baf01fdc95dfa2fdc979cd19.1446056748.git.pboldin@mirantis.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/f5fa31c5e2778b96baf01fdc95dfa2fdc979cd19.1446056748.git.pboldin@mirantis.com",
    "date": "2015-10-28T18:33:49",
    "name": "[dpdk-dev,v6,3/3] vhost: using EVENTFD_COPY2",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "cf9edea92fa1d9f6e7c55fd7a4184a5712edc993",
    "submitter": {
        "id": 194,
        "url": "https://patches.dpdk.org/api/people/194/?format=api",
        "name": "Pavel Boldin",
        "email": "pboldin@mirantis.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/f5fa31c5e2778b96baf01fdc95dfa2fdc979cd19.1446056748.git.pboldin@mirantis.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/8144/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/8144/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 B04498E56;\n\tWed, 28 Oct 2015 19:34:16 +0100 (CET)",
            "from mail-lf0-f53.google.com (mail-lf0-f53.google.com\n\t[209.85.215.53]) by dpdk.org (Postfix) with ESMTP id 57CFB8DA9\n\tfor <dev@dpdk.org>; Wed, 28 Oct 2015 19:34:13 +0100 (CET)",
            "by lffz202 with SMTP id z202so8056935lff.3\n\tfor <dev@dpdk.org>; Wed, 28 Oct 2015 11:34:13 -0700 (PDT)",
            "from pboldin-pc.kha.mirantis.net ([194.213.110.67])\n\tby smtp.gmail.com with ESMTPSA id\n\tg65sm2874107lfb.11.2015.10.28.11.34.12\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tWed, 28 Oct 2015 11:34:12 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=mirantis.com;\n\ts=google; \n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:in-reply-to:references;\n\tbh=sfh5R5nyKJrhkQG1PqD1hBQEzvhXrvO/JfT3MJKRxts=;\n\tb=MiblynjnNoOaaYI3wG4pcqIvD7iakQkeSp1X/2klnUksjZrCaX5A70jmaxcOTMldFm\n\tTqvff6FAFXFetCqUtopwvn4e0CY32j2bnptLVFTzblhEaYHfCMyvEYBv7CU+q5uhAj4+\n\tQqvqOwaDLeOCsJ2m/aNn54cvAHigFw6ihvGq4=",
        "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:in-reply-to:references;\n\tbh=sfh5R5nyKJrhkQG1PqD1hBQEzvhXrvO/JfT3MJKRxts=;\n\tb=SLOEzUSjzUFU6Gd26qMwjToP0mu8Fgghy/Y1gc8xbGViPxCH53koIxZ/FdgEQ4AVNv\n\tstHU3TA6VLCVo4zXYIxdwBivChQFQTXmMVnSqg7vFd1P8Xrw/6lWbF4YUqSSDvyHPe5R\n\t8z6JMXMMvLW4sM1vB31e5fDh3bKdqbk5xXvUNhhnT07rqs1y9WN5AU2PYdYvg4HIwSQd\n\t5Hm0Rmk133hkr5ihVc4Ww2qcmVRyLVcVPjpMrAj+3mIOtKC6DEhtUBWTLHN+oS+rRsi9\n\tkeHy9qc4Z0/CHZYx36zVryYHc+ClsFd7+dbKnGtkCeFlVbiTlx4DkNQl9AXxaZfvTx8h\n\tJGDg==",
        "X-Gm-Message-State": "ALoCoQmKUHM3QgJzCKGJgfV3/+UeGu3arQrH8e3VzT7r+8/uZ9Fo04l8FAOXm2Z+I6PRLeceuroC",
        "X-Received": "by 10.25.144.78 with SMTP id s75mr16174296lfd.116.1446057253087; \n\tWed, 28 Oct 2015 11:34:13 -0700 (PDT)",
        "From": "Pavel Boldin <pboldin@mirantis.com>",
        "To": "dev@dpdk.org",
        "Date": "Wed, 28 Oct 2015 20:33:49 +0200",
        "Message-Id": "<f5fa31c5e2778b96baf01fdc95dfa2fdc979cd19.1446056748.git.pboldin@mirantis.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": [
            "<cover.1446055521.git.pboldin@mirantis.com>",
            "<1440787880-7079-1-git-send-email-pboldin@mirantis.com>"
        ],
        "References": [
            "<cover.1446055521.git.pboldin@mirantis.com>",
            "<1440787880-7079-1-git-send-email-pboldin@mirantis.com>"
        ],
        "Subject": "[dpdk-dev] [PATCH v6 3/3] vhost: using EVENTFD_COPY2",
        "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": "Signed-off-by: Pavel Boldin <pboldin@mirantis.com>\n---\n lib/librte_vhost/vhost_cuse/eventfd_copy.c   | 54 ++++++++++++++++++----------\n lib/librte_vhost/vhost_cuse/eventfd_copy.h   |  6 ++++\n lib/librte_vhost/vhost_cuse/vhost-net-cdev.c |  3 ++\n 3 files changed, 44 insertions(+), 19 deletions(-)",
    "diff": "diff --git a/lib/librte_vhost/vhost_cuse/eventfd_copy.c b/lib/librte_vhost/vhost_cuse/eventfd_copy.c\nindex 4d697a2..154b32a 100644\n--- a/lib/librte_vhost/vhost_cuse/eventfd_copy.c\n+++ b/lib/librte_vhost/vhost_cuse/eventfd_copy.c\n@@ -46,6 +46,32 @@\n \n static const char eventfd_cdev[] = \"/dev/eventfd-link\";\n \n+static int eventfd_link = -1;\n+\n+int\n+eventfd_init(void)\n+{\n+\tif (eventfd_link >= 0)\n+\t\treturn 0;\n+\n+\teventfd_link = open(eventfd_cdev, O_RDWR);\n+\tif (eventfd_link < 0) {\n+\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\t\"eventfd_link module is not loaded\\n\");\n+\t\treturn -1;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int\n+eventfd_free(void)\n+{\n+\tif (eventfd_link >= 0)\n+\t\tclose(eventfd_link);\n+\treturn 0;\n+}\n+\n /*\n  * This function uses the eventfd_link kernel module to copy an eventfd file\n  * descriptor provided by QEMU in to our process space.\n@@ -53,36 +79,26 @@ static const char eventfd_cdev[] = \"/dev/eventfd-link\";\n int\n eventfd_copy(int target_fd, int target_pid)\n {\n-\tint eventfd_link, ret;\n-\tstruct eventfd_copy eventfd_copy;\n-\tint fd = eventfd(0, EFD_NONBLOCK | EFD_CLOEXEC);\n+\tint ret;\n+\tstruct eventfd_copy2 eventfd_copy2;\n \n-\tif (fd == -1)\n-\t\treturn -1;\n \n \t/* Open the character device to the kernel module. */\n \t/* TODO: check this earlier rather than fail until VM boots! */\n-\teventfd_link = open(eventfd_cdev, O_RDWR);\n-\tif (eventfd_link < 0) {\n-\t\tRTE_LOG(ERR, VHOST_CONFIG,\n-\t\t\t\"eventfd_link module is not loaded\\n\");\n-\t\tclose(fd);\n+\tif (eventfd_init() < 0)\n \t\treturn -1;\n-\t}\n \n-\teventfd_copy.source_fd = fd;\n-\teventfd_copy.target_fd = target_fd;\n-\teventfd_copy.target_pid = target_pid;\n+\teventfd_copy2.fd = target_fd;\n+\teventfd_copy2.pid = target_pid;\n+\teventfd_copy2.flags = O_NONBLOCK | O_CLOEXEC;\n \t/* Call the IOCTL to copy the eventfd. */\n-\tret = ioctl(eventfd_link, EVENTFD_COPY, &eventfd_copy);\n-\tclose(eventfd_link);\n+\tret = ioctl(eventfd_link, EVENTFD_COPY2, &eventfd_copy2);\n \n \tif (ret < 0) {\n \t\tRTE_LOG(ERR, VHOST_CONFIG,\n-\t\t\t\"EVENTFD_COPY ioctl failed\\n\");\n-\t\tclose(fd);\n+\t\t\t\"EVENTFD_COPY2 ioctl failed\\n\");\n \t\treturn -1;\n \t}\n \n-\treturn fd;\n+\treturn ret;\n }\ndiff --git a/lib/librte_vhost/vhost_cuse/eventfd_copy.h b/lib/librte_vhost/vhost_cuse/eventfd_copy.h\nindex 19ae30d..5f446ca 100644\n--- a/lib/librte_vhost/vhost_cuse/eventfd_copy.h\n+++ b/lib/librte_vhost/vhost_cuse/eventfd_copy.h\n@@ -34,6 +34,12 @@\n #define _EVENTFD_H\n \n int\n+eventfd_init(void);\n+\n+int\n+eventfd_free(void);\n+\n+int\n eventfd_copy(int target_fd, int target_pid);\n \n #endif\ndiff --git a/lib/librte_vhost/vhost_cuse/vhost-net-cdev.c b/lib/librte_vhost/vhost_cuse/vhost-net-cdev.c\nindex 1ae7c49..ae7ad8d 100644\n--- a/lib/librte_vhost/vhost_cuse/vhost-net-cdev.c\n+++ b/lib/librte_vhost/vhost_cuse/vhost-net-cdev.c\n@@ -373,6 +373,9 @@ rte_vhost_driver_register(const char *dev_name)\n \t\treturn -1;\n \t}\n \n+\tif (eventfd_init() < 0)\n+\t\treturn -1;\n+\n \t/*\n \t * The device name is created. This is passed to QEMU so that it can\n \t * register the device with our application.\n",
    "prefixes": [
        "dpdk-dev",
        "v6",
        "3/3"
    ]
}