Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/72260/?format=api
http://patches.dpdk.org/api/patches/72260/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200626140441.1441763-15-maxime.coquelin@redhat.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": "<20200626140441.1441763-15-maxime.coquelin@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200626140441.1441763-15-maxime.coquelin@redhat.com", "date": "2020-06-26T14:04:41", "name": "[v3,14/14] vhost: split vDPA header file", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "1f259aa6b8ad8c0467be9b32b180f3f8b58ff391", "submitter": { "id": 512, "url": "http://patches.dpdk.org/api/people/512/?format=api", "name": "Maxime Coquelin", "email": "maxime.coquelin@redhat.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/20200626140441.1441763-15-maxime.coquelin@redhat.com/mbox/", "series": [ { "id": 10634, "url": "http://patches.dpdk.org/api/series/10634/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=10634", "date": "2020-06-26T14:04:28", "name": "vDPA API and framework rework", "version": 3, "mbox": "http://patches.dpdk.org/series/10634/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/72260/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/72260/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 1BE94A051C;\n\tFri, 26 Jun 2020 16:08:14 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id CA9BE1C115;\n\tFri, 26 Jun 2020 16:06:36 +0200 (CEST)", "from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com\n [207.211.31.120]) by dpdk.org (Postfix) with ESMTP id A1F491C0C3\n for <dev@dpdk.org>; Fri, 26 Jun 2020 16:06:34 +0200 (CEST)", "from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com\n [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id\n us-mta-13-ZH_-uCXfO8er8zGabElf_w-1; Fri, 26 Jun 2020 10:06:29 -0400", "from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com\n [10.5.11.15])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9A5B3804003;\n Fri, 26 Jun 2020 14:06:27 +0000 (UTC)", "from localhost.localdomain (unknown [10.36.110.7])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 416695BAE1;\n Fri, 26 Jun 2020 14:06:22 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1593180394;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=cLZaaWCskfFnryB3DzVzlOPJdZPMqP+QUFtjB06YfYU=;\n b=OxwZ9OWscRt81sy8bTdM9dh377lkFJg13DiosH3lHbrtVuINW2hKLWQzWklEza25SMjNkP\n jYqHCXPwzJ6I1obvbdb8sVDsD5XvAKD90xfIsl02xYDpzK7no3mFixnLNgYJ6mOGZmByF9\n fH6topvG88o1wRF3ncYhaeAPiNmVNJ4=", "X-MC-Unique": "ZH_-uCXfO8er8zGabElf_w-1", "From": "Maxime Coquelin <maxime.coquelin@redhat.com>", "To": "matan@mellanox.com, xiao.w.wang@intel.com, zhihong.wang@intel.com,\n chenbo.xia@intel.com, david.marchand@redhat.com, amorenoz@redhat.com,\n viacheslavo@mellanox.com, hemant.agrawal@nxp.com, sachin.saxena@nxp.com,\n grive@u256.net, dev@dpdk.org", "Cc": "Maxime Coquelin <maxime.coquelin@redhat.com>", "Date": "Fri, 26 Jun 2020 16:04:41 +0200", "Message-Id": "<20200626140441.1441763-15-maxime.coquelin@redhat.com>", "In-Reply-To": "<20200626140441.1441763-1-maxime.coquelin@redhat.com>", "References": "<20200626140441.1441763-1-maxime.coquelin@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 2.79 on 10.5.11.15", "Authentication-Results": "relay.mimecast.com;\n auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=maxime.coquelin@redhat.com", "X-Mimecast-Spam-Score": "0", "X-Mimecast-Originator": "redhat.com", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v3 14/14] vhost: split vDPA header file", "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "This patch split the vDPA header file in two, making\nrte_vdpa_device structure opaque to the application.\n\nApplications should only include rte_vdpa.h, while drivers\nshould include both rte_vdpa.h and rte_vdpa_dev.h.\n\nAcked-by: Adrián Moreno <amorenoz@redhat.com>\nSigned-off-by: Maxime Coquelin <maxime.coquelin@redhat.com>\n---\n drivers/vdpa/ifc/ifcvf_vdpa.c | 1 +\n drivers/vdpa/mlx5/mlx5_vdpa.h | 1 +\n lib/librte_vhost/Makefile | 3 +-\n lib/librte_vhost/meson.build | 3 +-\n lib/librte_vhost/rte_vdpa.h | 142 ------------------------------\n lib/librte_vhost/rte_vdpa_dev.h | 147 ++++++++++++++++++++++++++++++++\n lib/librte_vhost/vdpa.c | 1 +\n lib/librte_vhost/vhost.h | 1 +\n 8 files changed, 155 insertions(+), 144 deletions(-)\n create mode 100644 lib/librte_vhost/rte_vdpa_dev.h", "diff": "diff --git a/drivers/vdpa/ifc/ifcvf_vdpa.c b/drivers/vdpa/ifc/ifcvf_vdpa.c\nindex 4163047744..f81d13a2c8 100644\n--- a/drivers/vdpa/ifc/ifcvf_vdpa.c\n+++ b/drivers/vdpa/ifc/ifcvf_vdpa.c\n@@ -16,6 +16,7 @@\n #include <rte_bus_pci.h>\n #include <rte_vhost.h>\n #include <rte_vdpa.h>\n+#include <rte_vdpa_dev.h>\n #include <rte_vfio.h>\n #include <rte_spinlock.h>\n #include <rte_log.h>\ndiff --git a/drivers/vdpa/mlx5/mlx5_vdpa.h b/drivers/vdpa/mlx5/mlx5_vdpa.h\nindex ea09576c5a..de4154b183 100644\n--- a/drivers/vdpa/mlx5/mlx5_vdpa.h\n+++ b/drivers/vdpa/mlx5/mlx5_vdpa.h\n@@ -12,6 +12,7 @@\n #pragma GCC diagnostic ignored \"-Wpedantic\"\n #endif\n #include <rte_vdpa.h>\n+#include <rte_vdpa_dev.h>\n #include <rte_vhost.h>\n #ifdef PEDANTIC\n #pragma GCC diagnostic error \"-Wpedantic\"\ndiff --git a/lib/librte_vhost/Makefile b/lib/librte_vhost/Makefile\nindex e592795f22..b7ff7dc4b3 100644\n--- a/lib/librte_vhost/Makefile\n+++ b/lib/librte_vhost/Makefile\n@@ -41,7 +41,8 @@ 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 \n # install includes\n-SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_vhost.h rte_vdpa.h\n+SYMLINK-$(CONFIG_RTE_LIBRTE_VHOST)-include += rte_vhost.h rte_vdpa.h \\\n+\t\t\t\t\t\trte_vdpa_dev.h\n \n # only compile vhost crypto when cryptodev is enabled\n ifeq ($(CONFIG_RTE_LIBRTE_CRYPTODEV),y)\ndiff --git a/lib/librte_vhost/meson.build b/lib/librte_vhost/meson.build\nindex f80632848c..882a0eaf41 100644\n--- a/lib/librte_vhost/meson.build\n+++ b/lib/librte_vhost/meson.build\n@@ -21,5 +21,6 @@ cflags += '-fno-strict-aliasing'\n sources = files('fd_man.c', 'iotlb.c', 'socket.c', 'vdpa.c',\n \t\t'vhost.c', 'vhost_user.c',\n \t\t'virtio_net.c', 'vhost_crypto.c')\n-headers = files('rte_vhost.h', 'rte_vdpa.h', 'rte_vhost_crypto.h')\n+headers = files('rte_vhost.h', 'rte_vdpa.h', 'rte_vdpa_dev.h',\n+\t\t'rte_vhost_crypto.h')\n deps += ['ethdev', 'cryptodev', 'hash', 'pci']\ndiff --git a/lib/librte_vhost/rte_vdpa.h b/lib/librte_vhost/rte_vdpa.h\nindex 776ed67c16..5065e2130e 100644\n--- a/lib/librte_vhost/rte_vdpa.h\n+++ b/lib/librte_vhost/rte_vdpa.h\n@@ -11,13 +11,6 @@\n * Device specific vhost lib\n */\n \n-#include <stdbool.h>\n-\n-#include <rte_pci.h>\n-#include \"rte_vhost.h\"\n-\n-#define MAX_VDPA_NAME_LEN 128\n-\n /** Maximum name length for statistics counters */\n #define RTE_VDPA_STATS_NAME_SIZE 64\n \n@@ -48,103 +41,6 @@ struct rte_vdpa_stat_name {\n \tchar name[RTE_VDPA_STATS_NAME_SIZE]; /**< The statistic name */\n };\n \n-/**\n- * vdpa device operations\n- */\n-struct rte_vdpa_dev_ops {\n-\t/** Get capabilities of this device */\n-\tint (*get_queue_num)(struct rte_vdpa_device *dev, uint32_t *queue_num);\n-\n-\t/** Get supported features of this device */\n-\tint (*get_features)(struct rte_vdpa_device *dev, uint64_t *features);\n-\n-\t/** Get supported protocol features of this device */\n-\tint (*get_protocol_features)(struct rte_vdpa_device *dev,\n-\t\t\tuint64_t *protocol_features);\n-\n-\t/** Driver configure/close the device */\n-\tint (*dev_conf)(int vid);\n-\tint (*dev_close)(int vid);\n-\n-\t/** Enable/disable this vring */\n-\tint (*set_vring_state)(int vid, int vring, int state);\n-\n-\t/** Set features when changed */\n-\tint (*set_features)(int vid);\n-\n-\t/** Destination operations when migration done */\n-\tint (*migration_done)(int vid);\n-\n-\t/** Get the vfio group fd */\n-\tint (*get_vfio_group_fd)(int vid);\n-\n-\t/** Get the vfio device fd */\n-\tint (*get_vfio_device_fd)(int vid);\n-\n-\t/** Get the notify area info of the queue */\n-\tint (*get_notify_area)(int vid, int qid,\n-\t\t\tuint64_t *offset, uint64_t *size);\n-\n-\t/** Get statistics name */\n-\tint (*get_stats_names)(struct rte_vdpa_device *dev,\n-\t\t\tstruct rte_vdpa_stat_name *stats_names,\n-\t\t\tunsigned int size);\n-\n-\t/** Get statistics of the queue */\n-\tint (*get_stats)(struct rte_vdpa_device *dev, int qid,\n-\t\t\tstruct rte_vdpa_stat *stats, unsigned int n);\n-\n-\t/** Reset statistics of the queue */\n-\tint (*reset_stats)(struct rte_vdpa_device *dev, int qid);\n-\n-\t/** Reserved for future extension */\n-\tvoid *reserved[2];\n-};\n-\n-/**\n- * vdpa device structure includes device address and device operations.\n- */\n-struct rte_vdpa_device {\n-\tTAILQ_ENTRY(rte_vdpa_device) next;\n-\t/** Generic device information */\n-\tstruct rte_device *device;\n-\t/** vdpa device operations */\n-\tstruct rte_vdpa_dev_ops *ops;\n-} __rte_cache_aligned;\n-\n-/**\n- * @warning\n- * @b EXPERIMENTAL: this API may change without prior notice\n- *\n- * Register a vdpa device\n- *\n- * @param addr\n- * the vdpa device address\n- * @param ops\n- * the vdpa device operations\n- * @return\n- * vDPA device pointer on success, NULL on failure\n- */\n-__rte_experimental\n-struct rte_vdpa_device *\n-rte_vdpa_register_device(struct rte_device *rte_dev,\n-\t\tstruct rte_vdpa_dev_ops *ops);\n-\n-/**\n- * @warning\n- * @b EXPERIMENTAL: this API may change without prior notice\n- *\n- * Unregister a vdpa device\n- *\n- * @param did\n- * vDPA device pointer\n- * @return\n- * device id on success, -1 on failure\n- */\n-__rte_experimental\n-int\n-rte_vdpa_unregister_device(struct rte_vdpa_device *);\n-\n /**\n * @warning\n * @b EXPERIMENTAL: this API may change without prior notice\n@@ -175,44 +71,6 @@ __rte_experimental\n struct rte_device *\n rte_vdpa_get_rte_device(struct rte_vdpa_device *vdpa_dev);\n \n-/**\n- * @warning\n- * @b EXPERIMENTAL: this API may change without prior notice\n- *\n- * Enable/Disable host notifier mapping for a vdpa port.\n- *\n- * @param vid\n- * vhost device id\n- * @param enable\n- * true for host notifier map, false for host notifier unmap\n- * @return\n- * 0 on success, -1 on failure\n- */\n-__rte_experimental\n-int\n-rte_vhost_host_notifier_ctrl(int vid, bool enable);\n-\n-/**\n- * @warning\n- * @b EXPERIMENTAL: this API may change without prior notice\n- *\n- * Synchronize the used ring from mediated ring to guest, log dirty\n- * page for each writeable buffer, caller should handle the used\n- * ring logging before device stop.\n- *\n- * @param vid\n- * vhost device id\n- * @param qid\n- * vhost queue id\n- * @param vring_m\n- * mediated virtio ring pointer\n- * @return\n- * number of synced used entries on success, -1 on failure\n- */\n-__rte_experimental\n-int\n-rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m);\n-\n /**\n * @warning\n * @b EXPERIMENTAL: this API may change without prior notice\ndiff --git a/lib/librte_vhost/rte_vdpa_dev.h b/lib/librte_vhost/rte_vdpa_dev.h\nnew file mode 100644\nindex 0000000000..fecaa8e081\n--- /dev/null\n+++ b/lib/librte_vhost/rte_vdpa_dev.h\n@@ -0,0 +1,147 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2018 Intel Corporation\n+ */\n+\n+#ifndef _RTE_VDPA_H_DEV_\n+#define _RTE_VDPA_H_DEV_\n+\n+#include <stdbool.h>\n+\n+#include \"rte_vhost.h\"\n+\n+/**\n+ * vdpa device operations\n+ */\n+struct rte_vdpa_dev_ops {\n+\t/** Get capabilities of this device */\n+\tint (*get_queue_num)(struct rte_vdpa_device *dev, uint32_t *queue_num);\n+\n+\t/** Get supported features of this device */\n+\tint (*get_features)(struct rte_vdpa_device *dev, uint64_t *features);\n+\n+\t/** Get supported protocol features of this device */\n+\tint (*get_protocol_features)(struct rte_vdpa_device *dev,\n+\t\t\tuint64_t *protocol_features);\n+\n+\t/** Driver configure/close the device */\n+\tint (*dev_conf)(int vid);\n+\tint (*dev_close)(int vid);\n+\n+\t/** Enable/disable this vring */\n+\tint (*set_vring_state)(int vid, int vring, int state);\n+\n+\t/** Set features when changed */\n+\tint (*set_features)(int vid);\n+\n+\t/** Destination operations when migration done */\n+\tint (*migration_done)(int vid);\n+\n+\t/** Get the vfio group fd */\n+\tint (*get_vfio_group_fd)(int vid);\n+\n+\t/** Get the vfio device fd */\n+\tint (*get_vfio_device_fd)(int vid);\n+\n+\t/** Get the notify area info of the queue */\n+\tint (*get_notify_area)(int vid, int qid,\n+\t\t\tuint64_t *offset, uint64_t *size);\n+\n+\t/** Get statistics name */\n+\tint (*get_stats_names)(struct rte_vdpa_device *dev,\n+\t\t\tstruct rte_vdpa_stat_name *stats_names,\n+\t\t\tunsigned int size);\n+\n+\t/** Get statistics of the queue */\n+\tint (*get_stats)(struct rte_vdpa_device *dev, int qid,\n+\t\t\tstruct rte_vdpa_stat *stats, unsigned int n);\n+\n+\t/** Reset statistics of the queue */\n+\tint (*reset_stats)(struct rte_vdpa_device *dev, int qid);\n+\n+\t/** Reserved for future extension */\n+\tvoid *reserved[2];\n+};\n+\n+/**\n+ * vdpa device structure includes device address and device operations.\n+ */\n+struct rte_vdpa_device {\n+\tTAILQ_ENTRY(rte_vdpa_device) next;\n+\t/** Generic device information */\n+\tstruct rte_device *device;\n+\t/** vdpa device operations */\n+\tstruct rte_vdpa_dev_ops *ops;\n+};\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * Register a vdpa device\n+ *\n+ * @param rte_dev\n+ * the generic device pointer\n+ * @param ops\n+ * the vdpa device operations\n+ * @return\n+ * vDPA device pointer on success, NULL on failure\n+ */\n+__rte_experimental\n+struct rte_vdpa_device *\n+rte_vdpa_register_device(struct rte_device *rte_dev,\n+\t\tstruct rte_vdpa_dev_ops *ops);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * Unregister a vdpa device\n+ *\n+ * @param dev\n+ * vDPA device pointer\n+ * @return\n+ * device id on success, -1 on failure\n+ */\n+__rte_experimental\n+int\n+rte_vdpa_unregister_device(struct rte_vdpa_device *dev);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * Enable/Disable host notifier mapping for a vdpa port.\n+ *\n+ * @param vid\n+ * vhost device id\n+ * @param enable\n+ * true for host notifier map, false for host notifier unmap\n+ * @return\n+ * 0 on success, -1 on failure\n+ */\n+__rte_experimental\n+int\n+rte_vhost_host_notifier_ctrl(int vid, bool enable);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * Synchronize the used ring from mediated ring to guest, log dirty\n+ * page for each writeable buffer, caller should handle the used\n+ * ring logging before device stop.\n+ *\n+ * @param vid\n+ * vhost device id\n+ * @param qid\n+ * vhost queue id\n+ * @param vring_m\n+ * mediated virtio ring pointer\n+ * @return\n+ * number of synced used entries on success, -1 on failure\n+ */\n+__rte_experimental\n+int\n+rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m);\n+\n+#endif /* _RTE_VDPA_DEV_H_ */\ndiff --git a/lib/librte_vhost/vdpa.c b/lib/librte_vhost/vdpa.c\nindex e41c73eb9a..ef21ca2a1e 100644\n--- a/lib/librte_vhost/vdpa.c\n+++ b/lib/librte_vhost/vdpa.c\n@@ -17,6 +17,7 @@\n #include <rte_tailq.h>\n \n #include \"rte_vdpa.h\"\n+#include \"rte_vdpa_dev.h\"\n #include \"vhost.h\"\n \n /** Double linked list of vDPA devices. */\ndiff --git a/lib/librte_vhost/vhost.h b/lib/librte_vhost/vhost.h\nindex 819857a65a..941a42637e 100644\n--- a/lib/librte_vhost/vhost.h\n+++ b/lib/librte_vhost/vhost.h\n@@ -22,6 +22,7 @@\n \n #include \"rte_vhost.h\"\n #include \"rte_vdpa.h\"\n+#include \"rte_vdpa_dev.h\"\n \n /* Used to indicate that the device is running on a data core */\n #define VIRTIO_DEV_RUNNING 1\n", "prefixes": [ "v3", "14/14" ] }{ "id": 72260, "url": "