Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/42186/?format=api
http://patches.dpdk.org/api/patches/42186/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/3667a6b1e86515385b245e6dfe9d919aadaa3309.1530655929.git.gaetan.rivet@6wind.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": "<3667a6b1e86515385b245e6dfe9d919aadaa3309.1530655929.git.gaetan.rivet@6wind.com>", "list_archive_url": "https://inbox.dpdk.org/dev/3667a6b1e86515385b245e6dfe9d919aadaa3309.1530655929.git.gaetan.rivet@6wind.com", "date": "2018-07-03T22:15:00", "name": "[v9,17/27] bus/vdev: implement device iteration", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "006dc26869453e7faba26a45d076a9f302f60594", "submitter": { "id": 269, "url": "http://patches.dpdk.org/api/people/269/?format=api", "name": "Gaëtan Rivet", "email": "gaetan.rivet@6wind.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/3667a6b1e86515385b245e6dfe9d919aadaa3309.1530655929.git.gaetan.rivet@6wind.com/mbox/", "series": [ { "id": 383, "url": "http://patches.dpdk.org/api/series/383/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=383", "date": "2018-07-03T22:14:43", "name": "Device querying", "version": 9, "mbox": "http://patches.dpdk.org/series/383/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/42186/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/42186/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 75F951BEB8;\n\tWed, 4 Jul 2018 00:16:05 +0200 (CEST)", "from mail-wr0-f195.google.com (mail-wr0-f195.google.com\n\t[209.85.128.195]) by dpdk.org (Postfix) with ESMTP id E1BD61BE8E\n\tfor <dev@dpdk.org>; Wed, 4 Jul 2018 00:15:57 +0200 (CEST)", "by mail-wr0-f195.google.com with SMTP id q10-v6so3380185wrd.4\n\tfor <dev@dpdk.org>; Tue, 03 Jul 2018 15:15:57 -0700 (PDT)", "from bidouze.dev.6wind.com. (host.78.145.23.62.rev.coltfrance.com.\n\t[62.23.145.78]) by smtp.gmail.com with ESMTPSA id\n\ti190-v6sm3771084wmd.33.2018.07.03.15.15.55\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tTue, 03 Jul 2018 15:15:55 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=6wind-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:in-reply-to:references:content-transfer-encoding;\n\tbh=6zLB/7Lvj/weV9uPcrzjEA180HzB3jVsaOXY8Z/yJZQ=;\n\tb=yqMFh/aDPqezTy7mTVZqycXz30Zuogzq904IiNC/i9yle7uE/eRdjY+fqw33s/O3wi\n\tZlt+p3qzHW0Wo60OG16awDa0+t5Lca6gYTDvJayoiGIjE5b7K0OX1TQXGO7ZF5phTeJk\n\t1EWGNIvvoxeW9qT0eh0/lFRM6HxFIXib2m/aexJzaYJLnMlRl3KoqFyhbIwojOjMYM5I\n\tTZCcZEkmB6qktzSOo6IWCMjs1Z+/N2GlNok+4GXG778wBjcDX3fuVrnr2NYnL6Ue5P6S\n\td6L5PhNa+XMSaWo3av0T2Hd+i1vQAtd6XQJD5D9C+POtxNuWQ2YAoouUuNWRfgb88yoj\n\tpOjQ==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:in-reply-to:references\n\t:content-transfer-encoding;\n\tbh=6zLB/7Lvj/weV9uPcrzjEA180HzB3jVsaOXY8Z/yJZQ=;\n\tb=XFN4vbPdQx5kTNjrw85kjIn4CkozAIz/WG0uj+CmJOvOhkiMR0V+3to88Knfd/9/Sd\n\tZGhZYiK51J8k3TyGabuPMGCJoc2r9FSFxW2UcEmmss/DzoXJ3w0IMQlLHrsIFM1FanJZ\n\t7G6jJi5Ik+jGPfYCXghWJ18BiLPPnsir1wYmN7zwWbDe5f9ToXl+G7Ltw7cp/jfjnSiL\n\td0swsq9Pba0bsVNC28rC2cE8M2zdRHtWS3cmy+CUyU2/M6+14bz/XZVXe+WP5TJjqqpE\n\tSdTCM5JTJRHug70oco+fiSpW+Nz8gJotFWGkMHrQE77GQJlyrNgfGet+yxYskdmrsAm2\n\tpGJw==", "X-Gm-Message-State": "APt69E3lQ3IUxD9I58gMYXwKavd/MLuJlnVmC+Qdu8B2SJ6EVTGsopTR\n\toOsXVsPjB443g94agO2wOFahQ9f6", "X-Google-Smtp-Source": "AAOMgpelfcOULdEmBCtZLZ6NmPOoFUnY+nErJsBiD5mXE4I/1uA33InlyWKMiaarDmzXyHQ24uVLOg==", "X-Received": "by 2002:adf:8e89:: with SMTP id\n\tq9-v6mr22328296wrb.261.1530656157184; \n\tTue, 03 Jul 2018 15:15:57 -0700 (PDT)", "From": "Gaetan Rivet <gaetan.rivet@6wind.com>", "To": "dev@dpdk.org", "Cc": "Gaetan Rivet <gaetan.rivet@6wind.com>", "Date": "Wed, 4 Jul 2018 00:15:00 +0200", "Message-Id": "<3667a6b1e86515385b245e6dfe9d919aadaa3309.1530655929.git.gaetan.rivet@6wind.com>", "X-Mailer": "git-send-email 2.11.0", "In-Reply-To": [ "<cover.1530655929.git.gaetan.rivet@6wind.com>", "<cover.1530655929.git.gaetan.rivet@6wind.com>" ], "References": [ "<cover.1521124599.git.gaetan.rivet@6wind.com>\n\t<cover.1530655929.git.gaetan.rivet@6wind.com>", "<cover.1530655929.git.gaetan.rivet@6wind.com>" ], "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH v9 17/27] bus/vdev: implement device iteration", "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": "Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>\n---\n drivers/bus/vdev/Makefile | 3 ++-\n drivers/bus/vdev/vdev.c | 10 ++++----\n drivers/bus/vdev/vdev_params.c | 51 +++++++++++++++++++++++++++++++++++++++++\n drivers/bus/vdev/vdev_private.h | 26 +++++++++++++++++++++\n 4 files changed, 85 insertions(+), 5 deletions(-)\n create mode 100644 drivers/bus/vdev/vdev_params.c\n create mode 100644 drivers/bus/vdev/vdev_private.h", "diff": "diff --git a/drivers/bus/vdev/Makefile b/drivers/bus/vdev/Makefile\nindex bd0bb8955..1f9cd7ebe 100644\n--- a/drivers/bus/vdev/Makefile\n+++ b/drivers/bus/vdev/Makefile\n@@ -19,8 +19,9 @@ EXPORT_MAP := rte_bus_vdev_version.map\n LIBABIVER := 1\n \n SRCS-y += vdev.c\n+SRCS-y += vdev_params.c\n \n-LDLIBS += -lrte_eal\n+LDLIBS += -lrte_eal -lrte_kvargs\n \n #\n # Export include files\ndiff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c\nindex 6139dd551..e8518833d 100644\n--- a/drivers/bus/vdev/vdev.c\n+++ b/drivers/bus/vdev/vdev.c\n@@ -23,6 +23,7 @@\n \n #include \"rte_bus_vdev.h\"\n #include \"vdev_logs.h\"\n+#include \"vdev_private.h\"\n \n #define VDEV_MP_KEY\t\"bus_vdev_mp\"\n \n@@ -493,9 +494,9 @@ vdev_probe(void)\n \treturn ret;\n }\n \n-static struct rte_device *\n-vdev_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,\n-\t\t const void *data)\n+struct rte_device *\n+rte_vdev_find_device(const struct rte_device *start, rte_dev_cmp_t cmp,\n+\t\t const void *data)\n {\n \tconst struct rte_vdev_device *vstart;\n \tstruct rte_vdev_device *dev;\n@@ -532,10 +533,11 @@ vdev_unplug(struct rte_device *dev)\n static struct rte_bus rte_vdev_bus = {\n \t.scan = vdev_scan,\n \t.probe = vdev_probe,\n-\t.find_device = vdev_find_device,\n+\t.find_device = rte_vdev_find_device,\n \t.plug = vdev_plug,\n \t.unplug = vdev_unplug,\n \t.parse = vdev_parse,\n+\t.dev_iterate = rte_vdev_dev_iterate,\n };\n \n RTE_REGISTER_BUS(vdev, rte_vdev_bus);\ndiff --git a/drivers/bus/vdev/vdev_params.c b/drivers/bus/vdev/vdev_params.c\nnew file mode 100644\nindex 000000000..842a4684e\n--- /dev/null\n+++ b/drivers/bus/vdev/vdev_params.c\n@@ -0,0 +1,51 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2018 Gaëtan Rivet\n+ */\n+\n+#include <rte_dev.h>\n+#include <rte_bus.h>\n+#include <rte_kvargs.h>\n+#include <rte_errno.h>\n+\n+#include \"vdev_logs.h\"\n+#include \"vdev_private.h\"\n+\n+enum vdev_params {\n+\tRTE_VDEV_PARAMS_MAX,\n+};\n+\n+static const char * const vdev_params_keys[] = {\n+\t[RTE_VDEV_PARAMS_MAX] = NULL,\n+};\n+\n+static int\n+vdev_dev_match(const struct rte_device *dev,\n+\t const void *_kvlist)\n+{\n+\tconst struct rte_kvargs *kvlist = _kvlist;\n+\n+\t(void) kvlist;\n+\t(void) dev;\n+\treturn 0;\n+}\n+\n+void *\n+rte_vdev_dev_iterate(const void *start,\n+\t\t const char *str,\n+\t\t const struct rte_dev_iterator *it __rte_unused)\n+{\n+\tstruct rte_kvargs *kvargs = NULL;\n+\tstruct rte_device *dev;\n+\n+\tif (str != NULL) {\n+\t\tkvargs = rte_kvargs_parse(str, vdev_params_keys);\n+\t\tif (kvargs == NULL) {\n+\t\t\tVDEV_LOG(ERR, \"cannot parse argument list\\n\");\n+\t\t\trte_errno = EINVAL;\n+\t\t\treturn NULL;\n+\t\t}\n+\t}\n+\tdev = rte_vdev_find_device(start, vdev_dev_match, kvargs);\n+\trte_kvargs_free(kvargs);\n+\treturn dev;\n+}\ndiff --git a/drivers/bus/vdev/vdev_private.h b/drivers/bus/vdev/vdev_private.h\nnew file mode 100644\nindex 000000000..ba6dc48ff\n--- /dev/null\n+++ b/drivers/bus/vdev/vdev_private.h\n@@ -0,0 +1,26 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright 2018 Gaëtan Rivet\n+ */\n+\n+#ifndef _VDEV_PRIVATE_H_\n+#define _VDEV_PRIVATE_H_\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+struct rte_device *\n+rte_vdev_find_device(const struct rte_device *start,\n+\t\t rte_dev_cmp_t cmp,\n+\t\t const void *data);\n+\n+void *\n+rte_vdev_dev_iterate(const void *start,\n+\t\t const char *str,\n+\t\t const struct rte_dev_iterator *it);\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* _VDEV_PRIVATE_H_ */\n", "prefixes": [ "v9", "17/27" ] }{ "id": 42186, "url": "