Commit 4827ee1d authored by Stephen Hemminger's avatar Stephen Hemminger Committed by Greg Kroah-Hartman

vmbus: expose debug info for drivers

Allow driver to get debug information about state of the ring.
Signed-off-by: default avatarStephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: default avatarK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 2a9d7de2
...@@ -248,14 +248,6 @@ struct hv_context { ...@@ -248,14 +248,6 @@ struct hv_context {
extern struct hv_context hv_context; extern struct hv_context hv_context;
struct hv_ring_buffer_debug_info {
u32 current_interrupt_mask;
u32 current_read_index;
u32 current_write_index;
u32 bytes_avail_toread;
u32 bytes_avail_towrite;
};
/* Hv Interface */ /* Hv Interface */
extern int hv_init(void); extern int hv_init(void);
...@@ -289,9 +281,6 @@ int hv_ringbuffer_read(struct vmbus_channel *channel, ...@@ -289,9 +281,6 @@ int hv_ringbuffer_read(struct vmbus_channel *channel,
void *buffer, u32 buflen, u32 *buffer_actual_len, void *buffer, u32 buflen, u32 *buffer_actual_len,
u64 *requestid, bool raw); u64 *requestid, bool raw);
void hv_ringbuffer_get_debuginfo(const struct hv_ring_buffer_info *ring_info,
struct hv_ring_buffer_debug_info *debug_info);
/* /*
* Maximum channels is determined by the size of the interrupt page * Maximum channels is determined by the size of the interrupt page
* which is PAGE_SIZE. 1/2 of PAGE_SIZE is for send endpoint interrupt * which is PAGE_SIZE. 1/2 of PAGE_SIZE is for send endpoint interrupt
......
...@@ -206,6 +206,7 @@ void hv_ringbuffer_get_debuginfo(const struct hv_ring_buffer_info *ring_info, ...@@ -206,6 +206,7 @@ void hv_ringbuffer_get_debuginfo(const struct hv_ring_buffer_info *ring_info,
ring_info->ring_buffer->interrupt_mask; ring_info->ring_buffer->interrupt_mask;
} }
} }
EXPORT_SYMBOL_GPL(hv_ringbuffer_get_debuginfo);
/* Initialize the ring buffer. */ /* Initialize the ring buffer. */
int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info, int hv_ringbuffer_init(struct hv_ring_buffer_info *ring_info,
......
...@@ -491,6 +491,12 @@ struct vmbus_channel_rescind_offer { ...@@ -491,6 +491,12 @@ struct vmbus_channel_rescind_offer {
u32 child_relid; u32 child_relid;
} __packed; } __packed;
static inline u32
hv_ringbuffer_pending_size(const struct hv_ring_buffer_info *rbi)
{
return rbi->ring_buffer->pending_send_sz;
}
/* /*
* Request Offer -- no parameters, SynIC message contains the partition ID * Request Offer -- no parameters, SynIC message contains the partition ID
* Set Snoop -- no parameters, SynIC message contains the partition ID * Set Snoop -- no parameters, SynIC message contains the partition ID
...@@ -1148,6 +1154,17 @@ static inline void *hv_get_drvdata(struct hv_device *dev) ...@@ -1148,6 +1154,17 @@ static inline void *hv_get_drvdata(struct hv_device *dev)
return dev_get_drvdata(&dev->device); return dev_get_drvdata(&dev->device);
} }
struct hv_ring_buffer_debug_info {
u32 current_interrupt_mask;
u32 current_read_index;
u32 current_write_index;
u32 bytes_avail_toread;
u32 bytes_avail_towrite;
};
void hv_ringbuffer_get_debuginfo(const struct hv_ring_buffer_info *ring_info,
struct hv_ring_buffer_debug_info *debug_info);
/* Vmbus interface */ /* Vmbus interface */
#define vmbus_driver_register(driver) \ #define vmbus_driver_register(driver) \
__vmbus_driver_register(driver, THIS_MODULE, KBUILD_MODNAME) __vmbus_driver_register(driver, THIS_MODULE, KBUILD_MODNAME)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment