From: Vladimir Ratnikov <vratnikov@netgate.com>
To: longli@microsoft.com
Cc: dev@dpdk.org, Vladimir Ratnikov <vratnikov@netgate.com>
Subject: [PATCH] bus/vmbus: add device_order field to rte_vmbus_dev
Date: Mon, 24 Jun 2024 10:56:17 +0000 [thread overview]
Message-ID: <20240624105617.3113-1-vratnikov@netgate.com> (raw)
Field can be used to have static interface naming
in DPDK based applications instead of uuid.
RTE_FOREACH_DEV won't return the correct order of
such devices due to vmbus_ignore_device in case of
blocklisting/allowlisting. So device_order field
will be helpfull in that case.
Signed-off-by: Vladimir Ratnikov <vratnikov@netgate.com>
---
drivers/bus/vmbus/bus_vmbus_driver.h | 1 +
drivers/bus/vmbus/vmbus_common.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/bus/vmbus/bus_vmbus_driver.h b/drivers/bus/vmbus/bus_vmbus_driver.h
index e2475a642d..6b010cbe41 100644
--- a/drivers/bus/vmbus/bus_vmbus_driver.h
+++ b/drivers/bus/vmbus/bus_vmbus_driver.h
@@ -37,6 +37,7 @@ struct rte_vmbus_device {
rte_uuid_t device_id; /**< VMBUS device id */
rte_uuid_t class_id; /**< VMBUS device type */
uint32_t relid; /**< id for primary */
+ uint16_t device_order; /**< Device order after probing */
uint8_t monitor_id; /**< monitor page */
int uio_num; /**< UIO device number */
uint32_t *int_page; /**< VMBUS interrupt page */
diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c
index b9139c6e6c..1a64ab2712 100644
--- a/drivers/bus/vmbus/vmbus_common.c
+++ b/drivers/bus/vmbus/vmbus_common.c
@@ -199,7 +199,7 @@ rte_vmbus_probe(void)
char ubuf[RTE_UUID_STRLEN];
FOREACH_DEVICE_ON_VMBUS(dev) {
- probed++;
+ dev->device_order = probed++;
rte_uuid_unparse(dev->device_id, ubuf, sizeof(ubuf));
--
2.34.1
reply other threads:[~2024-06-24 10:56 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240624105617.3113-1-vratnikov@netgate.com \
--to=vratnikov@netgate.com \
--cc=dev@dpdk.org \
--cc=longli@microsoft.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).