qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Fleytman <dmitry@daynix.com>
To: qemu-devel@nongnu.org
Cc: Dmitry Fleytman <dmitry@daynix.com>,
	Yan Vugenfirer <yan@daynix.com>,
	Stefan Hajnoczi <stefanha@gmail.com>,
	Anthony Liguori <anthony@codemonkey.ws>,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: [Qemu-devel] [1/2] [vmxnet3] iPXE compatibility fixes
Date: Thu, 28 Mar 2013 10:53:29 +0200	[thread overview]
Message-ID: <1364460810-24876-2-git-send-email-dmitry@daynix.com> (raw)
In-Reply-To: <1364460810-24876-1-git-send-email-dmitry@daynix.com>

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 <dmitry@daynix.com>
---
 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

  reply	other threads:[~2013-03-28  8:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-28  8:53 [Qemu-devel] [0/2] [vmxnet3] iPXE support and byte swapping fix Dmitry Fleytman
2013-03-28  8:53 ` Dmitry Fleytman [this message]
2013-03-28  8:53 ` [Qemu-devel] [2/2] [vmxnet3] const_cpu_to_le64 wrapping for feature bits dropped Dmitry Fleytman
2013-04-02  6:14   ` Alexander Graf
2013-04-08 12:03 ` [Qemu-devel] [0/2] [vmxnet3] iPXE support and byte swapping fix Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1364460810-24876-2-git-send-email-dmitry@daynix.com \
    --to=dmitry@daynix.com \
    --cc=anthony@codemonkey.ws \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@gmail.com \
    --cc=yan@daynix.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).