From: Lei Xia Date: Thu, 30 Jun 2011 21:27:12 +0000 (-0500) Subject: Merge branch 'devel' of palacios@newskysaw.cs.northwestern.edu:/home/palacios/palacio... X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=f549b22853dfed86175cdf110e9f56bbdb934271;hp=9cf92dd87164a7d263f65b09eefde2672df93f63;p=palacios.git Merge branch 'devel' of palacios@newskysaw.cs.northwestern.edu:/home/palacios/palacios into devel --- diff --git a/linux_module/iface-packet.c b/linux_module/iface-packet.c index d72306e..d83ec61 100644 --- a/linux_module/iface-packet.c +++ b/linux_module/iface-packet.c @@ -1,6 +1,23 @@ +/* + * This file is part of the Palacios Virtual Machine Monitor developed + * by the V3VEE Project with funding from the United States National + * Science Foundation and the Department of Energy. + * + * The V3VEE Project is a joint project between Northwestern University + * and the University of New Mexico. You can find out more at + * http://www.v3vee.org + * + * Copyright (c) 2011, Lei Xia + * Copyright (c) 2011, The V3VEE Project + * All rights reserved. + * + * This is free software. You are permitted to use, redistribute, + * and modify it under the terms of the GNU General Public License + * Version 2 (GPLv2). The accompanying COPYING file contains the + * full text of the license. + */ /* - * Palacios Raw Packet - * (c) Lei Xia, 2010 + * Palacios Raw Packet Interface Implementation */ #include #include diff --git a/linux_module/iface-socket.c b/linux_module/iface-socket.c index e572ec9..7407f5f 100644 --- a/linux_module/iface-socket.c +++ b/linux_module/iface-socket.c @@ -16,6 +16,9 @@ * Version 2 (GPLv2). The accompanying COPYING file contains the * full text of the license. */ + /* + * Palacios Socket Interface Implementation + */ #include diff --git a/linux_module/iface-stream.c b/linux_module/iface-stream.c index 5c08204..1a59052 100644 --- a/linux_module/iface-stream.c +++ b/linux_module/iface-stream.c @@ -1,8 +1,22 @@ - -/* - * VM specific Controls - * (c) Lei Xia, 2010 +/* + * This file is part of the Palacios Virtual Machine Monitor developed + * by the V3VEE Project with funding from the United States National + * Science Foundation and the Department of Energy. + * + * The V3VEE Project is a joint project between Northwestern University + * and the University of New Mexico. You can find out more at + * http://www.v3vee.org + * + * Copyright (c) 2010, Lei Xia + * Copyright (c) 2010, The V3VEE Project + * All rights reserved. + * + * This is free software. You are permitted to use, redistribute, + * and modify it under the terms of the GNU General Public License + * Version 2 (GPLv2). The accompanying COPYING file contains the + * full text of the license. */ + #include #include #include @@ -47,37 +61,12 @@ struct vm_stream_state { struct list_head open_streams; }; -static int stream_enqueue(struct stream_buffer * stream, char * buf, int len) { - int bytes = 0; - - bytes = ringbuf_write(stream->buf, buf, len); - - return bytes; -} - - -static int stream_dequeue(struct stream_buffer * stream, char * buf, int len) { - int bytes = 0; - - bytes = ringbuf_read(stream->buf, buf, len); - - return bytes; -} - -static int stream_datalen(struct stream_buffer * stream){ - return ringbuf_data_len(stream->buf); -} - - - - static struct stream_buffer * find_stream_by_name(struct v3_guest * guest, const char * name) { struct stream_buffer * stream = NULL; struct list_head * stream_list = NULL; struct vm_stream_state * vm_state = NULL; - if (guest == NULL) { stream_list = &global_streams; } else { @@ -107,8 +96,7 @@ static ssize_t stream_read(struct file * filp, char __user * buf, size_t size, l wait_event_interruptible(stream->intr_queue, (ringbuf_data_len(stream->buf) != 0)); - - return 0; + return ringbuf_read(stream->buf, buf, size); } @@ -164,7 +152,7 @@ static int palacios_stream_write(void * stream_ptr, char * buf, int len) { struct stream_buffer * stream = (struct stream_buffer *)stream_ptr; int ret = 0; - ret = stream_enqueue(stream, buf, len); + ret = ringbuf_write(stream->buf, buf, len); if (ret > 0) { wake_up_interruptible(&(stream->intr_queue)); diff --git a/linux_module/iface-stream.h b/linux_module/iface-stream.h index 10a3353..6e42963 100644 --- a/linux_module/iface-stream.h +++ b/linux_module/iface-stream.h @@ -1,3 +1,22 @@ +/* + * This file is part of the Palacios Virtual Machine Monitor developed + * by the V3VEE Project with funding from the United States National + * Science Foundation and the Department of Energy. + * + * The V3VEE Project is a joint project between Northwestern University + * and the University of New Mexico. You can find out more at + * http://www.v3vee.org + * + * Copyright (c) 2010, Lei Xia + * Copyright (c) 2010, The V3VEE Project + * All rights reserved. + * + * This is free software. You are permitted to use, redistribute, + * and modify it under the terms of the GNU General Public License + * Version 2 (GPLv2). The accompanying COPYING file contains the + * full text of the license. + */ + #ifndef __IFACE_STREAM_H__ #define __IFACE_STREAM_H__ diff --git a/linux_module/palacios-vnet-brg.c b/linux_module/palacios-vnet-brg.c index e87d422..a45ead0 100644 --- a/linux_module/palacios-vnet-brg.c +++ b/linux_module/palacios-vnet-brg.c @@ -1,7 +1,23 @@ -/* - Palacios VNET Host Bridge - (c) Lei Xia, 2010 +/* + * This file is part of the Palacios Virtual Machine Monitor developed + * by the V3VEE Project with funding from the United States National + * Science Foundation and the Department of Energy. + * + * The V3VEE Project is a joint project between Northwestern University + * and the University of New Mexico. You can find out more at + * http://www.v3vee.org + * + * Copyright (c) 2011, Lei Xia + * Copyright (c) 2011, The V3VEE Project + * All rights reserved. + * + * This is free software. You are permitted to use, redistribute, + * and modify it under the terms of the GNU General Public License + * Version 2 (GPLv2). The accompanying COPYING file contains the + * full text of the license. */ +/* Palacios VNET Host Bridge */ + #include #include #include diff --git a/linux_module/palacios-vnet-ctrl.c b/linux_module/palacios-vnet-ctrl.c index 4cd1c15..74e14c4 100644 --- a/linux_module/palacios-vnet-ctrl.c +++ b/linux_module/palacios-vnet-ctrl.c @@ -1,7 +1,23 @@ -/* - Palacios VNET Control Module - (c) Lei Xia, 2010 +/* + * This file is part of the Palacios Virtual Machine Monitor developed + * by the V3VEE Project with funding from the United States National + * Science Foundation and the Department of Energy. + * + * The V3VEE Project is a joint project between Northwestern University + * and the University of New Mexico. You can find out more at + * http://www.v3vee.org + * + * Copyright (c) 2011, Lei Xia + * Copyright (c) 2011, The V3VEE Project + * All rights reserved. + * + * This is free software. You are permitted to use, redistribute, + * and modify it under the terms of the GNU General Public License + * Version 2 (GPLv2). The accompanying COPYING file contains the + * full text of the license. */ +/* Palacios VNET Control Module */ + #include #include #include diff --git a/linux_module/palacios-vnet.c b/linux_module/palacios-vnet.c index 7070c6d..7da8863 100644 --- a/linux_module/palacios-vnet.c +++ b/linux_module/palacios-vnet.c @@ -1,7 +1,23 @@ -/* - Palacios VNET Host Hooks Implementations - (c) Lei Xia, 2011 +/* + * This file is part of the Palacios Virtual Machine Monitor developed + * by the V3VEE Project with funding from the United States National + * Science Foundation and the Department of Energy. + * + * The V3VEE Project is a joint project between Northwestern University + * and the University of New Mexico. You can find out more at + * http://www.v3vee.org + * + * Copyright (c) 2011, Lei Xia + * Copyright (c) 2011, The V3VEE Project + * All rights reserved. + * + * This is free software. You are permitted to use, redistribute, + * and modify it under the terms of the GNU General Public License + * Version 2 (GPLv2). The accompanying COPYING file contains the + * full text of the license. */ +/* Palacios VNET Host Hooks Implementations */ + #include #include #include diff --git a/linux_module/palacios-vnet.h b/linux_module/palacios-vnet.h index 6acf6c9..47d8ed9 100644 --- a/linux_module/palacios-vnet.h +++ b/linux_module/palacios-vnet.h @@ -1,6 +1,20 @@ /* - * Palacios VNET Host Header - * (c) Lei Xia, 2010 + * This file is part of the Palacios Virtual Machine Monitor developed + * by the V3VEE Project with funding from the United States National + * Science Foundation and the Department of Energy. + * + * The V3VEE Project is a joint project between Northwestern University + * and the University of New Mexico. You can find out more at + * http://www.v3vee.org + * + * Copyright (c) 2011, Lei Xia + * Copyright (c) 2011, The V3VEE Project + * All rights reserved. + * + * This is free software. You are permitted to use, redistribute, + * and modify it under the terms of the GNU General Public License + * Version 2 (GPLv2). The accompanying COPYING file contains the + * full text of the license. */ #ifndef __PALACIOS_VNET_H__ diff --git a/linux_module/util-hashtable.c b/linux_module/util-hashtable.c index 52fc594..e5ac64a 100644 --- a/linux_module/util-hashtable.c +++ b/linux_module/util-hashtable.c @@ -1,6 +1,20 @@ /* - * Palacios Hash Table - * (c) Lei Xia, 2011 + * This file is part of the Palacios Virtual Machine Monitor developed + * by the V3VEE Project with funding from the United States National + * Science Foundation and the Department of Energy. + * + * The V3VEE Project is a joint project between Northwestern University + * and the University of New Mexico. You can find out more at + * http://www.v3vee.org + * + * Copyright (c) 2011, Lei Xia + * Copyright (c) 2011, The V3VEE Project + * All rights reserved. + * + * This is free software. You are permitted to use, redistribute, + * and modify it under the terms of the GNU General Public License + * Version 2 (GPLv2). The accompanying COPYING file contains the + * full text of the license. */ #include diff --git a/linux_module/util-hashtable.h b/linux_module/util-hashtable.h index 3d46202..72a6cbb 100644 --- a/linux_module/util-hashtable.h +++ b/linux_module/util-hashtable.h @@ -1,3 +1,22 @@ +/* + * This file is part of the Palacios Virtual Machine Monitor developed + * by the V3VEE Project with funding from the United States National + * Science Foundation and the Department of Energy. + * + * The V3VEE Project is a joint project between Northwestern University + * and the University of New Mexico. You can find out more at + * http://www.v3vee.org + * + * Copyright (c) 2010, Lei Xia + * Copyright (c) 2010, The V3VEE Project + * All rights reserved. + * + * This is free software. You are permitted to use, redistribute, + * and modify it under the terms of the GNU General Public License + * Version 2 (GPLv2). The accompanying COPYING file contains the + * full text of the license. + */ + #ifndef __PALACIOS_HASHTABLE_H__ #define __PALACIOS_HASHTABLE_H__ diff --git a/linux_module/util-ringbuffer.c b/linux_module/util-ringbuffer.c index 53071e8..0902acc 100644 --- a/linux_module/util-ringbuffer.c +++ b/linux_module/util-ringbuffer.c @@ -1,7 +1,22 @@ -/* - * Ringbuffer Routines for VM - * (c) Lei Xia, 2010 +/* + * This file is part of the Palacios Virtual Machine Monitor developed + * by the V3VEE Project with funding from the United States National + * Science Foundation and the Department of Energy. + * + * The V3VEE Project is a joint project between Northwestern University + * and the University of New Mexico. You can find out more at + * http://www.v3vee.org + * + * Copyright (c) 2010, Lei Xia + * Copyright (c) 2010, The V3VEE Project + * All rights reserved. + * + * This is free software. You are permitted to use, redistribute, + * and modify it under the terms of the GNU General Public License + * Version 2 (GPLv2). The accompanying COPYING file contains the + * full text of the license. */ + #include #include #include diff --git a/linux_module/util-ringbuffer.h b/linux_module/util-ringbuffer.h index eb39025..11eb8a1 100644 --- a/linux_module/util-ringbuffer.h +++ b/linux_module/util-ringbuffer.h @@ -1,26 +1,40 @@ -/* - * Ringbuffer Routines for VM - * (c) Lei Xia, 2010 - */ +/* + * This file is part of the Palacios Virtual Machine Monitor developed + * by the V3VEE Project with funding from the United States National + * Science Foundation and the Department of Energy. + * + * The V3VEE Project is a joint project between Northwestern University + * and the University of New Mexico. You can find out more at + * http://www.v3vee.org + * + * Copyright (c) 2010, Lei Xia + * Copyright (c) 2010, The V3VEE Project + * All rights reserved. + * + * This is free software. You are permitted to use, redistribute, + * and modify it under the terms of the GNU General Public License + * Version 2 (GPLv2). The accompanying COPYING file contains the + * full text of the license. + */ -#ifndef __PALACIOS_RING_BUFFER_H__ -#define __PALACIOS_RING_BUFFER_H__ - -struct ringbuf { - unsigned char * buf; - unsigned int size; +#ifndef __PALACIOS_RING_BUFFER_H__ +#define __PALACIOS_RING_BUFFER_H__ - unsigned int start; - unsigned int end; - unsigned int current_len; +struct ringbuf { + unsigned char * buf; + unsigned int size; + + unsigned int start; + unsigned int end; + unsigned int current_len; }; - - -struct ringbuf * create_ringbuf(unsigned int size); -void free_ringbuf(struct ringbuf * ring); -int ringbuf_read(struct ringbuf * ring, unsigned char * dst, unsigned int len); -int ringbuf_write(struct ringbuf * ring, unsigned char * src, unsigned int len); -int ringbuf_data_len(struct ringbuf * ring); -#endif - + +struct ringbuf * create_ringbuf(unsigned int size); +void free_ringbuf(struct ringbuf * ring); +int ringbuf_read(struct ringbuf * ring, unsigned char * dst, unsigned int len); +int ringbuf_write(struct ringbuf * ring, unsigned char * src, unsigned int len); +int ringbuf_data_len(struct ringbuf * ring); + +#endif + diff --git a/palacios/include/palacios/vmm_ethernet.h b/palacios/include/palacios/vmm_ethernet.h index 1fd00ac..dadb775 100644 --- a/palacios/include/palacios/vmm_ethernet.h +++ b/palacios/include/palacios/vmm_ethernet.h @@ -28,10 +28,9 @@ #define ETH_ALEN 6 #define MIN_MTU 68 -//#define MAX_MTU 65535 -#define MAX_MTU 9000 +#define MAX_MTU 65535 -#define MAX_PACKET_LEN (ETHERNET_HEADER_LEN + MAX_MTU) +#define MAX_PACKET_LEN (MAX_MTU) #ifdef V3_CONFIG_VNET extern int net_debug; diff --git a/palacios/src/devices/lnx_virtio_nic.c b/palacios/src/devices/lnx_virtio_nic.c index 7a4eb4a..952cc52 100644 --- a/palacios/src/devices/lnx_virtio_nic.c +++ b/palacios/src/devices/lnx_virtio_nic.c @@ -595,7 +595,7 @@ static int virtio_rx(uint8_t * buf, uint32_t size, void * private_data) { uint16_t buf_idx; struct vring_desc * buf_desc; uint32_t hdr_len, len; - uint32_t offset = 0; + uint32_t offset = 0; hdr_len = (virtio->mergeable_rx_bufs)? sizeof(struct virtio_net_hdr_mrg_rxbuf): @@ -935,8 +935,6 @@ static int connect_fn(struct v3_vm_info * info, net_state->timer = v3_add_timer(&(info->cores[0]), &timer_ops,net_state); - PrintError("net_state 0x%p\n", (void *)net_state); - ops->recv = virtio_rx; ops->frontend_data = net_state; memcpy(ops->fnt_mac, virtio->mac, ETH_ALEN);