X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm_ethernet.h;h=c4725a9c84181fa6b3a3aa744f70dbd44ad684eb;hb=926fe574cd42bb860c19fd04610451c24b6d42b6;hp=e38e4a7c95841df16c6f96eb5300acce313af3d4;hpb=0a7690f54cb5bda83780dac26ce433ad24b1d766;p=palacios.git diff --git a/palacios/include/palacios/vmm_ethernet.h b/palacios/include/palacios/vmm_ethernet.h index e38e4a7..c4725a9 100644 --- a/palacios/include/palacios/vmm_ethernet.h +++ b/palacios/include/palacios/vmm_ethernet.h @@ -20,30 +20,50 @@ #ifndef __ETHERNET_H__ #define __ETHERNET_H__ +#include + #define ETHERNET_HEADER_LEN 14 #define ETHERNET_MTU 1500 #define ETHERNET_PACKET_LEN (ETHERNET_HEADER_LEN + ETHERNET_MTU) #define ETH_ALEN 6 +#define MIN_MTU 68 +#define MAX_MTU 65536 -#ifdef __V3VEE__ +#define MAX_PACKET_LEN (MAX_MTU + ETHERNET_HEADER_LEN) -#include +#ifdef V3_CONFIG_VNET +extern int net_debug; +#endif struct nic_statistics { uint64_t tx_pkts; uint64_t tx_bytes; uint64_t tx_dropped; - + uint64_t rx_pkts; uint64_t rx_bytes; uint64_t rx_dropped; - uint32_t interrupts; + uint32_t tx_interrupts; + uint32_t rx_interrupts; }; -typedef enum {VMM_DRIVERN = 1, GUEST_DRIVERN} nic_poll_type_t; - +#ifdef __V3VEE__ + +#include + +#define V3_Net_Print(level, fmt, args...) \ + do { \ + if(level <= net_debug) { \ + extern struct v3_os_hooks * os_hooks; \ + if ((os_hooks) && (os_hooks)->print) { \ + (os_hooks)->print((fmt), ##args); \ + } \ + } \ + } while (0) + + static inline int is_multicast_ethaddr(const uint8_t * addr) { V3_ASSERT(ETH_ALEN == 6);