Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/hyperv/vmbus/hv_connection.c
Show First 20 Lines • Show All 417 Lines • ▼ Show 20 Lines | do { | ||||
hv_ring_buffer_read_end(&channel->inbound); | hv_ring_buffer_read_end(&channel->inbound); | ||||
else | else | ||||
bytes_to_read = 0; | bytes_to_read = 0; | ||||
} while (is_batched_reading && (bytes_to_read != 0)); | } while (is_batched_reading && (bytes_to_read != 0)); | ||||
} | } | ||||
// mtx_unlock(&channel->inbound_lock); | // mtx_unlock(&channel->inbound_lock); | ||||
} | } | ||||
#ifdef HV_DEBUG_INTR | |||||
extern uint32_t hv_intr_count; | |||||
extern uint32_t hv_vmbus_swintr_event_cpu[MAXCPU]; | |||||
extern uint32_t hv_vmbus_intr_cpu[MAXCPU]; | |||||
#endif | |||||
/** | /** | ||||
* Handler for events | * Handler for events | ||||
*/ | */ | ||||
void | void | ||||
hv_vmbus_on_events(void *arg) | hv_vmbus_on_events(void *arg) | ||||
{ | { | ||||
int bit; | int bit; | ||||
int cpu; | int cpu; | ||||
int dword; | int dword; | ||||
void *page_addr; | void *page_addr; | ||||
uint32_t* recv_interrupt_page = NULL; | uint32_t* recv_interrupt_page = NULL; | ||||
int rel_id; | int rel_id; | ||||
int maxdword; | int maxdword; | ||||
hv_vmbus_synic_event_flags *event; | hv_vmbus_synic_event_flags *event; | ||||
/* int maxdword = PAGE_SIZE >> 3; */ | /* int maxdword = PAGE_SIZE >> 3; */ | ||||
cpu = (int)(long)arg; | cpu = (int)(long)arg; | ||||
KASSERT(cpu <= mp_maxid, ("VMBUS: hv_vmbus_on_events: " | KASSERT(cpu <= mp_maxid, ("VMBUS: hv_vmbus_on_events: " | ||||
"cpu out of range!")); | "cpu out of range!")); | ||||
#ifdef HV_DEBUG_INTR | |||||
int i; | |||||
hv_vmbus_swintr_event_cpu[cpu]++; | |||||
if (hv_intr_count % 10000 == 0) { | |||||
printf("VMBUS: Total interrupt %d\n", hv_intr_count); | |||||
for (i = 0; i < mp_ncpus; i++) | |||||
printf("VMBUS: hw cpu[%d]: %d, event sw intr cpu[%d]: %d\n", | |||||
i, hv_vmbus_intr_cpu[i], i, hv_vmbus_swintr_event_cpu[i]); | |||||
} | |||||
#endif | |||||
if ((hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008) || | if ((hv_vmbus_protocal_version == HV_VMBUS_VERSION_WS2008) || | ||||
(hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7)) { | (hv_vmbus_protocal_version == HV_VMBUS_VERSION_WIN7)) { | ||||
maxdword = HV_MAX_NUM_CHANNELS_SUPPORTED >> 5; | maxdword = HV_MAX_NUM_CHANNELS_SUPPORTED >> 5; | ||||
/* | /* | ||||
* receive size is 1/2 page and divide that by 4 bytes | * receive size is 1/2 page and divide that by 4 bytes | ||||
*/ | */ | ||||
recv_interrupt_page = | recv_interrupt_page = | ||||
▲ Show 20 Lines • Show All 90 Lines • Show Last 20 Lines |