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>
This commit is contained in:
Stephen Hemminger
2017-02-05 17:20:31 -07:00
committed by Greg Kroah-Hartman
parent bb6a4db92f
commit 5c1bec61fd
4 changed files with 29 additions and 54 deletions

View File

@@ -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,