summaryrefslogtreecommitdiff
path: root/drivers/hv/hyperv_vmbus.h
diff options
context:
space:
mode:
authorSaurabh Sengar <ssengar@linux.microsoft.com>2024-03-30 01:51:57 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-11 14:55:53 +0200
commite8c4bd6c6e6b7e7b416c42806981c2a81370001e (patch)
tree3dd3fdd1ac0cab7040d84db5a1341bbe72d16fc6 /drivers/hv/hyperv_vmbus.h
parenta36b69775fcaab42262f6dbf288ccb6d470158ae (diff)
downloadlwn-e8c4bd6c6e6b7e7b416c42806981c2a81370001e.tar.gz
lwn-e8c4bd6c6e6b7e7b416c42806981c2a81370001e.zip
Drivers: hv: vmbus: Add utility function for querying ring size
Add a function to query for the preferred ring buffer size of VMBus device. This will allow the drivers (eg. UIO) to allocate the most optimized ring buffer size for devices. Signed-off-by: Saurabh Sengar <ssengar@linux.microsoft.com> Reviewed-by: Long Li <longli@microsoft.com> Link: https://lore.kernel.org/r/1711788723-8593-2-git-send-email-ssengar@linux.microsoft.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv/hyperv_vmbus.h')
-rw-r--r--drivers/hv/hyperv_vmbus.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index f6b1e710f805..76ac5185a01a 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -417,6 +417,11 @@ static inline bool hv_is_perf_channel(struct vmbus_channel *channel)
return vmbus_devs[channel->device_id].perf_device;
}
+static inline size_t hv_dev_ring_size(struct vmbus_channel *channel)
+{
+ return vmbus_devs[channel->device_id].pref_ring_size;
+}
+
static inline bool hv_is_allocated_cpu(unsigned int cpu)
{
struct vmbus_channel *channel, *sc;