summaryrefslogtreecommitdiffstats
path: root/drivers/hv/hyperv_vmbus.h
diff options
context:
space:
mode:
authorStephen Hemminger2017-02-06 01:20:31 +0100
committerGreg Kroah-Hartman2017-02-10 15:43:30 +0100
commit5c1bec61fdfcd056df909a712e2a86bbaeb0f942 (patch)
tree625f0c6561886c50334e81042e0d267390e485fc /drivers/hv/hyperv_vmbus.h
parentDrivers: hv: util: Fix a typo (diff)
downloadkernel-qcow2-linux-5c1bec61fdfcd056df909a712e2a86bbaeb0f942.tar.gz
kernel-qcow2-linux-5c1bec61fdfcd056df909a712e2a86bbaeb0f942.tar.xz
kernel-qcow2-linux-5c1bec61fdfcd056df909a712e2a86bbaeb0f942.zip
vmbus: use kernel bitops for traversing interrupt mask
Use standard kernel operations for find first set bit to traverse the channel bit array. This has added benefit of speeding up lookup on 64 bit and because it uses find first set instruction. Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com> Signed-off-by: K. Y. Srinivasan <kys@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.h16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index 86b56b677dc3..2749a4142889 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -40,11 +40,9 @@
*/
#define HV_UTIL_NEGO_TIMEOUT 55
-
-
-
-#define HV_EVENT_FLAGS_BYTE_COUNT (256)
-#define HV_EVENT_FLAGS_DWORD_COUNT (256 / sizeof(u32))
+/* Define synthetic interrupt controller flag constants. */
+#define HV_EVENT_FLAGS_COUNT (256 * 8)
+#define HV_EVENT_FLAGS_LONG_COUNT (256 / sizeof(unsigned long))
/*
* Timer configuration register.
@@ -65,8 +63,7 @@ union hv_timer_config {
/* Define the synthetic interrupt controller event flags format. */
union hv_synic_event_flags {
- u8 flags8[HV_EVENT_FLAGS_BYTE_COUNT];
- u32 flags32[HV_EVENT_FLAGS_DWORD_COUNT];
+ unsigned long flags[HV_EVENT_FLAGS_LONG_COUNT];
};
/* Define SynIC control register. */
@@ -358,6 +355,11 @@ struct vmbus_msginfo {
extern struct vmbus_connection vmbus_connection;
+static inline void vmbus_send_interrupt(u32 relid)
+{
+ sync_set_bit(relid, vmbus_connection.send_int_page);
+}
+
enum vmbus_message_handler_type {
/* The related handler can sleep. */
VMHT_BLOCKING = 0,