Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/54971/?format=api
http://patches.dpdk.org/api/patches/54971/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1560957293-17294-18-git-send-email-ndragazis@arrikto.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": "<1560957293-17294-18-git-send-email-ndragazis@arrikto.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1560957293-17294-18-git-send-email-ndragazis@arrikto.com", "date": "2019-06-19T15:14:42", "name": "[17/28] vhost: support registering additional vhost-user transports", "commit_ref": null, "pull_url": null, "state": "rfc", "archived": true, "hash": "22bdb692887d3535c3421a25d9034db19f6cd3c4", "submitter": { "id": 1339, "url": "http://patches.dpdk.org/api/people/1339/?format=api", "name": "Nikos Dragazis", "email": "ndragazis@arrikto.com" }, "delegate": { "id": 2642, "url": "http://patches.dpdk.org/api/users/2642/?format=api", "username": "mcoquelin", "first_name": "Maxime", "last_name": "Coquelin", "email": "maxime.coquelin@redhat.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/1560957293-17294-18-git-send-email-ndragazis@arrikto.com/mbox/", "series": [ { "id": 5082, "url": "http://patches.dpdk.org/api/series/5082/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5082", "date": "2019-06-19T15:14:25", "name": "vhost: add virtio-vhost-user transport", "version": 1, "mbox": "http://patches.dpdk.org/series/5082/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/54971/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/54971/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 0AA111C410;\n\tWed, 19 Jun 2019 17:16:32 +0200 (CEST)", "from mx0.arrikto.com (mx0.arrikto.com [212.71.252.59])\n\tby dpdk.org (Postfix) with ESMTP id 8C4B31C396\n\tfor <dev@dpdk.org>; Wed, 19 Jun 2019 17:15:43 +0200 (CEST)", "from troi.prod.arr (mail.arr [10.99.0.5])\n\tby mx0.arrikto.com (Postfix) with ESMTP id 59A8D182015;\n\tWed, 19 Jun 2019 18:15:43 +0300 (EEST)", "from localhost.localdomain (unknown [10.89.50.133])\n\tby troi.prod.arr (Postfix) with ESMTPSA id D5FE732C;\n\tWed, 19 Jun 2019 18:15:42 +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:42 +0300", "Message-Id": "<1560957293-17294-18-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 17/28] vhost: support registering additional\n\tvhost-user transports", "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 patch introduces a global transport map which will hold pointers to\nthe transport-specific operations of all the available transports.\nThe AF_UNIX transport is supported by default. More transports can be\nhooked up by implementing struct vhost_transport_ops and registering\nthis structure to the global transport map table. A new transport can be\nregistered with rte_vhost_register_transport(), which is part of\nlibrtre_vhost public API.\n\nThis patch also exports vhost.h and vhost_user.h and some private\nfunctions as part of librte_vhost public API. This allows implementing\nvhost-user transports outside of lib/librte_vhost/.\n\nSigned-off-by: Nikos Dragazis <ndragazis@arrikto.com>\n---\n lib/librte_vhost/Makefile | 2 +-\n lib/librte_vhost/rte_vhost_version.map | 11 +++++++++++\n lib/librte_vhost/socket.c | 26 +++++++++++++++++++++++++-\n lib/librte_vhost/vhost.h | 22 ++++++++++++++++++++++\n 4 files changed, 59 insertions(+), 2 deletions(-)", "diff": "diff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile\nindex 5ff5fb2..4f867ec 100644\n--- a/lib/librte_vhost/Makefile\n+++ b/lib/librte_vhost/Makefile\n@@ -26,7 +26,7 @@ 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 trans_af_unix.c\n \n # install includes\n-SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_vhost.h rte_vdpa.h\n+SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += vhost.h vhost_user.h rte_vhost.h rte_vdpa.h\n \n # only compile vhost crypto when cryptodev is enabled\n ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)\ndiff --git a/lib/librte_vhost/rte_vhost_version.map b/lib/librte_vhost/rte_vhost_version.map\nindex 5f1d4a7..9eda81f 100644\n--- a/lib/librte_vhost/rte_vhost_version.map\n+++ b/lib/librte_vhost/rte_vhost_version.map\n@@ -60,6 +60,17 @@ DPDK_18.02 {\n \n } DPDK_17.08;\n \n+DPDK_19.05 {\n+\tglobal:\n+\n+\trte_vhost_register_transport;\n+\tvhost_destroy_device;\n+\tvhost_new_device;\n+\tvhost_set_ifname;\n+\tvhost_user_msg_handler;\n+\n+} DPDK_18.02;\n+\n EXPERIMENTAL {\n \tglobal:\n \ndiff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c\nindex fc78b63..fe1c78d 100644\n--- a/lib/librte_vhost/socket.c\n+++ b/lib/librte_vhost/socket.c\n@@ -317,7 +317,17 @@ rte_vhost_driver_register(const char *path, uint64_t flags)\n {\n \tint ret = -1;\n \tstruct vhost_user_socket *vsocket;\n-\tconst struct vhost_transport_ops *trans_ops = &af_unix_trans_ops;\n+\tconst struct vhost_transport_ops *trans_ops;\n+\n+\t/* Register the AF_UNIX vhost-user transport in the transport map.\n+\t * The AF_UNIX transport is supported by default.\n+\t */\n+\tif (g_transport_map[VHOST_TRANSPORT_UNIX] == NULL) {\n+\t\tif (rte_vhost_register_transport(VHOST_TRANSPORT_UNIX, &af_unix_trans_ops) < 0)\n+\t\t\tgoto out;\n+\t}\n+\n+\ttrans_ops = g_transport_map[VHOST_TRANSPORT_UNIX];\n \n \tif (!path)\n \t\treturn -1;\n@@ -495,3 +505,17 @@ rte_vhost_driver_start(const char *path)\n \n \treturn vsocket->trans_ops->socket_start(vsocket);\n }\n+\n+int\n+rte_vhost_register_transport(VhostUserTransport trans,\n+\t\tconst struct vhost_transport_ops *trans_ops)\n+{\n+\tif (trans >= VHOST_TRANSPORT_MAX) {\n+\t\tRTE_LOG(ERR, VHOST_CONFIG,\n+\t\t\t\"Invalid vhost-user transport %d\\n\", trans);\n+\t\treturn -1;\n+\t}\n+\n+\tg_transport_map[trans] = trans_ops;\n+\treturn 0;\n+}\ndiff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h\nindex f5d6dc8..aba8d9b 100644\n--- a/lib/librte_vhost/vhost.h\n+++ b/lib/librte_vhost/vhost.h\n@@ -493,6 +493,28 @@ struct vhost_transport_ops {\n /** The traditional AF_UNIX vhost-user protocol transport. */\n extern const struct vhost_transport_ops af_unix_trans_ops;\n \n+typedef enum VhostUserTransport {\n+\tVHOST_TRANSPORT_UNIX = 0,\n+\tVHOST_TRANSPORT_MAX = 1\n+} VhostUserTransport;\n+\n+/* A list with all the available vhost-user transports. */\n+const struct vhost_transport_ops *g_transport_map[VHOST_TRANSPORT_MAX];\n+\n+/**\n+ * Register a new vhost-user transport in the transport map.\n+ *\n+ * @param trans\n+ * the transport that is going to be registered\n+ * @param trans_ops\n+ * the transport operations supported by this transport\n+ * @return\n+ * 0 on success, -1 on failure\n+ * */\n+int\n+rte_vhost_register_transport(VhostUserTransport trans,\n+ const struct vhost_transport_ops *trans_ops);\n+\n /**\n * Device structure contains all configuration information relating\n * to the device.\n", "prefixes": [ "17/28" ] }{ "id": 54971, "url": "