From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:34879) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UL8ag-00058K-TF for qemu-devel@nongnu.org; Thu, 28 Mar 2013 04:53:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UL8ae-0000OE-2U for qemu-devel@nongnu.org; Thu, 28 Mar 2013 04:53:46 -0400 Received: from mail-we0-x22d.google.com ([2a00:1450:400c:c03::22d]:44373) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UL8ad-0000O8-SS for qemu-devel@nongnu.org; Thu, 28 Mar 2013 04:53:43 -0400 Received: by mail-we0-f173.google.com with SMTP id t57so3676165wey.32 for ; Thu, 28 Mar 2013 01:53:43 -0700 (PDT) From: Dmitry Fleytman Date: Thu, 28 Mar 2013 10:53:29 +0200 Message-Id: <1364460810-24876-2-git-send-email-dmitry@daynix.com> In-Reply-To: <1364460810-24876-1-git-send-email-dmitry@daynix.com> References: <1364460810-24876-1-git-send-email-dmitry@daynix.com> Subject: [Qemu-devel] [1/2] [vmxnet3] iPXE compatibility fixes List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Dmitry Fleytman , Yan Vugenfirer , Stefan Hajnoczi , Anthony Liguori , Paolo Bonzini iPXE vmxnet3 driver makes a few assumptions regarding device operation that were missed during testing with Linux and Windows drivers. This patch adds following logic: 1. Additional GET commands processing added 2. Max number of RX chunks should be set to 1 when driver passes 0 via corresponding shared memory field 3. Enforecement for max chunks number added Signed-off-by: Dmitry Fleytman --- hw/vmxnet3.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/vmxnet3.c b/hw/vmxnet3.c index 925be80..cb36f72 100644 --- a/hw/vmxnet3.c +++ b/hw/vmxnet3.c @@ -1033,6 +1033,7 @@ vmxnet3_indicate_packet(VMXNET3State *s) is_head = false; ready_rxcd_pa = new_rxcd_pa; new_rxcd_pa = 0; + num_frags++; } if (0 != ready_rxcd_pa) { @@ -1324,6 +1325,10 @@ static void vmxnet3_activate_device(VMXNET3State *s) s->max_rx_frags = VMXNET3_READ_DRV_SHARED16(s->drv_shmem, devRead.misc.maxNumRxSG); + if (s->max_rx_frags == 0) { + s->max_rx_frags = 1; + } + VMW_CFPRN("Max RX fragments is %u", s->max_rx_frags); s->event_int_idx = @@ -1524,6 +1529,12 @@ static uint64_t vmxnet3_get_command_status(VMXNET3State *s) VMW_CFPRN("Device active: %" PRIx64, ret); break; + case VMXNET3_CMD_RESET_DEV: + case VMXNET3_CMD_QUIESCE_DEV: + case VMXNET3_CMD_GET_QUEUE_STATUS: + ret = 0; + break; + case VMXNET3_CMD_GET_LINK: ret = s->link_status_and_speed; VMW_CFPRN("Link and speed: %" PRIx64, ret); -- 1.8.1.4