get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 54955,
    "url": "https://patches.dpdk.org/api/patches/54955/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1560957293-17294-2-git-send-email-ndragazis@arrikto.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": "<1560957293-17294-2-git-send-email-ndragazis@arrikto.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1560957293-17294-2-git-send-email-ndragazis@arrikto.com",
    "date": "2019-06-19T15:14:26",
    "name": "[01/28] vhost: introduce vhost transport operations structure",
    "commit_ref": null,
    "pull_url": null,
    "state": "rfc",
    "archived": true,
    "hash": "5884b4678eed7779d1553e1dcd80d12bf349cb68",
    "submitter": {
        "id": 1339,
        "url": "https://patches.dpdk.org/api/people/1339/?format=api",
        "name": "Nikos Dragazis",
        "email": "ndragazis@arrikto.com"
    },
    "delegate": {
        "id": 2642,
        "url": "https://patches.dpdk.org/api/users/2642/?format=api",
        "username": "mcoquelin",
        "first_name": "Maxime",
        "last_name": "Coquelin",
        "email": "maxime.coquelin@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1560957293-17294-2-git-send-email-ndragazis@arrikto.com/mbox/",
    "series": [
        {
            "id": 5082,
            "url": "https://patches.dpdk.org/api/series/5082/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=5082",
            "date": "2019-06-19T15:14:25",
            "name": "vhost: add virtio-vhost-user transport",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/5082/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/54955/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/54955/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 BCCAE1C38B;\n\tWed, 19 Jun 2019 17:15:39 +0200 (CEST)",
            "from mx0.arrikto.com (mx0.arrikto.com [212.71.252.59])\n\tby dpdk.org (Postfix) with ESMTP id 270F82BEA\n\tfor <dev@dpdk.org>; Wed, 19 Jun 2019 17:15:36 +0200 (CEST)",
            "from troi.prod.arr (mail.arr [10.99.0.5])\n\tby mx0.arrikto.com (Postfix) with ESMTP id C0AFF182005;\n\tWed, 19 Jun 2019 18:15:35 +0300 (EEST)",
            "from localhost.localdomain (unknown [10.89.50.133])\n\tby troi.prod.arr (Postfix) with ESMTPSA id 36DAE32C;\n\tWed, 19 Jun 2019 18:15:35 +0300 (EEST)"
        ],
        "From": "Nikos Dragazis <ndragazis@arrikto.com>",
        "To": "dev@dpdk.org",
        "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>,\n\tTiwei Bie <tiwei.bie@intel.com>, Zhihong Wang <zhihong.wang@intel.com>,\n\tStefan Hajnoczi <stefanha@redhat.com>, Wei Wang <wei.w.wang@intel.com>,\n\tStojaczyk Dariusz <dariusz.stojaczyk@intel.com>,\n\tVangelis Koukis <vkoukis@arrikto.com>",
        "Date": "Wed, 19 Jun 2019 18:14:26 +0300",
        "Message-Id": "<1560957293-17294-2-git-send-email-ndragazis@arrikto.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1560957293-17294-1-git-send-email-ndragazis@arrikto.com>",
        "References": "<1560957293-17294-1-git-send-email-ndragazis@arrikto.com>",
        "Subject": "[dpdk-dev] [PATCH 01/28] vhost: introduce vhost transport\n\toperations structure",
        "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": "This is the first of a series of patches, whose purpose is to add\nsupport for the virtio-vhost-user transport. This is a vhost-user\ntransport implementation that is different from the default AF_UNIX\ntransport. It uses the virtio-vhost-user PCI device in order to tunnel\nvhost-user protocol messages over virtio. This lets guests act as vhost\ndevice backends for other guests.\n\nFile descriptor passing is specific to the AF_UNIX vhost-user protocol\ntransport.  In order to add support for additional transports, it is\nnecessary to extract transport-specific code from the main vhost-user\ncode.\n\nThis patch introduces struct vhost_transport_ops and associates each\ndevice with a transport.  Core vhost-user code calls into\nvhost_transport_ops to perform transport-specific operations.\n\nNotifying callfd is a transport-specific operation, so it belongs to\ntrans_af_unix.c.\n\nSeveral more patches follow this one to complete the task of moving\nAF_UNIX transport code out of core vhost-user code.\n\nSigned-off-by: Nikos Dragazis <ndragazis@arrikto.com>\nSigned-off-by: Stefan Hajnoczi <stefanha@redhat.com>\n---\n lib/librte_vhost/Makefile        |  2 +-\n lib/librte_vhost/trans_af_unix.c | 20 ++++++++++++++++++++\n lib/librte_vhost/vhost.c         |  1 +\n lib/librte_vhost/vhost.h         | 34 +++++++++++++++++++++++++++++-----\n 4 files changed, 51 insertions(+), 6 deletions(-)\n create mode 100644 lib/librte_vhost/trans_af_unix.c",
    "diff": "diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile\nindex 8623e91..5ff5fb2 100644\n--- a/lib/librte_vhost/Makefile\n+++ b/lib/librte_vhost/Makefile\n@@ -23,7 +23,7 @@ LDLIBS += -lrte_eal -lrte_mempool -lrte_mbuf -lrte_ethdev -lrte_net\n \n # all source are stored in SRCS-y\n SRCS-$(CONFIG_RTE_LIBRTE_VHOST) := fd_man.c iotlb.c socket.c vhost.c \\\n-\t\t\t\t\tvhost_user.c virtio_net.c vdpa.c\n+\t\t\t\t\tvhost_user.c virtio_net.c vdpa.c trans_af_unix.c\n \n # install includes\n SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_vhost.h rte_vdpa.h\ndiff --git a/lib/librte_vhost/trans_af_unix.c b/lib/librte_vhost/trans_af_unix.c\nnew file mode 100644\nindex 0000000..3f0c308\n--- /dev/null\n+++ b/lib/librte_vhost/trans_af_unix.c\n@@ -0,0 +1,20 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2010-2018 Intel Corporation\n+ * Copyright(c) 2017 Red Hat, Inc.\n+ * Copyright(c) 2019 Arrikto Inc.\n+ */\n+\n+#include \"vhost.h\"\n+\n+static int\n+af_unix_vring_call(struct virtio_net *dev __rte_unused,\n+\t\t   struct vhost_virtqueue *vq)\n+{\n+\tif (vq->callfd >= 0)\n+\t\teventfd_write(vq->callfd, (eventfd_t)1);\n+\treturn 0;\n+}\n+\n+const struct vhost_transport_ops af_unix_trans_ops = {\n+\t.vring_call = af_unix_vring_call,\n+};\ndiff --git a/lib/librte_vhost/vhost.c b/lib/librte_vhost/vhost.c\nindex 981837b..a36bc01 100644\n--- a/lib/librte_vhost/vhost.c\n+++ b/lib/librte_vhost/vhost.c\n@@ -507,6 +507,7 @@ vhost_new_device(void)\n \tdev->vid = i;\n \tdev->flags = VIRTIO_DEV_BUILTIN_VIRTIO_NET;\n \tdev->slave_req_fd = -1;\n+\tdev->trans_ops = &af_unix_trans_ops;\n \tdev->vdpa_dev_id = -1;\n \tdev->postcopy_ufd = -1;\n \trte_spinlock_init(&dev->slave_req_lock);\ndiff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h\nindex 884befa..077f213 100644\n--- a/lib/librte_vhost/vhost.h\n+++ b/lib/librte_vhost/vhost.h\n@@ -286,6 +286,30 @@ struct guest_page {\n \tuint64_t size;\n };\n \n+struct virtio_net;\n+\n+/**\n+ * A structure containing function pointers for transport-specific operations.\n+ */\n+struct vhost_transport_ops {\n+\t/**\n+\t * Notify the guest that used descriptors have been added to the vring.\n+\t * The VRING_AVAIL_F_NO_INTERRUPT flag and event idx have already been checked\n+\t * so this function just needs to perform the notification.\n+\t *\n+\t * @param dev\n+\t *  vhost device\n+\t * @param vq\n+\t *  vhost virtqueue\n+\t * @return\n+\t *  0 on success, -1 on failure\n+\t */\n+\tint (*vring_call)(struct virtio_net *dev, struct vhost_virtqueue *vq);\n+};\n+\n+/** The traditional AF_UNIX vhost-user protocol transport. */\n+extern const struct vhost_transport_ops af_unix_trans_ops;\n+\n /**\n  * Device structure contains all configuration information relating\n  * to the device.\n@@ -312,6 +336,7 @@ struct virtio_net {\n \tuint16_t\t\tmtu;\n \n \tstruct vhost_device_ops const *notify_ops;\n+\tstruct vhost_transport_ops const *trans_ops;\n \n \tuint32_t\t\tnr_guest_pages;\n \tuint32_t\t\tmax_guest_pages;\n@@ -544,12 +569,11 @@ vhost_vring_call_split(struct virtio_net *dev, struct vhost_virtqueue *vq)\n \t\tif ((vhost_need_event(vhost_used_event(vq), new, old) &&\n \t\t\t\t\t(vq->callfd >= 0)) ||\n \t\t\t\tunlikely(!signalled_used_valid))\n-\t\t\teventfd_write(vq->callfd, (eventfd_t) 1);\n+\t\t\tdev->trans_ops->vring_call(dev, vq);\n \t} else {\n \t\t/* Kick the guest if necessary. */\n-\t\tif (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT)\n-\t\t\t\t&& (vq->callfd >= 0))\n-\t\t\teventfd_write(vq->callfd, (eventfd_t)1);\n+\t\tif (!(vq->avail->flags & VRING_AVAIL_F_NO_INTERRUPT))\n+\t\t\tdev->trans_ops->vring_call(dev, vq);\n \t}\n }\n \n@@ -601,7 +625,7 @@ vhost_vring_call_packed(struct virtio_net *dev, struct vhost_virtqueue *vq)\n \t\tkick = true;\n kick:\n \tif (kick)\n-\t\teventfd_write(vq->callfd, (eventfd_t)1);\n+\t\tdev->trans_ops->vring_call(dev, vq);\n }\n \n static __rte_always_inline void\n",
    "prefixes": [
        "01/28"
    ]
}