Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Clear the code
Lei Xia [Fri, 12 Mar 2010 19:59:52 +0000 (13:59 -0600)]
palacios/include/palacios/vm_guest.h
palacios/src/devices/lnx_virtio_nic.c
palacios/src/palacios/vmx_handler.c

index 9ed1e20..041b755 100644 (file)
 #endif
 
 
-#ifdef CONFIG_VNET
-#include <palacios/vmm_vnet.h>
-#endif
-
-
 #ifdef CONFIG_SYMBIOTIC
 #include <palacios/vmm_symbiotic.h>
 struct v3_sym_core_state;
@@ -53,14 +48,12 @@ struct v3_sym_core_state;
 
 #include <palacios/vmm_config.h>
 
-
 struct v3_intr_state;
 
 
 
 
 
-
 struct guest_info {
     uint64_t rip;
 
@@ -114,10 +107,6 @@ struct guest_info {
     struct v3_vm_info * vm_info;
     // the logical cpu this guest context is executing on
     int cpu_id;
-
-#ifdef CONFIG_VNET_PROFILE
-    struct v3_vnet_profile vnet_times;
-#endif
 };
 
 
index 84e8f0d..1caecbd 100644 (file)
@@ -208,14 +208,8 @@ static int handle_pkt_tx(struct guest_info *core, struct virtio_net_state * virt
     struct virtio_queue * q = &(virtio_state->tx_vq);
     struct virtio_net_hdr * hdr = NULL;
 
-    if (q->avail->index < q->last_avail_idx) {
-       q->idx_overflow = true;
-    }
-
-    q->last_avail_idx = q->avail->index;
 
-    while (q->cur_avail_idx < q->avail->index || 
-          (q->idx_overflow && q->cur_avail_idx < (q->avail->index + 65536))) {
+    while (q->cur_avail_idx != q->avail->index) {
        struct vring_desc * hdr_desc = NULL;
        addr_t hdr_addr = 0;
        uint16_t desc_idx = q->avail->ring[q->cur_avail_idx % q->queue_size];
@@ -248,13 +242,7 @@ static int handle_pkt_tx(struct guest_info *core, struct virtio_net_state * virt
        q->used->ring[q->used->index % q->queue_size].length = req_len; // What do we set this to????
        q->used->index++;
 
-       int last_idx = q->cur_avail_idx;
-
        q->cur_avail_idx ++;
-
-       if (q->cur_avail_idx < last_idx) {
-           q->idx_overflow = false;
-       }
     }
 
     if (!(q->avail->flags & VIRTIO_NO_IRQ_FLAG)) {
@@ -532,11 +520,7 @@ static int virtio_rx(uint8_t * buf, uint32_t size, void * private_data) {
        goto exit;
     }
 
-    if (q->last_avail_idx > q->avail->index)
-       q->idx_overflow = true;
-    q->last_avail_idx = q->avail->index;
-
-    if (q->cur_avail_idx < q->avail->index || (q->idx_overflow && q->cur_avail_idx < q->avail->index+65536)){
+    if (q->cur_avail_idx != q->avail->index){
        addr_t hdr_addr = 0;
        uint16_t hdr_idx = q->avail->ring[q->cur_avail_idx % q->queue_size];
        uint16_t buf_idx = 0;
@@ -570,10 +554,7 @@ static int virtio_rx(uint8_t * buf, uint32_t size, void * private_data) {
        q->used->ring[q->used->index % q->queue_size].length = data_len + hdr_len; // This should be the total length of data sent to guest (header+pkt_data)
        q->used->index++;
 
-       int last_idx = q->cur_avail_idx;
        q->cur_avail_idx++;
-       if (q->cur_avail_idx < last_idx)
-           q->idx_overflow = false;
     } else {
        virtio->pkt_drop++;
 
index f24324e..a5f6bc8 100644 (file)
@@ -50,10 +50,6 @@ int v3_handle_vmx_exit(struct guest_info * info, struct vmx_exit_info * exit_inf
       
       v3_print_vmcs();
     */
-#ifdef CONFIG_VNET_PROFILE
-    uint64_t start, end;
-    rdtscll(start);
-#endif
 
 #ifdef CONFIG_TELEMETRY
     if (info->vm_info->enable_telemetry) {
@@ -232,22 +228,6 @@ int v3_handle_vmx_exit(struct guest_info * info, struct vmx_exit_info * exit_inf
     }
 #endif
 
-#ifdef CONFIG_VNET_PROFILE
-    rdtscll(end);
-    info->vnet_times.total_exit_time = end - start;
-    if(info->vnet_times.print) 
-       PrintError("Vnet_profiling: total_exit_time: %ld, total_handle_time: %ld memcpy_time: %ld  copy_from_guest: %ld copy_to_guest: %ld malloc_free: %ld, route_lookup: %ld\n", 
-                    (long)info->vnet_times.total_exit_time,
-                        (long)info->vnet_times.total_handle_time,
-                        (long)info->vnet_times.memcpy_time,
-                        (long)info->vnet_times.time_copy_from_guest,
-                        (long)info->vnet_times.time_copy_to_guest,
-                        (long)info->vnet_times.time_mallocfree,
-                        (long)info->vnet_times.time_route_lookup);
-
-    info->vnet_times.print = false;
-#endif
-
 
     return 0;
 }