Skip to contentSkip to conversation

bus/vmbus: add device_order field to rte_vmbus_dev

PATCH Superseded Vladimir Ratnikov 1 participant 1 message Jun 24, 2024

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 bus/vmbus: add device_order field to rte_vmbus_dev

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.

---
 drivers/bus/vmbus/bus_vmbus_driver.h | 1 +
 drivers/bus/vmbus/vmbus_common.c     | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/bus/vmbus/bus_vmbus_driver.h +1 -0
index e2475a642d..6b010cbe41 100644
@@ -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 */
drivers/bus/vmbus/vmbus_common.c +1 -1
index b9139c6e6c..1a64ab2712 100644
@@ -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));
 
Signature · 1 line
2.34.1