qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Igor Kovalenko" <igor.v.kovalenko@gmail.com>
To: Paul Jakma <paul@jakma.org>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] qemu vl.h Makefile.target hw/pci.c hw/pcnet.c
Date: Sat, 8 Jul 2006 18:46:12 +0400	[thread overview]
Message-ID: <b2fa41d60607080746k4fb5af29s5f76399ed4f2aec9@mail.gmail.com> (raw)
In-Reply-To: <Pine.4s.4.64.0607081351120.20605@sheen.jakma.org>


[-- Attachment #1.1: Type: text/plain, Size: 358 bytes --]

On 7/8/06, Paul Jakma <paul@jakma.org> wrote:
>
> On Sat, 8 Jul 2006, Paul Jakma wrote:
>
> > Hmm, define 'unable to use it'? It seems (on very quick testing) to work
> in
> > Solaris.
>
> Spoke too soon, ICMP echos and TCP connects work, but it seems to
> have problems transferring anything substantial.
>
>
Try this patch - transfers should start to work

[-- Attachment #1.2: Type: text/html, Size: 642 bytes --]

[-- Attachment #2: pcnet-no-recursive-tx.diff --]
[-- Type: text/x-patch, Size: 1182 bytes --]

Index: hw/pcnet.c
===================================================================
RCS file: /cvsroot/qemu/qemu/hw/pcnet.c,v
retrieving revision 1.2
diff -u -r1.2 pcnet.c
--- hw/pcnet.c	4 Jul 2006 21:42:10 -0000	1.2
+++ hw/pcnet.c	8 Jul 2006 14:44:28 -0000
@@ -57,6 +57,7 @@
     uint64_t timer;
     int xmit_pos, recv_pos;
     uint8_t buffer[4096];
+    int tx_busy;
 };
 
 #ifdef __GNUC__
@@ -659,6 +660,8 @@
     s->csr[114] = 0x0000;
     s->csr[122] = 0x0000;
     s->csr[124] = 0x0000;
+
+    s->tx_busy = 0;
 }
 
 static void pcnet_update_irq(PCNetState *s)
@@ -1104,7 +1107,9 @@
         s->csr[0] &= ~0x0008;
         return;
     }
-    
+
+    s->tx_busy = 1;
+
     txagain:
     if (pcnet_tdte_poll(s)) {
         struct pcnet_TMD tmd;
@@ -1167,6 +1172,8 @@
         if (count--)
           goto txagain;
     }
+
+    s->tx_busy = 0;
 }
 
 static void pcnet_poll(PCNetState *s)
@@ -1177,7 +1184,13 @@
 
     if (CSR_TDMD(s) || 
         (CSR_TXON(s) && !CSR_DPOLL(s) && pcnet_tdte_poll(s)))
+    {
+        /* prevent recursion */
+        if (s->tx_busy)
+            return;
+
         pcnet_transmit(s);
+    }
 }
 
 static void pcnet_poll_timer(void *opaque)

  reply	other threads:[~2006-07-08 14:46 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-04 11:33 [Qemu-devel] qemu vl.h Makefile.target hw/pci.c hw/pcnet.c Fabrice Bellard
2006-07-04 11:37 ` Fabrice Bellard
2006-07-04 16:10   ` M. Warner Losh
2006-07-04 21:26   ` Christian MICHON
2006-07-08 10:24   ` Paul Jakma
2006-07-08 12:52     ` Paul Jakma
2006-07-08 14:46       ` Igor Kovalenko [this message]
2006-07-08 19:48         ` Paul Jakma

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=b2fa41d60607080746k4fb5af29s5f76399ed4f2aec9@mail.gmail.com \
    --to=igor.v.kovalenko@gmail.com \
    --cc=paul@jakma.org \
    --cc=qemu-devel@nongnu.org \
    /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).