+/*
+ * 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 <lxia@northwestern.edu>
+ * Copyright (c) 2011, The V3VEE Project <http://www.v3vee.org>
+ * 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 <asm/uaccess.h>
#include <linux/inet.h>
* Version 2 (GPLv2). The accompanying COPYING file contains the
* full text of the license.
*/
+ /*
+ * Palacios Socket Interface Implementation
+ */
#include <interfaces/vmm_socket.h>
-
-/*
- * 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 <lxia@northwestern.edu>
+ * Copyright (c) 2010, The V3VEE Project <http://www.v3vee.org>
+ * 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 <linux/errno.h>
#include <linux/percpu.h>
#include <linux/sched.h>
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 {
wait_event_interruptible(stream->intr_queue, (ringbuf_data_len(stream->buf) != 0));
-
- return 0;
+ return ringbuf_read(stream->buf, buf, size);
}
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));
+/*
+ * 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 <lxia@northwestern.edu>
+ * Copyright (c) 2010, The V3VEE Project <http://www.v3vee.org>
+ * 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__
-/*
- 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 <lxia@northwestern.edu>
+ * Copyright (c) 2011, The V3VEE Project <http://www.v3vee.org>
+ * 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 <linux/spinlock.h>
#include <linux/seq_file.h>
#include <linux/proc_fs.h>
-/*
- 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 <lxia@northwestern.edu>
+ * Copyright (c) 2011, The V3VEE Project <http://www.v3vee.org>
+ * 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 <linux/spinlock.h>
#include <linux/seq_file.h>
#include <linux/proc_fs.h>
-/*
- 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 <lxia@northwestern.edu>
+ * Copyright (c) 2011, The V3VEE Project <http://www.v3vee.org>
+ * 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 <linux/kernel.h>
#include <linux/kthread.h>
#include <linux/spinlock.h>
/*
- * 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 <lxia@northwestern.edu>
+ * Copyright (c) 2011, The V3VEE Project <http://www.v3vee.org>
+ * 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__
/*
- * 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 <lxia@northwestern.edu>
+ * Copyright (c) 2011, The V3VEE Project <http://www.v3vee.org>
+ * 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 <linux/string.h>
+/*
+ * 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 <lxia@northwestern.edu>
+ * Copyright (c) 2010, The V3VEE Project <http://www.v3vee.org>
+ * 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__
-/* \r
- * Ringbuffer Routines for VM\r
- * (c) Lei Xia, 2010\r
+/*\r
+ * This file is part of the Palacios Virtual Machine Monitor developed\r
+ * by the V3VEE Project with funding from the United States National\r
+ * Science Foundation and the Department of Energy.\r
+ *\r
+ * The V3VEE Project is a joint project between Northwestern University\r
+ * and the University of New Mexico. You can find out more at\r
+ * http://www.v3vee.org\r
+ *\r
+ * Copyright (c) 2010, Lei Xia <lxia@northwestern.edu>\r
+ * Copyright (c) 2010, The V3VEE Project <http://www.v3vee.org>\r
+ * All rights reserved.\r
+ *\r
+ * This is free software. You are permitted to use, redistribute,\r
+ * and modify it under the terms of the GNU General Public License\r
+ * Version 2 (GPLv2). The accompanying COPYING file contains the\r
+ * full text of the license.\r
*/\r
+\r
#include <linux/errno.h>\r
#include <linux/percpu.h>\r
#include <linux/sched.h>\r
-/*
- * Ringbuffer Routines for VM\r
- * (c) Lei Xia, 2010
- */\r
+/*
+ * 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 <lxia@northwestern.edu>
+ * Copyright (c) 2010, The V3VEE Project <http://www.v3vee.org>
+ * 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__\r
-#define __PALACIOS_RING_BUFFER_H__\r
-\r
-struct ringbuf {\r
- unsigned char * buf;\r
- unsigned int size;\r
+#ifndef __PALACIOS_RING_BUFFER_H__
+#define __PALACIOS_RING_BUFFER_H__
- unsigned int start;\r
- unsigned int end;\r
- unsigned int current_len;\r
+struct ringbuf {
+ unsigned char * buf;
+ unsigned int size;
+
+ unsigned int start;
+ unsigned int end;
+ unsigned int current_len;
};
-\r
-\r
-struct ringbuf * create_ringbuf(unsigned int size);\r
-void free_ringbuf(struct ringbuf * ring);\r
-int ringbuf_read(struct ringbuf * ring, unsigned char * dst, unsigned int len);\r
-int ringbuf_write(struct ringbuf * ring, unsigned char * src, unsigned int len);\r
-int ringbuf_data_len(struct ringbuf * ring);\r
-#endif\r
-\r
+
+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
+
#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;
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):
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);