Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/48722/?format=api
http://patches.dpdk.org/api/patches/48722/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20181213011014.110089-6-xiao.w.wang@intel.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": "<20181213011014.110089-6-xiao.w.wang@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20181213011014.110089-6-xiao.w.wang@intel.com", "date": "2018-12-13T01:10:10", "name": "[v2,5/9] net/ifc: detect if VDPA mode is specified", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "0bee0d3b27f5a100f7bd7826bc3eb0528270c883", "submitter": { "id": 281, "url": "http://patches.dpdk.org/api/people/281/?format=api", "name": "Xiao Wang", "email": "xiao.w.wang@intel.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/20181213011014.110089-6-xiao.w.wang@intel.com/mbox/", "series": [ { "id": 2747, "url": "http://patches.dpdk.org/api/series/2747/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=2747", "date": "2018-12-13T01:10:05", "name": "support SW assisted VDPA live migration", "version": 2, "mbox": "http://patches.dpdk.org/series/2747/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/48722/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/48722/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 BF6201B463;\n\tThu, 13 Dec 2018 02:23:12 +0100 (CET)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id E13D41B46A\n\tfor <dev@dpdk.org>; Thu, 13 Dec 2018 02:23:10 +0100 (CET)", "from orsmga008.jf.intel.com ([10.7.209.65])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t12 Dec 2018 17:23:10 -0800", "from dpdk-xiao-1.sh.intel.com ([10.67.111.145])\n\tby orsmga008.jf.intel.com with ESMTP; 12 Dec 2018 17:23:09 -0800" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.56,346,1539673200\"; d=\"scan'208\";a=\"101112888\"", "From": "Xiao Wang <xiao.w.wang@intel.com>", "To": "alejandro.lucero@netronome.com,\n\ttiwei.bie@intel.com", "Cc": "maxime.coquelin@redhat.com, dev@dpdk.org, zhihong.wang@intel.com,\n\txiaolong.ye@intel.com, Xiao Wang <xiao.w.wang@intel.com>", "Date": "Thu, 13 Dec 2018 09:10:10 +0800", "Message-Id": "<20181213011014.110089-6-xiao.w.wang@intel.com>", "X-Mailer": "git-send-email 2.15.1", "In-Reply-To": "<20181213011014.110089-1-xiao.w.wang@intel.com>", "References": "<20181128094607.106173-3-xiao.w.wang@intel.com>\n\t<20181213011014.110089-1-xiao.w.wang@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 5/9] net/ifc: detect if VDPA mode is specified", "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": "If user wants the VF to be used in VDPA (vhost data path acceleration)\nmode, then the user can add a \"vdpa=1\" parameter for the device.\n\nSo if driver doesn't not find this option, it should quit and let the\nbus continue the probe.\n\nSigned-off-by: Xiao Wang <xiao.w.wang@intel.com>\n---\n drivers/net/ifc/ifcvf_vdpa.c | 47 ++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 47 insertions(+)", "diff": "diff --git a/drivers/net/ifc/ifcvf_vdpa.c b/drivers/net/ifc/ifcvf_vdpa.c\nindex 6fcd50b73..c0e50354a 100644\n--- a/drivers/net/ifc/ifcvf_vdpa.c\n+++ b/drivers/net/ifc/ifcvf_vdpa.c\n@@ -17,6 +17,8 @@\n #include <rte_vfio.h>\n #include <rte_spinlock.h>\n #include <rte_log.h>\n+#include <rte_kvargs.h>\n+#include <rte_devargs.h>\n \n #include \"base/ifcvf.h\"\n \n@@ -28,6 +30,13 @@\n #define PAGE_SIZE 4096\n #endif\n \n+#define IFCVF_VDPA_MODE\t\t\"vdpa\"\n+\n+static const char * const ifcvf_valid_arguments[] = {\n+\tIFCVF_VDPA_MODE,\n+\tNULL\n+};\n+\n static int ifcvf_vdpa_logtype;\n \n struct ifcvf_internal {\n@@ -735,6 +744,21 @@ static struct rte_vdpa_dev_ops ifcvf_ops = {\n \t.get_notify_area = ifcvf_get_notify_area,\n };\n \n+static inline int\n+open_int(const char *key __rte_unused, const char *value, void *extra_args)\n+{\n+\tuint16_t *n = extra_args;\n+\n+\tif (value == NULL || extra_args == NULL)\n+\t\treturn -EINVAL;\n+\n+\t*n = (uint16_t)strtoul(value, NULL, 0);\n+\tif (*n == USHRT_MAX && errno == ERANGE)\n+\t\treturn -1;\n+\n+\treturn 0;\n+}\n+\n static int\n ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \t\tstruct rte_pci_device *pci_dev)\n@@ -742,10 +766,31 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \tuint64_t features;\n \tstruct ifcvf_internal *internal = NULL;\n \tstruct internal_list *list = NULL;\n+\tint vdpa_mode = 0;\n+\tstruct rte_kvargs *kvlist = NULL;\n+\tint ret = 0;\n \n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY)\n \t\treturn 0;\n \n+\tkvlist = rte_kvargs_parse(pci_dev->device.devargs->args,\n+\t\t\tifcvf_valid_arguments);\n+\tif (kvlist == NULL)\n+\t\treturn 1;\n+\n+\t/* probe only when vdpa mode is specified */\n+\tif (rte_kvargs_count(kvlist, IFCVF_VDPA_MODE) == 0) {\n+\t\trte_kvargs_free(kvlist);\n+\t\treturn 1;\n+\t}\n+\n+\tret = rte_kvargs_process(kvlist, IFCVF_VDPA_MODE, &open_int,\n+\t\t\t&vdpa_mode);\n+\tif (ret < 0 || vdpa_mode == 0) {\n+\t\trte_kvargs_free(kvlist);\n+\t\treturn 1;\n+\t}\n+\n \tlist = rte_zmalloc(\"ifcvf\", sizeof(*list), 0);\n \tif (list == NULL)\n \t\tgoto error;\n@@ -795,9 +840,11 @@ ifcvf_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\n \trte_atomic32_set(&internal->started, 1);\n \tupdate_datapath(internal);\n \n+\trte_kvargs_free(kvlist);\n \treturn 0;\n \n error:\n+\trte_kvargs_free(kvlist);\n \trte_free(list);\n \trte_free(internal);\n \treturn -1;\n", "prefixes": [ "v2", "5/9" ] }{ "id": 48722, "url": "