#include <devices/lnx_virtio_pci.h>
#include <palacios/vm_guest_mem.h>
#include <palacios/vmm_sprintf.h>
-#include <palacios/vmm_vnet.h>
+#include <vnet/vnet.h>
#include <palacios/vmm_lock.h>
#include <palacios/vmm_util.h>
#include <devices/pci.h>
#include <palacios/vmm_time.h>
-#ifndef CONFIG_DEBUG_VIRTIO_NET
+#ifndef V3_CONFIG_DEBUG_VIRTIO_NET
#undef PrintDebug
#define PrintDebug(fmt, args...)
#endif
uint8_t mergeable_rx_bufs;
struct v3_timer * timer;
- void * poll_thread;
+ struct vnet_thread * poll_thread;
struct nic_statistics stats;
}
V3_Net_Print(2, "Virtio-NIC: virtio_tx: size: %d\n", len);
- if(v3_net_debug >= 4){
+ if(vnet_debug >= 4){
v3_hexdump(buf, len, NULL, 0);
}
virtio_setup_queue(core, virtio, &virtio->tx_vq, pfn, page_addr);
if(virtio->tx_notify == 0){
disable_cb(&virtio->tx_vq);
- V3_THREAD_WAKEUP(virtio->poll_thread);
+ vnet_thread_wakeup(virtio->poll_thread);
}
break;
case 2:
unsigned long flags;
V3_Net_Print(2, "Virtio-NIC: virtio_rx: size: %d\n", size);
- if(v3_net_debug >= 4){
+ if(vnet_debug >= 4){
v3_hexdump(buf, size, NULL, 0);
}
handle_pkt_tx(&(virtio->vm->cores[0]), virtio);
v3_yield(NULL);
}else {
- V3_THREAD_SLEEP();
+ vnet_thread_sleep(-1);
}
}
V3_Print("Virtio NIC: Switch TX to VMM driven mode\n");
disable_cb(&(net_state->tx_vq));
net_state->tx_notify = 0;
- V3_THREAD_WAKEUP(net_state->poll_thread);
+ vnet_thread_wakeup(net_state->poll_thread);
}
if(tx_rate < RATE_LOWER_THRESHOLD && net_state->tx_notify == 0){
ops->frontend_data = net_state;
memcpy(ops->fnt_mac, virtio->mac, ETH_ALEN);
- net_state->poll_thread = V3_CREATE_THREAD(virtio_tx_flush, (void *)net_state, "Virtio_Poll");
+ net_state->poll_thread = vnet_start_thread(virtio_tx_flush, (void *)net_state, "Virtio_Poll");
return 0;
}