Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/hyperv/netvsc/hv_net_vsc.c
Show First 20 Lines • Show All 924 Lines • ▼ Show 20 Lines | if (ret == 0) { | ||||
if (retries < 4) { | if (retries < 4) { | ||||
DELAY(100); | DELAY(100); | ||||
goto retry_send_cmplt; | goto retry_send_cmplt; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
/* | |||||
* Net VSC receiving vRSS send table from VSP | |||||
*/ | |||||
static void | static void | ||||
hv_nv_send_table(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt) | hn_proc_notify(struct hn_softc *sc, const struct vmbus_chanpkt_hdr *pkt) | ||||
{ | { | ||||
netvsc_dev *net_dev; | const struct hn_nvs_hdr *hdr; | ||||
const nvsp_msg *nvsp_msg_pkt; | |||||
int i; | |||||
uint32_t count; | |||||
const uint32_t *table; | |||||
net_dev = hv_nv_get_inbound_net_device(sc); | hdr = VMBUS_CHANPKT_CONST_DATA(pkt); | ||||
if (!net_dev) | if (hdr->nvs_type == HN_NVS_TYPE_TXTBL_NOTE) { | ||||
/* Useless; ignore */ | |||||
return; | return; | ||||
nvsp_msg_pkt = VMBUS_CHANPKT_CONST_DATA(pkt); | |||||
if (nvsp_msg_pkt->hdr.msg_type != | |||||
nvsp_msg5_type_send_indirection_table) { | |||||
printf("Netvsc: !Warning! receive msg type not " | |||||
"send_indirection_table. type = %d\n", | |||||
nvsp_msg_pkt->hdr.msg_type); | |||||
return; | |||||
} | } | ||||
if_printf(sc->hn_ifp, "got notify, nvs type %u\n", hdr->nvs_type); | |||||
count = nvsp_msg_pkt->msgs.vers_5_msgs.send_table.count; | |||||
if (count != VRSS_SEND_TABLE_SIZE) { | |||||
printf("Netvsc: Received wrong send table size: %u\n", count); | |||||
return; | |||||
} | } | ||||
table = (const uint32_t *) | |||||
((const uint8_t *)&nvsp_msg_pkt->msgs.vers_5_msgs.send_table + | |||||
nvsp_msg_pkt->msgs.vers_5_msgs.send_table.offset); | |||||
for (i = 0; i < count; i++) | |||||
net_dev->vrss_send_table[i] = table[i]; | |||||
} | |||||
/* | /* | ||||
* Net VSC on channel callback | * Net VSC on channel callback | ||||
*/ | */ | ||||
static void | static void | ||||
hv_nv_on_channel_callback(struct vmbus_channel *chan, void *xrxr) | hv_nv_on_channel_callback(struct vmbus_channel *chan, void *xrxr) | ||||
{ | { | ||||
struct hn_rx_ring *rxr = xrxr; | struct hn_rx_ring *rxr = xrxr; | ||||
struct hn_softc *sc = rxr->hn_ifp->if_softc; | struct hn_softc *sc = rxr->hn_ifp->if_softc; | ||||
Show All 19 Lines | if (ret == 0) { | ||||
case VMBUS_CHANPKT_TYPE_COMP: | case VMBUS_CHANPKT_TYPE_COMP: | ||||
hv_nv_on_send_completion(net_dev, chan, | hv_nv_on_send_completion(net_dev, chan, | ||||
pkt); | pkt); | ||||
break; | break; | ||||
case VMBUS_CHANPKT_TYPE_RXBUF: | case VMBUS_CHANPKT_TYPE_RXBUF: | ||||
hv_nv_on_receive(net_dev, rxr, chan, pkt); | hv_nv_on_receive(net_dev, rxr, chan, pkt); | ||||
break; | break; | ||||
case VMBUS_CHANPKT_TYPE_INBAND: | case VMBUS_CHANPKT_TYPE_INBAND: | ||||
hv_nv_send_table(sc, pkt); | hn_proc_notify(sc, pkt); | ||||
break; | break; | ||||
default: | default: | ||||
if_printf(rxr->hn_ifp, | if_printf(rxr->hn_ifp, | ||||
"unknown chan pkt %u\n", | "unknown chan pkt %u\n", | ||||
pkt->cph_type); | pkt->cph_type); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
Show All 28 Lines |