X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_module%2Fpalacios-vnet-brg.c;h=abf4142dcd9dde14452275b96dd38adf1536d3a0;hb=ea68fe042705986beaec92f33db0395b816c2e38;hp=1dfe8a8618bf32e5de01812805ae48ffc9f585aa;hpb=1f8ac11d4550b1113d9a8c23e62b236cb8ad8404;p=palacios.git diff --git a/linux_module/palacios-vnet-brg.c b/linux_module/palacios-vnet-brg.c index 1dfe8a8..abf4142 100644 --- a/linux_module/palacios-vnet-brg.c +++ b/linux_module/palacios-vnet-brg.c @@ -32,7 +32,7 @@ #define VNET_SERVER_PORT 9000 -#define VNET_ADAPTIVE_BRIDGE 0 // set this to one to have bridge go to sleep if there nothing to do... +#define VNET_ADAPTIVE_BRIDGE 1 // set this to one to have bridge go to sleep if there nothing to do... #define VNET_NOPROGRESS_LIMIT 1000 // ... after this many iterations #define VNET_YIELD_TIME_USEC 1000 // ... and go to sleep for this long @@ -162,7 +162,12 @@ static uint32_t _create_link(struct vnet_link * link) { if (link->sock_proto == UDP) { // no UDP checksumming lock_sock(link->sock->sk); +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0) link->sock->sk->sk_no_check = 1; +#else + link->sock->sk->sk_no_check_tx = 1; + link->sock->sk->sk_no_check_rx = 1; +#endif release_sock(link->sock->sk); } @@ -173,7 +178,7 @@ static uint32_t _create_link(struct vnet_link * link) { link->sock_addr.sin_port = htons(link->dst_port); - if ((err = link->sock->ops->connect(link->sock, (struct sockaddr *)&(link->sock_addr), sizeof(struct sockaddr), 0) < 0)) { + if ((err = link->sock->ops->connect(link->sock, (struct sockaddr *)&(link->sock_addr), sizeof(struct sockaddr), 0)) < 0) { WARNING("Could not connect to remote VNET Server, error %d\n", err); return -1; } @@ -258,8 +263,12 @@ _udp_send(struct socket * sock, msg.msg_namelen = sizeof(struct sockaddr_in); msg.msg_control = NULL; msg.msg_controllen = 0; +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) msg.msg_iov = &iov; msg.msg_iovlen = 1; +#else + iov_iter_init(&(msg.msg_iter),WRITE,&iov,1,0); +#endif msg.msg_control = NULL; oldfs = get_fs(); @@ -293,8 +302,12 @@ _udp_recv(struct socket * sock, msg.msg_namelen = sizeof(struct sockaddr_in); msg.msg_control = NULL; msg.msg_controllen = 0; +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) msg.msg_iov = &iov; msg.msg_iovlen = 1; +#else + iov_iter_init(&(msg.msg_iter),READ,&iov,1,0); +#endif msg.msg_control = NULL; oldfs = get_fs(); @@ -403,7 +416,12 @@ static int init_vnet_serv(void) { if (vnet_brg_s.serv_proto == UDP) { // No UDP checksumming is done lock_sock(vnet_brg_s.serv_sock->sk); +#if LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0) vnet_brg_s.serv_sock->sk->sk_no_check = 1; +#else + vnet_brg_s.serv_sock->sk->sk_no_check_tx = 1; + vnet_brg_s.serv_sock->sk->sk_no_check_rx = 1; +#endif release_sock(vnet_brg_s.serv_sock->sk); } @@ -479,7 +497,7 @@ static int _udp_server(void * arg) { } else { // Likely not making progress, do potentially slow // yield - we won't come back for until VNET_YIELD_TIME_USEC has passed - palacios_yield_cpu_timed(VNET_YIELD_TIME_USEC); + palacios_sleep_cpu(VNET_YIELD_TIME_USEC); } continue;