From: Lei Xia Date: Mon, 30 Apr 2012 17:00:18 +0000 (-0500) Subject: Fix lock/unlock bug in virtio nic X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=commitdiff_plain;h=b1bfd7d02a140a04e1d9fa7831dc0ed6b3440d12;p=palacios.releases.git Fix lock/unlock bug in virtio nic --- diff --git a/palacios/src/devices/lnx_virtio_nic.c b/palacios/src/devices/lnx_virtio_nic.c index 7f217ae..3c620b9 100644 --- a/palacios/src/devices/lnx_virtio_nic.c +++ b/palacios/src/devices/lnx_virtio_nic.c @@ -286,6 +286,7 @@ static int handle_pkt_tx(struct guest_info * core, if(q->cur_avail_idx == q->avail->index || (quote > 0 && txed >= quote)) { left = (q->cur_avail_idx != q->avail->index); + v3_unlock_irqrestore(virtio_state->tx_lock, flags); break; } @@ -321,8 +322,6 @@ static int handle_pkt_tx(struct guest_info * core, q->used->ring[q->used->index % q->queue_size].id = q->avail->ring[tmp_idx % q->queue_size]; - //q->used->ring[q->used->index % q->queue_size].length = buf_desc->length; /* What do we set this to???? */ - q->used->index ++; v3_unlock_irqrestore(virtio_state->tx_lock, flags);