Skip to contentSkip to conversation

bus/vmbus: make driver interface internal

RFC Superseded Stephen Hemminger 2 participants 4 messages Oct 8 – Nov 17 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

RFC 1/1 bus/vmbus: make driver interface internal

The vmbus bus API was exposed as public API, but it is only usable by the netvsc PMD and DPDK core: the functions operate on vmbus channels and devices that no application can obtain. Exposing them commits DPDK to an ABI that has no external consumer.

Make the interface internal as announced. The public headers rte_bus_vmbus.h and rte_vmbus_reg.h are renamed to vmbus_api.h and vmbus_reg.h and listed as driver SDK headers, so they are no longer installed for applications. All rte_vmbus_* functions are marked __rte_internal and exported as internal symbols.

rte_vmbus_chan_dump() had no export annotation at all, so it was declared in the public header but never present in the shared library. It is now exported as internal like the rest.

netvsc needs no change: it already includes bus_vmbus_driver.h, and the bus driver dependency puts the driver directory on its include path.

---
I don't have access to Hyper-V or Azure to test this.
Was generated by LLM based on the intention in the deprecation note. Please test on proper environment before merging.

 doc/guides/rel_notes/deprecation.rst          |  3 --
 doc/guides/rel_notes/release_26_11.rst        |  6 ++++
 drivers/bus/vmbus/bus_vmbus_driver.h          |  2 +-
 drivers/bus/vmbus/linux/vmbus_bus.c           | 14 ++++-----
 drivers/bus/vmbus/linux/vmbus_uio.c           |  2 +-
 drivers/bus/vmbus/meson.build                 |  7 +++--
 drivers/bus/vmbus/private.h                   |  2 +-
 .../vmbus/{rte_bus_vmbus.h => vmbus_api.h}    | 30 ++++++++++++++++---
 drivers/bus/vmbus/vmbus_bufring.c             |  2 +-
 drivers/bus/vmbus/vmbus_channel.c             | 29 +++++++++---------
 drivers/bus/vmbus/vmbus_common.c              |  4 +--
 drivers/bus/vmbus/vmbus_common_uio.c          |  2 +-
 .../vmbus/{rte_vmbus_reg.h => vmbus_reg.h}    |  0
 13 files changed, 66 insertions(+), 37 deletions(-)
 rename drivers/bus/vmbus/{rte_bus_vmbus.h => vmbus_api.h} (94%)
 rename drivers/bus/vmbus/{rte_vmbus_reg.h => vmbus_reg.h} (100%)
doc/guides/rel_notes/deprecation.rst +0 -3
index 56a67c372e..08875f1d0a 100644
@@ -135,6 +135,3 @@ Deprecation Notices
   The graph walk functions will process nodes in topological order
   using bitmap scanning instead of the circular buffer.
 
-* bus/vmbus: Starting DPDK 25.11, all the vmbus API defined in
-  ``drivers/bus/vmbus/rte_bus_vmbus.h`` will become internal to DPDK.
-  Those API functions are used internally by DPDK core and netvsc PMD.
doc/guides/rel_notes/release_26_11.rst +6 -0
index 16d3a90723..fb195be54b 100644
@@ -235,6 +235,12 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* bus/vmbus: Made the vmbus bus API internal.
+  The ``rte_bus_vmbus.h`` and ``rte_vmbus_reg.h`` headers are no longer installed;
+  their contents moved to the driver only headers
+  ``vmbus_api.h`` and ``vmbus_reg.h``.
+  All ``rte_vmbus_*`` functions are now internal to DPDK.
+
 * eal: Improved pointer arithmetic macros.
 
   * ``RTE_PTR_ADD``, ``RTE_PTR_SUB``, ``RTE_PTR_ALIGN``, ``RTE_PTR_ALIGN_CEIL``,
drivers/bus/vmbus/bus_vmbus_driver.h +1 -1
index 706ff1fcf5..09a38058dd 100644
@@ -6,7 +6,7 @@
 #ifndef BUS_VMBUS_DRIVER_H
 #define BUS_VMBUS_DRIVER_H
 
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 #include <rte_compat.h>
 #include <dev_driver.h>
 
drivers/bus/vmbus/linux/vmbus_bus.c +7 -7
index 779ea50b92..6c26f7e354 100644
@@ -17,7 +17,7 @@
 #include <rte_devargs.h>
 #include <rte_memory.h>
 #include <rte_malloc.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 #include <rte_kvargs.h>
 
 #include <eal_export.h>
@@ -164,7 +164,7 @@ static const char *map_names[VMBUS_MAX_RESOURCE] = {
 
 
 /* map the resources of a vmbus device in virtual memory */
-RTE_EXPORT_SYMBOL(rte_vmbus_map_device)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_map_device)
 int
 rte_vmbus_map_device(struct rte_vmbus_device *dev)
 {
@@ -223,7 +223,7 @@ rte_vmbus_map_device(struct rte_vmbus_device *dev)
 	return vmbus_uio_map_resource(dev);
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_unmap_device)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_unmap_device)
 void
 rte_vmbus_unmap_device(struct rte_vmbus_device *dev)
 {
@@ -375,7 +375,7 @@ vmbus_scan_one(const char *name)
 /*
  * Scan the content of the vmbus, and the devices in the devices list
  */
-RTE_EXPORT_SYMBOL(rte_vmbus_scan)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_scan)
 int
 rte_vmbus_scan(void)
 {
@@ -407,19 +407,19 @@ rte_vmbus_scan(void)
 	return -1;
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_irq_mask)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_irq_mask)
 void rte_vmbus_irq_mask(struct rte_vmbus_device *device)
 {
 	vmbus_uio_irq_control(device, 1);
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_irq_unmask)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_irq_unmask)
 void rte_vmbus_irq_unmask(struct rte_vmbus_device *device)
 {
 	vmbus_uio_irq_control(device, 0);
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_irq_read)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_irq_read)
 int rte_vmbus_irq_read(struct rte_vmbus_device *device)
 {
 	return vmbus_uio_irq_read(device);
drivers/bus/vmbus/linux/vmbus_uio.c +1 -1
index 0ef05c0096..34cfb63d54 100644
@@ -16,7 +16,7 @@
 #include <rte_memory.h>
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 #include <rte_string_fns.h>
 
 #include "private.h"
drivers/bus/vmbus/meson.build +5 -2
index 86ad9cc4d8..47408bb5d5 100644
@@ -6,8 +6,11 @@ if is_windows
     subdir_done()
 endif
 
-headers = files('rte_bus_vmbus.h','rte_vmbus_reg.h')
-driver_sdk_headers = files('bus_vmbus_driver.h')
+driver_sdk_headers = files(
+        'bus_vmbus_driver.h',
+        'vmbus_api.h',
+        'vmbus_reg.h',
+)
 
 sources = files(
         'vmbus_bufring.c',
drivers/bus/vmbus/private.h +1 -1
index 6b7782724f..20f6d16a9b 100644
@@ -13,7 +13,7 @@
 #include <bus_vmbus_driver.h>
 #include <rte_log.h>
 #include <rte_eal_paging.h>
-#include <rte_vmbus_reg.h>
+#include <vmbus_reg.h>
 
 extern struct rte_bus rte_vmbus_bus;
 
drivers/bus/vmbus/vmbus_api.h renamed from drivers/bus/vmbus/rte_bus_vmbus.h +26 -4
similarity index 94%
rename from drivers/bus/vmbus/rte_bus_vmbus.h
rename to drivers/bus/vmbus/vmbus_api.h
index 2e9898ed7f..f1078110cd 100644
@@ -3,8 +3,8 @@
  * All Rights Reserved.
  */
 
-#ifndef _VMBUS_H_
-#define _VMBUS_H_
+#ifndef VMBUS_API_H
+#define VMBUS_API_H
 
 /**
  * @file
@@ -19,10 +19,11 @@
 #include <stdint.h>
 #include <inttypes.h>
 
+#include <rte_compat.h>
 #include <rte_uuid.h>
 #include <rte_debug.h>
 #include <rte_interrupts.h>
-#include <rte_vmbus_reg.h>
+#include <vmbus_reg.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -40,6 +41,7 @@ struct vmbus_channel;
  * @return
  *  0 on success, negative on error
  */
+__rte_internal
 int rte_vmbus_scan(void);
 
 /**
@@ -49,6 +51,7 @@ int rte_vmbus_scan(void);
  *   - 0 on success.
  *   - !0 on error.
  */
+__rte_internal
 int rte_vmbus_probe(void);
 
 /**
@@ -62,6 +65,7 @@ int rte_vmbus_probe(void);
  *   0 on success, negative on error and positive if no driver
  *   is found for the device.
  */
+__rte_internal
 int rte_vmbus_map_device(struct rte_vmbus_device *dev);
 
 /**
@@ -71,6 +75,7 @@ int rte_vmbus_map_device(struct rte_vmbus_device *dev);
  *   A pointer to a rte_vmbus_device structure describing the device
  *   to use
  */
+__rte_internal
 void rte_vmbus_unmap_device(struct rte_vmbus_device *dev);
 
 /**
@@ -85,6 +90,7 @@ void rte_vmbus_unmap_device(struct rte_vmbus_device *dev);
  *   - -ENOMEM: Not enough memory available.
  *   - -EINVAL: Regions could not be mapped.
  */
+__rte_internal
 int rte_vmbus_chan_open(struct rte_vmbus_device *device,
 			struct vmbus_channel **chan);
 
@@ -94,6 +100,7 @@ int rte_vmbus_chan_open(struct rte_vmbus_device *device,
  * @param chan
  *    VMBUS channel
  */
+__rte_internal
 void rte_vmbus_chan_close(struct vmbus_channel *chan);
 
 /**
@@ -104,6 +111,7 @@ void rte_vmbus_chan_close(struct vmbus_channel *chan);
  * @return
  *   Number of channels available.
  */
+__rte_internal
 int rte_vmbus_max_channels(const struct rte_vmbus_device *device);
 
 /**
@@ -118,6 +126,7 @@ int rte_vmbus_max_channels(const struct rte_vmbus_device *device);
  *   - -ENOMEM: Not enough memory available.
  *   - -EINVAL: Regions could not be mapped.
  */
+__rte_internal
 int rte_vmbus_subchan_open(struct vmbus_channel *primary,
 			   struct vmbus_channel **new_chan);
 
@@ -127,6 +136,7 @@ int rte_vmbus_subchan_open(struct vmbus_channel *primary,
  * @param device
  *    VMBUS device
  */
+__rte_internal
 void rte_vmbus_irq_mask(struct rte_vmbus_device *device);
 
 /**
@@ -135,6 +145,7 @@ void rte_vmbus_irq_mask(struct rte_vmbus_device *device);
  * @param device
  *    VMBUS device
  */
+__rte_internal
 void rte_vmbus_irq_unmask(struct rte_vmbus_device *device);
 
 /**
@@ -143,6 +154,7 @@ void rte_vmbus_irq_unmask(struct rte_vmbus_device *device);
  * @param device
  *    VMBUS device
  */
+__rte_internal
 int rte_vmbus_irq_read(struct rte_vmbus_device *device);
 
 /**
@@ -153,6 +165,7 @@ int rte_vmbus_irq_read(struct rte_vmbus_device *device);
  * @return
  *	Return true if no data present in incoming ring.
  */
+__rte_internal
 bool rte_vmbus_chan_rx_empty(const struct vmbus_channel *channel);
 
 /**
@@ -176,6 +189,7 @@ bool rte_vmbus_chan_rx_empty(const struct vmbus_channel *channel);
  *
  * Sends data in buffer directly to hyper-v via the vmbus
  */
+__rte_internal
 int rte_vmbus_chan_send(struct rte_vmbus_device *dev,
 			struct vmbus_channel *channel, uint16_t type,
 			void *data, uint32_t dlen,
@@ -190,6 +204,7 @@ int rte_vmbus_chan_send(struct rte_vmbus_device *dev,
  * Used when batching multiple sends and only signaling host
  * after the last send.
  */
+__rte_internal
 void rte_vmbus_chan_signal_tx(struct rte_vmbus_device *dev,
 			      const struct vmbus_channel *channel);
 
@@ -225,6 +240,7 @@ struct iova_list {
  *
  * Sends data in buffer directly to hyper-v via the vmbus
  */
+__rte_internal
 int rte_vmbus_chan_send_sglist(struct rte_vmbus_device *dev,
 			       struct vmbus_channel *channel,
 			       struct vmbus_gpa gpa[], uint32_t gpacnt,
@@ -246,6 +262,7 @@ int rte_vmbus_chan_send_sglist(struct rte_vmbus_device *dev,
  *   On success, returns 0
  *   On failure, returns negative errno.
  */
+__rte_internal
 int rte_vmbus_chan_recv(struct rte_vmbus_device *dev,
 			struct vmbus_channel *chan,
 			void *data, uint32_t *len,
@@ -265,6 +282,7 @@ int rte_vmbus_chan_recv(struct rte_vmbus_device *dev,
  *   On success, returns number of bytes read.
  *   On failure, returns negative errno.
  */
+__rte_internal
 int rte_vmbus_chan_recv_raw(struct vmbus_channel *chan,
 			    void *data, uint32_t *len);
 
@@ -277,6 +295,7 @@ int rte_vmbus_chan_recv_raw(struct vmbus_channel *chan,
  * @param bytes_read
  *	Number of bytes read since last signal
  */
+__rte_internal
 void rte_vmbus_chan_signal_read(struct rte_vmbus_device *dev,
 				struct vmbus_channel *chan,
 				uint32_t bytes_read);
@@ -289,6 +308,7 @@ void rte_vmbus_chan_signal_read(struct rte_vmbus_device *dev,
  * @return
  *   Sub channel index (0 for primary)
  */
+__rte_internal
 uint16_t rte_vmbus_sub_channel_index(const struct vmbus_channel *chan);
 
 /**
@@ -302,6 +322,7 @@ uint16_t rte_vmbus_sub_channel_index(const struct vmbus_channel *chan);
  *	Approximate wait period between hypervisor examinations of
  *	the trigger page (in nanoseconds).
  */
+__rte_internal
 void rte_vmbus_set_latency(const struct rte_vmbus_device *dev,
 			   const struct vmbus_channel *chan,
 			   uint32_t latency);
@@ -312,10 +333,11 @@ void rte_vmbus_set_latency(const struct rte_vmbus_device *dev,
  * @param channel
  *	Pointer to vmbus_channel structure.
  */
+__rte_internal
 void rte_vmbus_chan_dump(FILE *f, const struct vmbus_channel *chan);
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif /* _VMBUS_H_ */
+#endif /* VMBUS_API_H */
drivers/bus/vmbus/vmbus_bufring.c +1 -1
index dcd66390a3..9e8227a863 100644
@@ -18,7 +18,7 @@
 #include <rte_stdatomic.h>
 #include <rte_memory.h>
 #include <rte_pause.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 
 #include "private.h"
 
drivers/bus/vmbus/vmbus_channel.c +15 -14
index 6887fbad46..a8768eab16 100644
@@ -15,7 +15,7 @@
 #include <rte_malloc.h>
 #include <rte_atomic.h>
 #include <rte_memory.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 
 #include "private.h"
 
@@ -65,7 +65,7 @@ vmbus_set_event(struct rte_vmbus_device *dev, const struct vmbus_channel *chan)
 /*
  * Set the wait between when hypervisor examines the trigger.
  */
-RTE_EXPORT_SYMBOL(rte_vmbus_set_latency)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_set_latency)
 void
 rte_vmbus_set_latency(const struct rte_vmbus_device *dev,
 		      const struct vmbus_channel *chan,
@@ -98,7 +98,7 @@ rte_vmbus_set_latency(const struct rte_vmbus_device *dev,
  * Since this in userspace, rely on the monitor page.
  * Can't do a hypercall from userspace.
  */
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_signal_tx)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_signal_tx)
 void
 rte_vmbus_chan_signal_tx(struct rte_vmbus_device *dev, const struct vmbus_channel *chan)
 {
@@ -116,7 +116,7 @@ rte_vmbus_chan_signal_tx(struct rte_vmbus_device *dev, const struct vmbus_channe
 
 
 /* Do a simple send directly using transmit ring. */
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_send)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_send)
 int rte_vmbus_chan_send(struct rte_vmbus_device *dev,
 			struct vmbus_channel *chan, uint16_t type, void *data,
 			uint32_t dlen, uint64_t xactid, uint32_t flags,
@@ -161,7 +161,7 @@ int rte_vmbus_chan_send(struct rte_vmbus_device *dev,
 }
 
 /* Do a scatter/gather send where the descriptor points to data. */
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_send_sglist)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_send_sglist)
 int rte_vmbus_chan_send_sglist(struct rte_vmbus_device *dev,
 			       struct vmbus_channel *chan,
 			       struct vmbus_gpa sg[], uint32_t sglen,
@@ -206,7 +206,7 @@ int rte_vmbus_chan_send_sglist(struct rte_vmbus_device *dev,
 	return error;
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_rx_empty)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_rx_empty)
 bool rte_vmbus_chan_rx_empty(const struct vmbus_channel *channel)
 {
 	const struct vmbus_br *br = &channel->rxbr;
@@ -216,7 +216,7 @@ bool rte_vmbus_chan_rx_empty(const struct vmbus_channel *channel)
 }
 
 /* Signal host after reading N bytes */
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_signal_read)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_signal_read)
 void rte_vmbus_chan_signal_read(struct rte_vmbus_device *dev,
 				struct vmbus_channel *chan,
 				uint32_t bytes_read)
@@ -249,7 +249,7 @@ void rte_vmbus_chan_signal_read(struct rte_vmbus_device *dev,
 	vmbus_set_event(dev, chan);
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_recv)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_recv)
 int rte_vmbus_chan_recv(struct rte_vmbus_device *dev,
 			struct vmbus_channel *chan, void *data, uint32_t *len,
 			uint64_t *request_id)
@@ -298,7 +298,7 @@ int rte_vmbus_chan_recv(struct rte_vmbus_device *dev,
 }
 
 /* TODO: replace this with inplace ring buffer (no copy) */
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_recv_raw)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_recv_raw)
 int rte_vmbus_chan_recv_raw(struct vmbus_channel *chan,
 			    void *data, uint32_t *len)
 {
@@ -369,7 +369,7 @@ int vmbus_chan_create(const struct rte_vmbus_device *device,
 }
 
 /* Setup the primary channel */
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_open)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_open)
 int rte_vmbus_chan_open(struct rte_vmbus_device *device,
 			struct vmbus_channel **new_chan)
 {
@@ -390,7 +390,7 @@ int rte_vmbus_chan_open(struct rte_vmbus_device *device,
 	return err;
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_max_channels)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_max_channels)
 int rte_vmbus_max_channels(const struct rte_vmbus_device *device)
 {
 	if (vmbus_uio_subchannels_supported(device, device->primary))
@@ -400,7 +400,7 @@ int rte_vmbus_max_channels(const struct rte_vmbus_device *device)
 }
 
 /* Setup secondary channel */
-RTE_EXPORT_SYMBOL(rte_vmbus_subchan_open)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_subchan_open)
 int rte_vmbus_subchan_open(struct vmbus_channel *primary,
 			   struct vmbus_channel **new_chan)
 {
@@ -416,13 +416,13 @@ int rte_vmbus_subchan_open(struct vmbus_channel *primary,
 	return 0;
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_sub_channel_index)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_sub_channel_index)
 uint16_t rte_vmbus_sub_channel_index(const struct vmbus_channel *chan)
 {
 	return chan->subchannel_id;
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_close)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_close)
 void rte_vmbus_chan_close(struct vmbus_channel *chan)
 {
 	const struct rte_vmbus_device *device = chan->device;
@@ -459,6 +459,7 @@ static void vmbus_dump_ring(FILE *f, const char *id, const struct vmbus_br *br)
 			pkt.flags, pkt.xactid);
 }
 
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_dump)
 void rte_vmbus_chan_dump(FILE *f, const struct vmbus_channel *chan)
 {
 	fprintf(f, "channel[%u] relid=%u monitor=%u\n",
drivers/bus/vmbus/vmbus_common.c +2 -2
index 4c64856abb..63d8c0d8b0 100644
@@ -19,7 +19,7 @@
 #include <rte_malloc.h>
 #include <rte_errno.h>
 #include <rte_memory.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 
 #include "private.h"
 
@@ -129,7 +129,7 @@ vmbus_probe_device(struct rte_driver *drv, struct rte_device *dev)
  * all registered drivers that have a matching entry in its id_table
  * for discovered devices.
  */
-RTE_EXPORT_SYMBOL(rte_vmbus_probe)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_probe)
 int
 rte_vmbus_probe(void)
 {
drivers/bus/vmbus/vmbus_common_uio.c +1 -1
index c6e7e07302..974b01470f 100644
@@ -13,7 +13,7 @@
 #include <rte_tailq.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 
 #include "private.h"
 
drivers/bus/vmbus/vmbus_reg.h renamed from drivers/bus/vmbus/rte_vmbus_reg.h +0 -0
similarity index 100%
rename from drivers/bus/vmbus/rte_vmbus_reg.h
rename to drivers/bus/vmbus/vmbus_reg.h
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 21 lines

-----Original Message-----
From: Stephen Hemminger <[email protected]>
Sent: Friday, October 9, 2026 3:10 AM
To: [email protected]
Cc: Stephen Hemminger <[email protected]>; Wei Hu <[email protected]>
Subject: [EXTERNAL] [RFC] bus/vmbus: make driver interface internal

The vmbus bus API was exposed as public API, but it is only usable by the netvsc PMD and DPDK core: the functions operate on vmbus channels and devices that no application can obtain. Exposing them commits DPDK to an ABI that has no external consumer.

Make the interface internal as announced. The public headers rte_bus_vmbus.h and rte_vmbus_reg.h are renamed to vmbus_api.h and vmbus_reg.h and listed as driver SDK headers, so they are no longer installed for applications. All rte_vmbus_* functions are marked __rte_internal and exported as internal symbols.

Quoted 8 lines

rte_vmbus_chan_dump() had no export annotation at all, so it was declared in the public header but never present in the shared library.
It is now exported as internal like the rest.

netvsc needs no change: it already includes bus_vmbus_driver.h, and the bus driver dependency puts the driver directory on its include path.

Thanks,
Wei

Quoted 589 lines

---
I don't have access to Hyper-V or Azure to test this.
Was generated by LLM based on the intention in the deprecation note. Please test on proper environment before merging.

 doc/guides/rel_notes/deprecation.rst          |  3 --
 doc/guides/rel_notes/release_26_11.rst        |  6 ++++
 drivers/bus/vmbus/bus_vmbus_driver.h          |  2 +-
 drivers/bus/vmbus/linux/vmbus_bus.c           | 14 ++++-----
 drivers/bus/vmbus/linux/vmbus_uio.c           |  2 +-
 drivers/bus/vmbus/meson.build                 |  7 +++--
 drivers/bus/vmbus/private.h                   |  2 +-
 .../vmbus/{rte_bus_vmbus.h => vmbus_api.h}    | 30 ++++++++++++++++---
 drivers/bus/vmbus/vmbus_bufring.c             |  2 +-
 drivers/bus/vmbus/vmbus_channel.c             | 29 +++++++++---------
 drivers/bus/vmbus/vmbus_common.c              |  4 +--
 drivers/bus/vmbus/vmbus_common_uio.c          |  2 +-
 .../vmbus/{rte_vmbus_reg.h => vmbus_reg.h}    |  0
 13 files changed, 66 insertions(+), 37 deletions(-)  rename

drivers/bus/vmbus/{rte_bus_vmbus.h => vmbus_api.h} (94%) rename drivers/bus/vmbus/{rte_vmbus_reg.h => vmbus_reg.h} (100%)

doc/guides/rel_notes/deprecation.rst +0 -3
index 56a67c372e..08875f1d0a 100644
@@ -135,6 +135,3 @@ Deprecation Notices
   The graph walk functions will process nodes in topological order
   using bitmap scanning instead of the circular buffer.
 
-* bus/vmbus: Starting DPDK 25.11, all the vmbus API defined in
-  ``drivers/bus/vmbus/rte_bus_vmbus.h`` will become internal to DPDK.
-  Those API functions are used internally by DPDK core and netvsc PMD.
doc/guides/rel_notes/release_26_11.rst +7 -0
index 16d3a90723..fb195be54b 100644
@@ -235,6 +235,12 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* bus/vmbus: Made the vmbus bus API internal.
+  The ``rte_bus_vmbus.h`` and ``rte_vmbus_reg.h`` headers are no longer
+installed;
+  their contents moved to the driver only headers
+  ``vmbus_api.h`` and ``vmbus_reg.h``.
+  All ``rte_vmbus_*`` functions are now internal to DPDK.
+
 * eal: Improved pointer arithmetic macros.
 
   * ``RTE_PTR_ADD``, ``RTE_PTR_SUB``, ``RTE_PTR_ALIGN``,

``RTE_PTR_ALIGN_CEIL``, diff --git a/drivers/bus/vmbus/bus_vmbus_driver.h b/drivers/bus/vmbus/bus_vmbus_driver.h
index 706ff1fcf5..09a38058dd 100644

drivers/bus/vmbus/bus_vmbus_driver.h +1 -1
@@ -6,7 +6,7 @@
 #ifndef BUS_VMBUS_DRIVER_H
 #define BUS_VMBUS_DRIVER_H
 
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 #include <rte_compat.h>
 #include <dev_driver.h>
 
drivers/bus/vmbus/linux/vmbus_bus.c +2 -2
index 779ea50b92..6c26f7e354 100644
@@ -17,7 +17,7 @@
 #include <rte_devargs.h>
 #include <rte_memory.h>
 #include <rte_malloc.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 #include <rte_kvargs.h>
 
 #include <eal_export.h>
@@ -164,7 +164,7 @@ static const char
 *map_names[VMBUS_MAX_RESOURCE] = {
 
 
 /* map the resources of a vmbus device in virtual memory */
-RTE_EXPORT_SYMBOL(rte_vmbus_map_device)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_map_device)
 int
 rte_vmbus_map_device(struct rte_vmbus_device *dev)  { @@ -223,7 +223,7

@@ rte_vmbus_map_device(struct rte_vmbus_device *dev)

drivers/bus/vmbus/linux/vmbus_bus.c +6 -5
 	return vmbus_uio_map_resource(dev);
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_unmap_device)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_unmap_device)
 void
 rte_vmbus_unmap_device(struct rte_vmbus_device *dev)  { @@ -375,7
+375,7 @@ vmbus_scan_one(const char *name)
 /*
  * Scan the content of the vmbus, and the devices in the devices list
  */
-RTE_EXPORT_SYMBOL(rte_vmbus_scan)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_scan)
 int
 rte_vmbus_scan(void)
 {
@@ -407,19 +407,19 @@ rte_vmbus_scan(void)
 	return -1;
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_irq_mask)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_irq_mask)
 void rte_vmbus_irq_mask(struct rte_vmbus_device *device)  {
 	vmbus_uio_irq_control(device, 1);
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_irq_unmask)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_irq_unmask)
 void rte_vmbus_irq_unmask(struct rte_vmbus_device *device)  {
 	vmbus_uio_irq_control(device, 0);
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_irq_read)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_irq_read)
 int rte_vmbus_irq_read(struct rte_vmbus_device *device)  {
 	return vmbus_uio_irq_read(device);
drivers/bus/vmbus/linux/vmbus_uio.c +1 -1
index 0ef05c0096..34cfb63d54 100644
@@ -16,7 +16,7 @@
 #include <rte_memory.h>
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 #include <rte_string_fns.h>
 
 #include "private.h"
(quoted diff) +0 -0

b/drivers/bus/vmbus/meson.build index 86ad9cc4d8..47408bb5d5 100644

drivers/bus/vmbus/meson.build +5 -2
@@ -6,8 +6,11 @@ if is_windows
     subdir_done()
 endif
 
-headers = files('rte_bus_vmbus.h','rte_vmbus_reg.h')
-driver_sdk_headers = files('bus_vmbus_driver.h')
+driver_sdk_headers = files(
+        'bus_vmbus_driver.h',
+        'vmbus_api.h',
+        'vmbus_reg.h',
+)
 
 sources = files(
         'vmbus_bufring.c',
drivers/bus/vmbus/private.h index renamed from drivers/bus/vmbus/private.h +0 -0

6b7782724f..20f6d16a9b 100644

drivers/bus/vmbus/private.h +1 -1
@@ -13,7 +13,7 @@
 #include <bus_vmbus_driver.h>
 #include <rte_log.h>
 #include <rte_eal_paging.h>
-#include <rte_vmbus_reg.h>
+#include <vmbus_reg.h>
 
 extern struct rte_bus rte_vmbus_bus;
 
(quoted diff) +0 -0

b/drivers/bus/vmbus/vmbus_api.h similarity index 94% rename from drivers/bus/vmbus/rte_bus_vmbus.h rename to drivers/bus/vmbus/vmbus_api.h index 2e9898ed7f..f1078110cd 100644

drivers/bus/vmbus/vmbus_api.h renamed from drivers/bus/vmbus/rte_bus_vmbus.h +8 -3
@@ -3,8 +3,8 @@
  * All Rights Reserved.
  */
 
-#ifndef _VMBUS_H_
-#define _VMBUS_H_
+#ifndef VMBUS_API_H
+#define VMBUS_API_H
 
 /**
  * @file
@@ -19,10 +19,11 @@
 #include <stdint.h>
 #include <inttypes.h>
 
+#include <rte_compat.h>
 #include <rte_uuid.h>
 #include <rte_debug.h>
 #include <rte_interrupts.h>
-#include <rte_vmbus_reg.h>
+#include <vmbus_reg.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -40,6 +41,7 @@ struct vmbus_channel;
  * @return
  *  0 on success, negative on error
  */
+__rte_internal
 int rte_vmbus_scan(void);
 
 /**
@@ -49,6 +51,7 @@ int rte_vmbus_scan(void);
  *   - 0 on success.
  *   - !0 on error.
  */
+__rte_internal
 int rte_vmbus_probe(void);
 
 /**
@@ -62,6 +65,7 @@ int rte_vmbus_probe(void);
  *   0 on success, negative on error and positive if no driver
  *   is found for the device.
  */
+__rte_internal
 int rte_vmbus_map_device(struct rte_vmbus_device *dev);
 
 /**
@@ -71,6 +75,7 @@ int rte_vmbus_map_device(struct rte_vmbus_device
 *dev);
  *   A pointer to a rte_vmbus_device structure describing the device
  *   to use
  */
+__rte_internal
 void rte_vmbus_unmap_device(struct rte_vmbus_device *dev);
 

/**

drivers/bus/vmbus/vmbus_api.h renamed from drivers/bus/vmbus/rte_bus_vmbus.h +2 -0
@@ -85,6 +90,7 @@ void rte_vmbus_unmap_device(struct
 rte_vmbus_device *dev);
  *   - -ENOMEM: Not enough memory available.
  *   - -EINVAL: Regions could not be mapped.
  */
+__rte_internal
 int rte_vmbus_chan_open(struct rte_vmbus_device *device,
 			struct vmbus_channel **chan);
@@ -94,6 +100,7 @@ int rte_vmbus_chan_open(struct rte_vmbus_device
 *device,
  * @param chan
  *    VMBUS channel
  */
+__rte_internal
 void rte_vmbus_chan_close(struct vmbus_channel *chan);
 

/**

drivers/bus/vmbus/vmbus_api.h renamed from drivers/bus/vmbus/rte_bus_vmbus.h +1 -0
@@ -104,6 +111,7 @@ void rte_vmbus_chan_close(struct vmbus_channel
 *chan);
  * @return
  *   Number of channels available.
  */
+__rte_internal
 int rte_vmbus_max_channels(const struct rte_vmbus_device *device);
 

/**

drivers/bus/vmbus/vmbus_api.h renamed from drivers/bus/vmbus/rte_bus_vmbus.h +2 -0
@@ -118,6 +126,7 @@ int rte_vmbus_max_channels(const struct
 rte_vmbus_device *device);
  *   - -ENOMEM: Not enough memory available.
  *   - -EINVAL: Regions could not be mapped.
  */
+__rte_internal
 int rte_vmbus_subchan_open(struct vmbus_channel *primary,
 			   struct vmbus_channel **new_chan);
@@ -127,6 +136,7 @@ int rte_vmbus_subchan_open(struct vmbus_channel
 *primary,
  * @param device
  *    VMBUS device
  */
+__rte_internal
 void rte_vmbus_irq_mask(struct rte_vmbus_device *device);
 

/**

drivers/bus/vmbus/vmbus_api.h renamed from drivers/bus/vmbus/rte_bus_vmbus.h +1 -0
@@ -135,6 +145,7 @@ void rte_vmbus_irq_mask(struct rte_vmbus_device
 *device);
  * @param device
  *    VMBUS device
  */
+__rte_internal
 void rte_vmbus_irq_unmask(struct rte_vmbus_device *device);
 

/**

drivers/bus/vmbus/vmbus_api.h renamed from drivers/bus/vmbus/rte_bus_vmbus.h +1 -0
@@ -143,6 +154,7 @@ void rte_vmbus_irq_unmask(struct
 rte_vmbus_device *device);
  * @param device
  *    VMBUS device
  */
+__rte_internal
 int rte_vmbus_irq_read(struct rte_vmbus_device *device);
 

/**

drivers/bus/vmbus/vmbus_api.h renamed from drivers/bus/vmbus/rte_bus_vmbus.h +1 -0
@@ -153,6 +165,7 @@ int rte_vmbus_irq_read(struct rte_vmbus_device
 *device);
  * @return
  *	Return true if no data present in incoming ring.
  */
+__rte_internal
 bool rte_vmbus_chan_rx_empty(const struct vmbus_channel *channel);
 

/**

drivers/bus/vmbus/vmbus_api.h renamed from drivers/bus/vmbus/rte_bus_vmbus.h +1 -0
@@ -176,6 +189,7 @@ bool rte_vmbus_chan_rx_empty(const struct
 vmbus_channel *channel);
  *
  * Sends data in buffer directly to hyper-v via the vmbus
  */
+__rte_internal
 int rte_vmbus_chan_send(struct rte_vmbus_device *dev,
 			struct vmbus_channel *channel, uint16_t type,
drivers/bus/vmbus/vmbus_api.h renamed from drivers/bus/vmbus/rte_bus_vmbus.h +2 -0
 			void *data, uint32_t dlen,
@@ -190,6 +204,7 @@ int rte_vmbus_chan_send(struct rte_vmbus_device
 *dev,
  * Used when batching multiple sends and only signaling host
  * after the last send.
  */
+__rte_internal
 void rte_vmbus_chan_signal_tx(struct rte_vmbus_device *dev,
 			      const struct vmbus_channel *channel);
@@ -225,6 +240,7 @@ struct iova_list {
  *
  * Sends data in buffer directly to hyper-v via the vmbus
  */
+__rte_internal
 int rte_vmbus_chan_send_sglist(struct rte_vmbus_device *dev,
 			       struct vmbus_channel *channel,
 			       struct vmbus_gpa gpa[], uint32_t gpacnt, @@ -

246,6 +262,7 @@ int rte_vmbus_chan_send_sglist(struct rte_vmbus_device *dev,
* On success, returns 0
* On failure, returns negative errno.
*/

drivers/bus/vmbus/vmbus_api.h renamed from drivers/bus/vmbus/rte_bus_vmbus.h +3 -0
+__rte_internal
 int rte_vmbus_chan_recv(struct rte_vmbus_device *dev,
 			struct vmbus_channel *chan,
 			void *data, uint32_t *len,
@@ -265,6 +282,7 @@ int rte_vmbus_chan_recv(struct rte_vmbus_device
 *dev,
  *   On success, returns number of bytes read.
  *   On failure, returns negative errno.
  */
+__rte_internal
 int rte_vmbus_chan_recv_raw(struct vmbus_channel *chan,
 			    void *data, uint32_t *len);
@@ -277,6 +295,7 @@ int rte_vmbus_chan_recv_raw(struct vmbus_channel
 *chan,
  * @param bytes_read
  *	Number of bytes read since last signal
  */
+__rte_internal
 void rte_vmbus_chan_signal_read(struct rte_vmbus_device *dev,
 				struct vmbus_channel *chan,
drivers/bus/vmbus/vmbus_api.h renamed from drivers/bus/vmbus/rte_bus_vmbus.h +1 -0
 				uint32_t bytes_read);
@@ -289,6 +308,7 @@ void rte_vmbus_chan_signal_read(struct
 rte_vmbus_device *dev,
  * @return
  *   Sub channel index (0 for primary)
  */
+__rte_internal
 uint16_t rte_vmbus_sub_channel_index(const struct vmbus_channel *chan);
 

/**

drivers/bus/vmbus/vmbus_api.h renamed from drivers/bus/vmbus/rte_bus_vmbus.h +1 -0
@@ -302,6 +322,7 @@ uint16_t rte_vmbus_sub_channel_index(const struct
 vmbus_channel *chan);
  *	Approximate wait period between hypervisor examinations of
  *	the trigger page (in nanoseconds).
  */
+__rte_internal
 void rte_vmbus_set_latency(const struct rte_vmbus_device *dev,
 			   const struct vmbus_channel *chan,
drivers/bus/vmbus/vmbus_api.h renamed from drivers/bus/vmbus/rte_bus_vmbus.h +2 -1
 			   uint32_t latency);
@@ -312,10 +333,11 @@ void rte_vmbus_set_latency(const struct
 rte_vmbus_device *dev,
  * @param channel
  *	Pointer to vmbus_channel structure.
  */
+__rte_internal
 void rte_vmbus_chan_dump(FILE *f, const struct vmbus_channel *chan);
 
 #ifdef __cplusplus
 }
 #endif
 
-#endif /* _VMBUS_H_ */
+#endif /* VMBUS_API_H */
drivers/bus/vmbus/vmbus_bufring.c +1 -1
index dcd66390a3..9e8227a863 100644
@@ -18,7 +18,7 @@
 #include <rte_stdatomic.h>
 #include <rte_memory.h>
 #include <rte_pause.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 
 #include "private.h"
 
drivers/bus/vmbus/vmbus_channel.c +2 -2
index 6887fbad46..a8768eab16 100644
@@ -15,7 +15,7 @@
 #include <rte_malloc.h>
 #include <rte_atomic.h>
 #include <rte_memory.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 
 #include "private.h"
 
@@ -65,7 +65,7 @@ vmbus_set_event(struct rte_vmbus_device *dev, const
 struct vmbus_channel *chan)
 /*
  * Set the wait between when hypervisor examines the trigger.
  */
-RTE_EXPORT_SYMBOL(rte_vmbus_set_latency)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_set_latency)
 void
 rte_vmbus_set_latency(const struct rte_vmbus_device *dev,

const struct vmbus_channel *chan, @@ -98,7 +98,7 @@
rte_vmbus_set_latency(const struct rte_vmbus_device *dev,
* Since this in userspace, rely on the monitor page.
* Can't do a hypercall from userspace.
*/

drivers/bus/vmbus/vmbus_channel.c +1 -1
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_signal_tx)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_signal_tx)
 void
 rte_vmbus_chan_signal_tx(struct rte_vmbus_device *dev, const struct

vmbus_channel *chan) { @@ -116,7 +116,7 @@ rte_vmbus_chan_signal_tx(struct rte_vmbus_device *dev, const struct vmbus_channe

/* Do a simple send directly using transmit ring. */

drivers/bus/vmbus/vmbus_channel.c +1 -1
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_send)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_send)
 int rte_vmbus_chan_send(struct rte_vmbus_device *dev,
 			struct vmbus_channel *chan, uint16_t type, void

*data,
uint32_t dlen, uint64_t xactid, uint32_t flags, @@ -
161,7 +161,7 @@ int rte_vmbus_chan_send(struct rte_vmbus_device *dev, }

/* Do a scatter/gather send where the descriptor points to data. */

drivers/bus/vmbus/vmbus_channel.c +3 -2
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_send_sglist)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_send_sglist)
 int rte_vmbus_chan_send_sglist(struct rte_vmbus_device *dev,
 			       struct vmbus_channel *chan,
 			       struct vmbus_gpa sg[], uint32_t sglen, @@ -206,7
+206,7 @@ int rte_vmbus_chan_send_sglist(struct rte_vmbus_device *dev,
 	return error;
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_rx_empty)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_rx_empty)
 bool rte_vmbus_chan_rx_empty(const struct vmbus_channel *channel)  {
 	const struct vmbus_br *br = &channel->rxbr; @@ -216,7 +216,7 @@

bool rte_vmbus_chan_rx_empty(const struct vmbus_channel *channel) }

/* Signal host after reading N bytes */

drivers/bus/vmbus/vmbus_channel.c +2 -2
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_signal_read)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_signal_read)
 void rte_vmbus_chan_signal_read(struct rte_vmbus_device *dev,
 				struct vmbus_channel *chan,
 				uint32_t bytes_read)
@@ -249,7 +249,7 @@ void rte_vmbus_chan_signal_read(struct
 rte_vmbus_device *dev,
 	vmbus_set_event(dev, chan);
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_recv)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_recv)
 int rte_vmbus_chan_recv(struct rte_vmbus_device *dev,
 			struct vmbus_channel *chan, void *data, uint32_t

*len,

drivers/bus/vmbus/vmbus_channel.c +3 -4
 			uint64_t *request_id)
@@ -298,7 +298,7 @@ int rte_vmbus_chan_recv(struct rte_vmbus_device
 *dev,  }
 
 /* TODO: replace this with inplace ring buffer (no copy) */
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_recv_raw)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_recv_raw)
 int rte_vmbus_chan_recv_raw(struct vmbus_channel *chan,
 			    void *data, uint32_t *len)
 {
@@ -369,7 +369,7 @@ int vmbus_chan_create(const struct
 rte_vmbus_device *device,  }
 
 /* Setup the primary channel */
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_open)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_open)
 int rte_vmbus_chan_open(struct rte_vmbus_device *device,
 			struct vmbus_channel **new_chan)
 {
@@ -390,7 +390,7 @@ int rte_vmbus_chan_open(struct rte_vmbus_device
 *device,
 	return err;
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_max_channels)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_max_channels)
 int rte_vmbus_max_channels(const struct rte_vmbus_device *device)  {
 	if (vmbus_uio_subchannels_supported(device, device->primary)) @@
-400,7 +400,7 @@ int rte_vmbus_max_channels(const struct

rte_vmbus_device *device) }

/* Setup secondary channel */

drivers/bus/vmbus/vmbus_channel.c +4 -3
-RTE_EXPORT_SYMBOL(rte_vmbus_subchan_open)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_subchan_open)
 int rte_vmbus_subchan_open(struct vmbus_channel *primary,
 			   struct vmbus_channel **new_chan)
 {
@@ -416,13 +416,13 @@ int rte_vmbus_subchan_open(struct
 vmbus_channel *primary,
 	return 0;
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_sub_channel_index)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_sub_channel_index)
 uint16_t rte_vmbus_sub_channel_index(const struct vmbus_channel *chan)
 {
 	return chan->subchannel_id;
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_close)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_close)
 void rte_vmbus_chan_close(struct vmbus_channel *chan)  {
 	const struct rte_vmbus_device *device = chan->device; @@ -459,6
+459,7 @@ static void vmbus_dump_ring(FILE *f, const char *id, const struct

vmbus_br *br)

drivers/bus/vmbus/vmbus_channel.c +1 -0
 			pkt.flags, pkt.xactid);
 }
 
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_dump)
 void rte_vmbus_chan_dump(FILE *f, const struct vmbus_channel *chan)  {
 	fprintf(f, "channel[%u] relid=%u monitor=%u\n", diff --git

a/drivers/bus/vmbus/vmbus_common.c
b/drivers/bus/vmbus/vmbus_common.c
index 4c64856abb..63d8c0d8b0 100644

drivers/bus/vmbus/vmbus_common.c +2 -2
@@ -19,7 +19,7 @@
 #include <rte_malloc.h>
 #include <rte_errno.h>
 #include <rte_memory.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 
 #include "private.h"
 
@@ -129,7 +129,7 @@ vmbus_probe_device(struct rte_driver *drv, struct
 rte_device *dev)
  * all registered drivers that have a matching entry in its id_table
  * for discovered devices.
  */
-RTE_EXPORT_SYMBOL(rte_vmbus_probe)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_probe)
 int
 rte_vmbus_probe(void)

{

drivers/bus/vmbus/vmbus_common_uio.c +1 -1
index c6e7e07302..974b01470f 100644
@@ -13,7 +13,7 @@
 #include <rte_tailq.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 
 #include "private.h"
 
(quoted diff) +0 -0

b/drivers/bus/vmbus/vmbus_reg.h similarity index 100% rename from drivers/bus/vmbus/rte_vmbus_reg.h rename to drivers/bus/vmbus/vmbus_reg.h
--
2.53.0

#2 lore raw
In reply to Stephen Hemminger
Quoted 11 lines · On Thu, 8 Oct 2026 12:09:33 -0700 Stephen Hemminger…

The vmbus bus API was exposed as public API, but it is only usable by the netvsc PMD and DPDK core: the functions operate on vmbus channels and devices that no application can obtain. Exposing them commits DPDK to an ABI that has no external consumer.

Make the interface internal as announced. The public headers rte_bus_vmbus.h and rte_vmbus_reg.h are renamed to vmbus_api.h and vmbus_reg.h and listed as driver SDK headers, so they are no longer installed for applications. All rte_vmbus_* functions are marked __rte_internal and exported as internal symbols.

Quoted 6 lines

rte_vmbus_chan_dump() had no export annotation at all, so it was declared in the public header but never present in the shared library. It is now exported as internal like the rest.

netvsc needs no change: it already includes bus_vmbus_driver.h, and the bus driver dependency puts the driver directory on its include path.

AI review of this had some good points that should be addressed.

[RFC] bus/vmbus: make driver interface internal

Applied to main (c6d273c). There is a context conflict in private.h:
main now has #include <rte_stdatomic.h> before rte_eal_paging.h. After fixing that by hand, bus/vmbus and net/netvsc build cleanly with -Dwerror=true -Dcheck_includes=true -Denable_driver_sdk=true. All rte_vmbus_* symbols are now exported with the INTERNAL version, and the old headers are no longer installed.

Warning

The new header names break the driver SDK naming convention. Driver SDK headers are installed into the same flat include directory as the public headers. Every other non-rte_ header there has a class prefix (bus_pci_driver.h, ethdev_driver.h, ...). Generic names like vmbus_api.h and vmbus_reg.h could collide with headers from other packages under /usr/include/dpdk.

bus_vmbus_driver.h is the only consumer of vmbus_api.h, so fold vmbus_api.h into it and give the register header the bus prefix:

driver_sdk_headers = files(

          'bus_vmbus_driver.h',
          'bus_vmbus_reg.h',

)

If you want to keep the two headers separate, call the API one bus_vmbus_api.h. Update the release note to match.

Info

Several functions have no users outside the bus driver, and some have none at all:

rte_vmbus_probe - dead code. The bus uses rte_bus_generic_probe.
rte_vmbus_scan - used only as rte_vmbus_bus.scan.
rte_vmbus_irq_mask/unmask/read, rte_vmbus_chan_dump
- no callers in the tree.

This release already breaks the ABI, so this patch is a good time to remove them rather than give them new internal exports. Delete rte_vmbus_probe. Move the declaration of rte_vmbus_scan to private.h and drop its export. The irq_* and chan_dump functions have no callers, so either delete them or keep them unexported in private.h. With that done, the commit message paragraph about chan_dump also goes away.

#3 lore raw

PATCH v2 1/1 bus/vmbus: make driver interface internal

In reply to Stephen Hemminger

The vmbus bus API was exposed as public API, but it is only usable by the netvsc PMD and DPDK core. As announced in deprecation the vmbus specific symbols are either made internal (or if not used removed).

---
v2 - remove unused code and incorporate AI review feedback

 doc/guides/rel_notes/deprecation.rst          |  3 -
 doc/guides/rel_notes/release_26_11.rst        |  6 ++
 drivers/bus/vmbus/bus_vmbus_driver.h          |  2 +-
 drivers/bus/vmbus/linux/vmbus_bus.c           | 27 ++------
 drivers/bus/vmbus/linux/vmbus_uio.c           | 25 +------
 drivers/bus/vmbus/meson.build                 |  7 +-
 drivers/bus/vmbus/private.h                   |  4 +-
 .../vmbus/{rte_bus_vmbus.h => vmbus_api.h}    | 67 ++++++-------------
 drivers/bus/vmbus/vmbus_bufring.c             |  2 +-
 drivers/bus/vmbus/vmbus_channel.c             | 29 ++++----
 drivers/bus/vmbus/vmbus_common.c              | 16 +----
 drivers/bus/vmbus/vmbus_common_uio.c          |  2 +-
 .../vmbus/{rte_vmbus_reg.h => vmbus_reg.h}    |  0
 13 files changed, 59 insertions(+), 131 deletions(-)
 rename drivers/bus/vmbus/{rte_bus_vmbus.h => vmbus_api.h} (89%)
 rename drivers/bus/vmbus/{rte_vmbus_reg.h => vmbus_reg.h} (100%)
doc/guides/rel_notes/deprecation.rst +0 -3
index 02b495f6a8..d2c272ee66 100644
@@ -103,6 +103,3 @@ Deprecation Notices
   will take a size parameter as well as the string buffer.
   This will detect and prevent accidental overwriting of caller provided buffer.
 
-* bus/vmbus: Starting DPDK 25.11, all the vmbus API defined in
-  ``drivers/bus/vmbus/rte_bus_vmbus.h`` will become internal to DPDK.
-  Those API functions are used internally by DPDK core and netvsc PMD.
doc/guides/rel_notes/release_26_11.rst +6 -0
index d3ab3662dd..8a55660d7f 100644
@@ -510,6 +510,12 @@ API Changes
    Also, make sure to start the actual text at the margin.
    =======================================================
 
+* bus/vmbus: Made the vmbus bus API internal.
+  The ``rte_bus_vmbus.h`` and ``rte_vmbus_reg.h`` headers are no longer installed;
+  their contents moved to the driver only headers
+  ``vmbus_api.h`` and ``vmbus_reg.h``.
+  All ``rte_vmbus_*`` functions are now internal to DPDK.
+
 * eal: Improved pointer arithmetic macros.
 
   * ``RTE_PTR_ADD``, ``RTE_PTR_SUB``, ``RTE_PTR_ALIGN``, ``RTE_PTR_ALIGN_CEIL``,
drivers/bus/vmbus/bus_vmbus_driver.h +1 -1
index 706ff1fcf5..09a38058dd 100644
@@ -6,7 +6,7 @@
 #ifndef BUS_VMBUS_DRIVER_H
 #define BUS_VMBUS_DRIVER_H
 
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 #include <rte_compat.h>
 #include <dev_driver.h>
 
drivers/bus/vmbus/linux/vmbus_bus.c +4 -23
index 779ea50b92..a52e8afa22 100644
@@ -17,7 +17,7 @@
 #include <rte_devargs.h>
 #include <rte_memory.h>
 #include <rte_malloc.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 #include <rte_kvargs.h>
 
 #include <eal_export.h>
@@ -164,7 +164,7 @@ static const char *map_names[VMBUS_MAX_RESOURCE] = {
 
 
 /* map the resources of a vmbus device in virtual memory */
-RTE_EXPORT_SYMBOL(rte_vmbus_map_device)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_map_device)
 int
 rte_vmbus_map_device(struct rte_vmbus_device *dev)
 {
@@ -223,7 +223,7 @@ rte_vmbus_map_device(struct rte_vmbus_device *dev)
 	return vmbus_uio_map_resource(dev);
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_unmap_device)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_unmap_device)
 void
 rte_vmbus_unmap_device(struct rte_vmbus_device *dev)
 {
@@ -375,9 +375,8 @@ vmbus_scan_one(const char *name)
 /*
  * Scan the content of the vmbus, and the devices in the devices list
  */
-RTE_EXPORT_SYMBOL(rte_vmbus_scan)
 int
-rte_vmbus_scan(void)
+vmbus_scan(void)
 {
 	struct dirent *e;
 	DIR *dir;
@@ -406,21 +405,3 @@ rte_vmbus_scan(void)
 	closedir(dir);
 	return -1;
 }
-
-RTE_EXPORT_SYMBOL(rte_vmbus_irq_mask)
-void rte_vmbus_irq_mask(struct rte_vmbus_device *device)
-{
-	vmbus_uio_irq_control(device, 1);
-}
-
-RTE_EXPORT_SYMBOL(rte_vmbus_irq_unmask)
-void rte_vmbus_irq_unmask(struct rte_vmbus_device *device)
-{
-	vmbus_uio_irq_control(device, 0);
-}
-
-RTE_EXPORT_SYMBOL(rte_vmbus_irq_read)
-int rte_vmbus_irq_read(struct rte_vmbus_device *device)
-{
-	return vmbus_uio_irq_read(device);
-}
drivers/bus/vmbus/linux/vmbus_uio.c +1 -24
index 2285236eb9..906989319b 100644
@@ -16,7 +16,7 @@
 #include <rte_memory.h>
 #include <rte_common.h>
 #include <rte_malloc.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 #include <rte_string_fns.h>
 
 #include "private.h"
@@ -38,29 +38,6 @@ void vmbus_uio_irq_control(const struct rte_vmbus_device *dev, int32_t onoff)
 	}
 }
 
-int vmbus_uio_irq_read(struct rte_vmbus_device *dev)
-{
-	int32_t count;
-	int cc;
-
-	if (rte_intr_fd_get(dev->intr_handle) < 0)
-		return -1;
-
-	cc = read(rte_intr_fd_get(dev->intr_handle), &count,
-		  sizeof(count));
-	if (cc < (int)sizeof(count)) {
-		if (cc < 0) {
-			VMBUS_LOG(ERR, "IRQ read failed %s",
-				  strerror(errno));
-			return -errno;
-		}
-		VMBUS_LOG(ERR, "can't read IRQ count");
-		return -EINVAL;
-	}
-
-	return count;
-}
-
 void
 vmbus_uio_free_resource(struct rte_vmbus_device *dev,
 		struct mapped_vmbus_resource *uio_res)
drivers/bus/vmbus/meson.build +5 -2
index 86ad9cc4d8..47408bb5d5 100644
@@ -6,8 +6,11 @@ if is_windows
     subdir_done()
 endif
 
-headers = files('rte_bus_vmbus.h','rte_vmbus_reg.h')
-driver_sdk_headers = files('bus_vmbus_driver.h')
+driver_sdk_headers = files(
+        'bus_vmbus_driver.h',
+        'vmbus_api.h',
+        'vmbus_reg.h',
+)
 
 sources = files(
         'vmbus_bufring.c',
drivers/bus/vmbus/private.h +2 -2
index 33545b6614..d07c9a924a 100644
@@ -14,7 +14,7 @@
 #include <rte_log.h>
 #include <rte_stdatomic.h>
 #include <rte_eal_paging.h>
-#include <rte_vmbus_reg.h>
+#include <vmbus_reg.h>
 
 extern struct rte_bus rte_vmbus_bus;
 
@@ -83,12 +83,12 @@ struct vmbus_channel {
 
 #define VMBUS_MAX_CHANNELS	64
 
+int vmbus_scan(void);
 int vmbus_chan_create(const struct rte_vmbus_device *device,
 		      uint16_t relid, uint16_t subid, uint8_t monitor_id,
 		      struct vmbus_channel **new_chan);
 
 void vmbus_uio_irq_control(const struct rte_vmbus_device *dev, int32_t onoff);
-int vmbus_uio_irq_read(struct rte_vmbus_device *dev);
 
 int vmbus_uio_map_resource(struct rte_vmbus_device *dev);
 void vmbus_uio_unmap_resource(struct rte_vmbus_device *dev);
drivers/bus/vmbus/vmbus_api.h renamed from drivers/bus/vmbus/rte_bus_vmbus.h +21 -46

190 lines not on this page · raw message

drivers/bus/vmbus/vmbus_bufring.c +1 -1
index 95f03929cb..fd2e8c2592 100644
@@ -18,7 +18,7 @@
 #include <rte_stdatomic.h>
 #include <rte_memory.h>
 #include <rte_pause.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 
 #include "private.h"
 
drivers/bus/vmbus/vmbus_channel.c +15 -14
index 90ba3d1ef6..30e57e184d 100644
@@ -15,7 +15,7 @@
 #include <rte_malloc.h>
 #include <rte_atomic.h>
 #include <rte_memory.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 
 #include "private.h"
 
@@ -65,7 +65,7 @@ vmbus_set_event(struct rte_vmbus_device *dev, const struct vmbus_channel *chan)
 /*
  * Set the wait between when hypervisor examines the trigger.
  */
-RTE_EXPORT_SYMBOL(rte_vmbus_set_latency)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_set_latency)
 void
 rte_vmbus_set_latency(const struct rte_vmbus_device *dev,
 		      const struct vmbus_channel *chan,
@@ -98,7 +98,7 @@ rte_vmbus_set_latency(const struct rte_vmbus_device *dev,
  * Since this in userspace, rely on the monitor page.
  * Can't do a hypercall from userspace.
  */
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_signal_tx)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_signal_tx)
 void
 rte_vmbus_chan_signal_tx(struct rte_vmbus_device *dev, const struct vmbus_channel *chan)
 {
@@ -115,7 +115,7 @@ rte_vmbus_chan_signal_tx(struct rte_vmbus_device *dev, const struct vmbus_channe
 
 
 /* Do a simple send directly using transmit ring. */
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_send)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_send)
 int rte_vmbus_chan_send(struct rte_vmbus_device *dev,
 			struct vmbus_channel *chan, uint16_t type, void *data,
 			uint32_t dlen, uint64_t xactid, uint32_t flags,
@@ -160,7 +160,7 @@ int rte_vmbus_chan_send(struct rte_vmbus_device *dev,
 }
 
 /* Do a scatter/gather send where the descriptor points to data. */
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_send_sglist)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_send_sglist)
 int rte_vmbus_chan_send_sglist(struct rte_vmbus_device *dev,
 			       struct vmbus_channel *chan,
 			       struct vmbus_gpa sg[], uint32_t sglen,
@@ -205,7 +205,7 @@ int rte_vmbus_chan_send_sglist(struct rte_vmbus_device *dev,
 	return error;
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_rx_empty)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_rx_empty)
 bool rte_vmbus_chan_rx_empty(const struct vmbus_channel *channel)
 {
 	const struct vmbus_br *br = &channel->rxbr;
@@ -215,7 +215,7 @@ bool rte_vmbus_chan_rx_empty(const struct vmbus_channel *channel)
 }
 
 /* Signal host after reading N bytes */
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_signal_read)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_signal_read)
 void rte_vmbus_chan_signal_read(struct rte_vmbus_device *dev,
 				struct vmbus_channel *chan,
 				uint32_t bytes_read)
@@ -248,7 +248,7 @@ void rte_vmbus_chan_signal_read(struct rte_vmbus_device *dev,
 	vmbus_set_event(dev, chan);
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_recv)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_recv)
 int rte_vmbus_chan_recv(struct rte_vmbus_device *dev,
 			struct vmbus_channel *chan, void *data, uint32_t *len,
 			uint64_t *request_id)
@@ -297,7 +297,7 @@ int rte_vmbus_chan_recv(struct rte_vmbus_device *dev,
 }
 
 /* TODO: replace this with inplace ring buffer (no copy) */
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_recv_raw)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_recv_raw)
 int rte_vmbus_chan_recv_raw(struct vmbus_channel *chan,
 			    void *data, uint32_t *len)
 {
@@ -368,7 +368,7 @@ int vmbus_chan_create(const struct rte_vmbus_device *device,
 }
 
 /* Setup the primary channel */
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_open)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_open)
 int rte_vmbus_chan_open(struct rte_vmbus_device *device,
 			struct vmbus_channel **new_chan)
 {
@@ -389,7 +389,7 @@ int rte_vmbus_chan_open(struct rte_vmbus_device *device,
 	return err;
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_max_channels)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_max_channels)
 int rte_vmbus_max_channels(const struct rte_vmbus_device *device)
 {
 	if (vmbus_uio_subchannels_supported(device, device->primary))
@@ -399,7 +399,7 @@ int rte_vmbus_max_channels(const struct rte_vmbus_device *device)
 }
 
 /* Setup secondary channel */
-RTE_EXPORT_SYMBOL(rte_vmbus_subchan_open)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_subchan_open)
 int rte_vmbus_subchan_open(struct vmbus_channel *primary,
 			   struct vmbus_channel **new_chan)
 {
@@ -415,13 +415,13 @@ int rte_vmbus_subchan_open(struct vmbus_channel *primary,
 	return 0;
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_sub_channel_index)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_sub_channel_index)
 uint16_t rte_vmbus_sub_channel_index(const struct vmbus_channel *chan)
 {
 	return chan->subchannel_id;
 }
 
-RTE_EXPORT_SYMBOL(rte_vmbus_chan_close)
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_close)
 void rte_vmbus_chan_close(struct vmbus_channel *chan)
 {
 	const struct rte_vmbus_device *device = chan->device;
@@ -458,6 +458,7 @@ static void vmbus_dump_ring(FILE *f, const char *id, const struct vmbus_br *br)
 			pkt.flags, pkt.xactid);
 }
 
+RTE_EXPORT_INTERNAL_SYMBOL(rte_vmbus_chan_dump)
 void rte_vmbus_chan_dump(FILE *f, const struct vmbus_channel *chan)
 {
 	fprintf(f, "channel[%u] relid=%u monitor=%u\n",
drivers/bus/vmbus/vmbus_common.c +2 -14
index 4c64856abb..9c557587f3 100644
@@ -19,7 +19,7 @@
 #include <rte_malloc.h>
 #include <rte_errno.h>
 #include <rte_memory.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 
 #include "private.h"
 
@@ -124,18 +124,6 @@ vmbus_probe_device(struct rte_driver *drv, struct rte_device *dev)
 	return ret;
 }
 
-/*
- * Scan the vmbus, and call the devinit() function for
- * all registered drivers that have a matching entry in its id_table
- * for discovered devices.
- */
-RTE_EXPORT_SYMBOL(rte_vmbus_probe)
-int
-rte_vmbus_probe(void)
-{
-	return rte_bus_generic_probe(&rte_vmbus_bus);
-}
-
 static int
 vmbus_unplug_device(struct rte_device *rte_dev)
 {
@@ -208,7 +196,7 @@ rte_vmbus_unregister(struct rte_vmbus_driver *driver)
 
 /* VMBUS doesn't support hotplug */
 struct rte_bus rte_vmbus_bus = {
-	.scan = rte_vmbus_scan,
+	.scan = vmbus_scan,
 	.probe = rte_bus_generic_probe,
 	.free_device = vmbus_free_device,
 	.cleanup = rte_bus_generic_cleanup,
drivers/bus/vmbus/vmbus_common_uio.c +1 -1
index 9765f5f609..ff5cda1fe4 100644
@@ -13,7 +13,7 @@
 #include <rte_tailq.h>
 #include <rte_log.h>
 #include <rte_malloc.h>
-#include <rte_bus_vmbus.h>
+#include <vmbus_api.h>
 
 #include "private.h"
 
drivers/bus/vmbus/vmbus_reg.h renamed from drivers/bus/vmbus/rte_vmbus_reg.h +0 -0
similarity index 100%
rename from drivers/bus/vmbus/rte_vmbus_reg.h
rename to drivers/bus/vmbus/vmbus_reg.h
Signature · 1 line
2.53.0