Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/115860/?format=api
http://patches.dpdk.org/api/patches/115860/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220905083933.2506819-21-david.marchand@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": "<20220905083933.2506819-21-david.marchand@redhat.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20220905083933.2506819-21-david.marchand@redhat.com", "date": "2022-09-05T08:39:26", "name": "[v5,20/27] bus: introduce accessors", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "9268234e95bb8c80b845d1072dd47ba3c711241a", "submitter": { "id": 1173, "url": "http://patches.dpdk.org/api/people/1173/?format=api", "name": "David Marchand", "email": "david.marchand@redhat.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/20220905083933.2506819-21-david.marchand@redhat.com/mbox/", "series": [ { "id": 24531, "url": "http://patches.dpdk.org/api/series/24531/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=24531", "date": "2022-09-05T08:39:07", "name": "[v5,01/27] devtools: forbid inclusions of driver only headers", "version": 5, "mbox": "http://patches.dpdk.org/series/24531/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/115860/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/115860/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id E1B4DA054A;\n\tMon, 5 Sep 2022 10:42:00 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E551B427F9;\n\tMon, 5 Sep 2022 10:41:20 +0200 (CEST)", "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by mails.dpdk.org (Postfix) with ESMTP id E27ED4114A\n for <dev@dpdk.org>; Mon, 5 Sep 2022 10:41:19 +0200 (CEST)", "from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com\n [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-428-w60Wv1aONnW7Npq4bMPPnw-1; Mon, 05 Sep 2022 04:41:10 -0400", "from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com\n [10.11.54.3])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 556831C0BC69;\n Mon, 5 Sep 2022 08:41:10 +0000 (UTC)", "from fchome.redhat.com (unknown [10.40.193.251])\n by smtp.corp.redhat.com (Postfix) with ESMTP id EE69B1121314;\n Mon, 5 Sep 2022 08:41:08 +0000 (UTC)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1662367279;\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=9ikW6gNuIDelk+rdxfQDUCQ6FUGRqZtS2jz9ir1Ac7Y=;\n b=hNYpg9mW0VBdY3T7fCrezG1kB9YRRnCLPMG394mNfwx47Hqa+tt47OKGp5TXHbBL1VxvfP\n QbdtCyuQTYCG8r9/n0Fg4c+Pgy3SCLoehaFGtA7ghfTqrC+v7Lm5gi74a2N63qtvvP//Ip\n PFFa4fZLYBIjAXd9CpogD5dMSVeSBp4=", "X-MC-Unique": "w60Wv1aONnW7Npq4bMPPnw-1", "From": "David Marchand <david.marchand@redhat.com>", "To": "dev@dpdk.org", "Cc": "thomas@monjalon.net, bruce.richardson@intel.com,\n Aman Singh <aman.deep.singh@intel.com>,\n Yuying Zhang <yuying.zhang@intel.com>,\n Anatoly Burakov <anatoly.burakov@intel.com>, Ray Kinsella <mdr@ashroe.eu>", "Subject": "[PATCH v5 20/27] bus: introduce accessors", "Date": "Mon, 5 Sep 2022 10:39:26 +0200", "Message-Id": "<20220905083933.2506819-21-david.marchand@redhat.com>", "In-Reply-To": "<20220905083933.2506819-1-david.marchand@redhat.com>", "References": "<20220628144643.1213026-1-david.marchand@redhat.com>\n <20220905083933.2506819-1-david.marchand@redhat.com>", "MIME-Version": "1.0", "X-Scanned-By": "MIMEDefang 2.78 on 10.11.54.3", "X-Mimecast-Spam-Score": "0", "X-Mimecast-Originator": "redhat.com", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "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" }, "content": "Add helpers to get a rte_bus object details.\nThis will be used externally.\nInternal users may still dereference a rte_bus object.\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\nAcked-by: Bruce Richardson <bruce.richardson@intel.com>\n---\nChanges since RFC v1:\n- changed approach: only external users are updated,\n\n---\n app/test-pmd/config.c | 4 +--\n app/test-pmd/testpmd.c | 4 +--\n app/test/test_devargs.c | 4 +--\n examples/multi_process/hotplug_mp/commands.c | 4 +--\n lib/eal/common/eal_common_bus.c | 26 ++++++++++++--------\n lib/eal/include/rte_bus.h | 14 +++++++++++\n lib/eal/version.map | 3 +++\n 7 files changed, 41 insertions(+), 18 deletions(-)", "diff": "diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex d988429f24..7bd28ee3e8 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -642,7 +642,7 @@ device_infos_display(const char *identifier)\n \t\tif (identifier && da.bus != next)\n \t\t\tcontinue;\n \n-\t\tsnprintf(devstr, sizeof(devstr), \"bus=%s\", next->name);\n+\t\tsnprintf(devstr, sizeof(devstr), \"bus=%s\", rte_bus_name(next));\n \t\tRTE_DEV_FOREACH(dev, devstr, &dev_iter) {\n \n \t\t\tif (!dev->driver)\n@@ -653,7 +653,7 @@ device_infos_display(const char *identifier)\n \t\t\t\tcontinue;\n \t\t\tprintf(\"\\n%s Infos for device %s %s\\n\",\n \t\t\t info_border, dev->name, info_border);\n-\t\t\tprintf(\"Bus name: %s\", dev->bus->name);\n+\t\t\tprintf(\"Bus name: %s\", rte_bus_name(dev->bus));\n \t\t\tprintf(\"\\nDriver name: %s\", dev->driver->name);\n \t\t\tprintf(\"\\nDevargs: %s\",\n \t\t\t dev->devargs ? dev->devargs->args : \"\");\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex 510e0be624..c7d1fa2719 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -3507,9 +3507,9 @@ detach_devargs(char *identifier)\n \t\t}\n \t}\n \n-\tif (rte_eal_hotplug_remove(da.bus->name, da.name) != 0) {\n+\tif (rte_eal_hotplug_remove(rte_bus_name(da.bus), da.name) != 0) {\n \t\tTESTPMD_LOG(ERR, \"Failed to detach device %s(%s)\\n\",\n-\t\t\t da.name, da.bus->name);\n+\t\t\t da.name, rte_bus_name(da.bus));\n \t\trte_devargs_reset(&da);\n \t\treturn;\n \t}\ndiff --git a/app/test/test_devargs.c b/app/test/test_devargs.c\nindex 16621285d2..ac5bc34c18 100644\n--- a/app/test/test_devargs.c\n+++ b/app/test/test_devargs.c\n@@ -98,9 +98,9 @@ test_valid_devargs_cases(const struct devargs_case *list, size_t n)\n \t\t\t list[i].bus_kv) != 0)\n \t\t\tgoto fail;\n \t\tif (list[i].bus != NULL &&\n-\t\t strcmp(da.bus->name, list[i].bus) != 0) {\n+\t\t strcmp(rte_bus_name(da.bus), list[i].bus) != 0) {\n \t\t\tprintf(\"rte_devargs_parse(%s) bus name (%s) not expected (%s)\\n\",\n-\t\t\t list[i].devargs, da.bus->name, list[i].bus);\n+\t\t\t list[i].devargs, rte_bus_name(da.bus), list[i].bus);\n \t\t\tgoto fail;\n \t\t}\n \t\tif ((list[i].class_kv > 0 || list[i].class != NULL) &&\ndiff --git a/examples/multi_process/hotplug_mp/commands.c b/examples/multi_process/hotplug_mp/commands.c\nindex da8b5e5924..88f44e00a0 100644\n--- a/examples/multi_process/hotplug_mp/commands.c\n+++ b/examples/multi_process/hotplug_mp/commands.c\n@@ -126,7 +126,7 @@ static void cmd_dev_attach_parsed(void *parsed_result,\n \t\treturn;\n \t}\n \n-\tif (!rte_eal_hotplug_add(da.bus->name, da.name, da.args))\n+\tif (!rte_eal_hotplug_add(rte_bus_name(da.bus), da.name, da.args))\n \t\tcmdline_printf(cl, \"attached device %s\\n\", da.name);\n \telse\n \t\tcmdline_printf(cl, \"failed to attached device %s\\n\",\n@@ -173,7 +173,7 @@ static void cmd_dev_detach_parsed(void *parsed_result,\n \t}\n \n \tprintf(\"detaching...\\n\");\n-\tif (!rte_eal_hotplug_remove(da.bus->name, da.name))\n+\tif (!rte_eal_hotplug_remove(rte_bus_name(da.bus), da.name))\n \t\tcmdline_printf(cl, \"detached device %s\\n\",\n \t\t\tda.name);\n \telse\ndiff --git a/lib/eal/common/eal_common_bus.c b/lib/eal/common/eal_common_bus.c\nindex baa5b532af..cbf382f967 100644\n--- a/lib/eal/common/eal_common_bus.c\n+++ b/lib/eal/common/eal_common_bus.c\n@@ -16,11 +16,17 @@\n static struct rte_bus_list rte_bus_list =\n \tTAILQ_HEAD_INITIALIZER(rte_bus_list);\n \n+const char *\n+rte_bus_name(const struct rte_bus *bus)\n+{\n+\treturn bus->name;\n+}\n+\n void\n rte_bus_register(struct rte_bus *bus)\n {\n \tRTE_VERIFY(bus);\n-\tRTE_VERIFY(bus->name && strlen(bus->name));\n+\tRTE_VERIFY(rte_bus_name(bus) && strlen(rte_bus_name(bus)));\n \t/* A bus should mandatorily have the scan implemented */\n \tRTE_VERIFY(bus->scan);\n \tRTE_VERIFY(bus->probe);\n@@ -29,14 +35,14 @@ rte_bus_register(struct rte_bus *bus)\n \tRTE_VERIFY(!bus->plug || bus->unplug);\n \n \tTAILQ_INSERT_TAIL(&rte_bus_list, bus, next);\n-\tRTE_LOG(DEBUG, EAL, \"Registered [%s] bus.\\n\", bus->name);\n+\tRTE_LOG(DEBUG, EAL, \"Registered [%s] bus.\\n\", rte_bus_name(bus));\n }\n \n void\n rte_bus_unregister(struct rte_bus *bus)\n {\n \tTAILQ_REMOVE(&rte_bus_list, bus, next);\n-\tRTE_LOG(DEBUG, EAL, \"Unregistered [%s] bus.\\n\", bus->name);\n+\tRTE_LOG(DEBUG, EAL, \"Unregistered [%s] bus.\\n\", rte_bus_name(bus));\n }\n \n /* Scan all the buses for registered devices */\n@@ -50,7 +56,7 @@ rte_bus_scan(void)\n \t\tret = bus->scan();\n \t\tif (ret)\n \t\t\tRTE_LOG(ERR, EAL, \"Scan for (%s) bus failed.\\n\",\n-\t\t\t\tbus->name);\n+\t\t\t\trte_bus_name(bus));\n \t}\n \n \treturn 0;\n@@ -64,7 +70,7 @@ rte_bus_probe(void)\n \tstruct rte_bus *bus, *vbus = NULL;\n \n \tTAILQ_FOREACH(bus, &rte_bus_list, next) {\n-\t\tif (!strcmp(bus->name, \"vdev\")) {\n+\t\tif (!strcmp(rte_bus_name(bus), \"vdev\")) {\n \t\t\tvbus = bus;\n \t\t\tcontinue;\n \t\t}\n@@ -72,14 +78,14 @@ rte_bus_probe(void)\n \t\tret = bus->probe();\n \t\tif (ret)\n \t\t\tRTE_LOG(ERR, EAL, \"Bus (%s) probe failed.\\n\",\n-\t\t\t\tbus->name);\n+\t\t\t\trte_bus_name(bus));\n \t}\n \n \tif (vbus) {\n \t\tret = vbus->probe();\n \t\tif (ret)\n \t\t\tRTE_LOG(ERR, EAL, \"Bus (%s) probe failed.\\n\",\n-\t\t\t\tvbus->name);\n+\t\t\t\trte_bus_name(vbus));\n \t}\n \n \treturn 0;\n@@ -92,7 +98,7 @@ bus_dump_one(FILE *f, struct rte_bus *bus)\n \tint ret;\n \n \t/* For now, dump only the bus name */\n-\tret = fprintf(f, \" %s\\n\", bus->name);\n+\tret = fprintf(f, \" %s\\n\", rte_bus_name(bus));\n \n \t/* Error in case of inability in writing to stream */\n \tif (ret < 0)\n@@ -163,7 +169,7 @@ cmp_bus_name(const struct rte_bus *bus, const void *_name)\n {\n \tconst char *name = _name;\n \n-\treturn strcmp(bus->name, name);\n+\treturn strcmp(rte_bus_name(bus), name);\n }\n \n struct rte_bus *\n@@ -213,7 +219,7 @@ rte_bus_get_iommu_class(void)\n \n \t\tbus_iova_mode = bus->get_iommu_class();\n \t\tRTE_LOG(DEBUG, EAL, \"Bus %s wants IOVA as '%s'\\n\",\n-\t\t\tbus->name,\n+\t\t\trte_bus_name(bus),\n \t\t\tbus_iova_mode == RTE_IOVA_DC ? \"DC\" :\n \t\t\t(bus_iova_mode == RTE_IOVA_PA ? \"PA\" : \"VA\"));\n \t\tif (bus_iova_mode == RTE_IOVA_PA)\ndiff --git a/lib/eal/include/rte_bus.h b/lib/eal/include/rte_bus.h\nindex 17edaa37c9..3848b44db0 100644\n--- a/lib/eal/include/rte_bus.h\n+++ b/lib/eal/include/rte_bus.h\n@@ -266,6 +266,20 @@ struct rte_bus {\n \n };\n \n+/**\n+ * Retrieve a bus name.\n+ *\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change without prior notice\n+ *\n+ * @param bus\n+ * A pointer to a rte_bus structure.\n+ * @return\n+ * A pointer to the bus name string.\n+ */\n+__rte_experimental\n+const char *rte_bus_name(const struct rte_bus *bus);\n+\n /**\n * Register a Bus handler.\n *\ndiff --git a/lib/eal/version.map b/lib/eal/version.map\nindex 1f293e768b..aa53064db1 100644\n--- a/lib/eal/version.map\n+++ b/lib/eal/version.map\n@@ -424,6 +424,9 @@ EXPERIMENTAL {\n \trte_thread_self;\n \trte_thread_set_affinity_by_id;\n \trte_thread_set_priority;\n+\n+\t# added in 22.11\n+\trte_bus_name;\n };\n \n INTERNAL {\n", "prefixes": [ "v5", "20/27" ] }{ "id": 115860, "url": "