From patchwork Mon Apr 8 12:42:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Hajnoczi X-Patchwork-Id: 234756 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 78DB42C009C for ; Mon, 8 Apr 2013 22:43:52 +1000 (EST) Received: from localhost ([::1]:36791 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPBQL-0006aI-JA for incoming@patchwork.ozlabs.org; Mon, 08 Apr 2013 08:43:49 -0400 Received: from eggs.gnu.org ([208.118.235.92]:36330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPBPr-0006PF-PD for qemu-devel@nongnu.org; Mon, 08 Apr 2013 08:43:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPBPf-0000UU-TD for qemu-devel@nongnu.org; Mon, 08 Apr 2013 08:43:19 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58026) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPBPf-0000UN-Jw for qemu-devel@nongnu.org; Mon, 08 Apr 2013 08:43:07 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r38Ch5jR016693 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 8 Apr 2013 08:43:05 -0400 Received: from localhost (ovpn-112-48.ams2.redhat.com [10.36.112.48]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r38Ch3sj012016; Mon, 8 Apr 2013 08:43:04 -0400 From: Stefan Hajnoczi To: Date: Mon, 8 Apr 2013 14:42:57 +0200 Message-Id: <1365424978-4348-2-git-send-email-stefanha@redhat.com> In-Reply-To: <1365424978-4348-1-git-send-email-stefanha@redhat.com> References: <1365424978-4348-1-git-send-email-stefanha@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Dmitry Fleytman , Anthony Liguori , Stefan Hajnoczi , rth@twiddle.net Subject: [Qemu-devel] [PATCH 1/2] vmxnet3: iPXE compatibility fixes X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Dmitry Fleytman 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 Signed-off-by: Stefan Hajnoczi --- hw/vmxnet3.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/hw/vmxnet3.c b/hw/vmxnet3.c index bdd256e..1e18168 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);