From: Stefan Weil <weil@mail.berlios.de>
To: Michal Filka <mfilka@sitronics.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: eepro100.c
Date: Sat, 19 Sep 2009 19:10:57 +0200 [thread overview]
Message-ID: <4AB510A1.9010702@mail.berlios.de> (raw)
In-Reply-To: <4AB4C761.5030909@mail.berlios.de>
[-- Attachment #1: Type: text/plain, Size: 1130 bytes --]
Stefan Weil schrieb:
> Jan Kiszka schrieb:
>> Michal Filka wrote:
>>> Hi,
>>>
>>> I have question on i82557b emulation in kvm.
>>>
>>> I have run a proprietary operating system (Pharlap OS) in kvm. Part
>>> of the job has been porting driver for i8255x. During the job I
>>> discovered that kvm's emulation doesn't support a RNR interrupt (it
>>> is disabled in the code).
>>>
>>> Why is it disabled? I'm running heavily loaded application and I have
>>> to poll descriptor list instead of waiting for RNR interrupt.
>> Best asked on qemu-devel, CC'ing the developer of this device model.
>>
>> Jan
>>
>
> Hi,
>
> up to now, nobody complained about the missing RNR interrupts.
> Linux obviously works without them, so I had no reason to
> implement them.
>
> The disabled code parts (function eepro100_rnr_interrupt)
> can be enabled, but you still need code which calls them
> at the right places.
>
> This should not be very difficult if there is some test case
> which proves the working RNR interrupt.
>
> Regards
> Stefan
>
Hi Michal,
could you please try the appended patch and tell me whether it works?
Regards
Stefan
[-- Attachment #2: 0001-eepro100-Add-RNR-interrupt.patch --]
[-- Type: text/x-diff, Size: 2300 bytes --]
>From cb12daa2f7ecbf041655825054a1661668ab7274 Mon Sep 17 00:00:00 2001
From: Stefan Weil <weil@mail.berlios.de>
Date: Sat, 19 Sep 2009 19:05:07 +0200
Subject: [PATCH] eepro100: Add RNR interrupt
Set RNR (receive unit not ready) interrupt for RU abort command.
Signed-off-by: Stefan Weil <weil@mail.berlios.de>
---
hw/eepro100.c | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/hw/eepro100.c b/hw/eepro100.c
index a8f6b3f..6d49bb8 100644
--- a/hw/eepro100.c
+++ b/hw/eepro100.c
@@ -114,7 +114,7 @@
#define RU_NOP 0x0000
#define RX_START 0x0001
#define RX_RESUME 0x0002
-#define RX_ABORT 0x0004
+#define RU_ABORT 0x0004
#define RX_ADDR_LOAD 0x0006
#define RX_RESUMENR 0x0007
#define INT_MASK 0x0100
@@ -363,13 +363,11 @@ static void eepro100_fr_interrupt(EEPRO100State * s)
eepro100_interrupt(s, 0x40);
}
-#if 0
static void eepro100_rnr_interrupt(EEPRO100State * s)
{
/* RU is not ready. */
eepro100_interrupt(s, 0x10);
}
-#endif
static void eepro100_mdi_interrupt(EEPRO100State * s)
{
@@ -865,6 +863,13 @@ static void eepro100_ru_command(EEPRO100State * s, uint8_t val)
}
set_ru_state(s, ru_ready);
break;
+ case RU_ABORT:
+ /* RU abort. */
+ if (get_ru_state(s) == ru_ready) {
+ eepro100_rnr_interrupt(s);
+ }
+ set_ru_state(s, ru_idle);
+ break;
case RX_ADDR_LOAD:
/* Load RU base. */
TRACE(OTHER, logout("val=0x%02x (RU base address)\n", val));
@@ -872,7 +877,7 @@ static void eepro100_ru_command(EEPRO100State * s, uint8_t val)
break;
default:
logout("val=0x%02x (undefined RU command)\n", val);
- missing("Undefined SU command");
+ missing("Undefined RU command");
}
}
@@ -1531,6 +1536,8 @@ static ssize_t nic_receive(VLANClientState *vc, const uint8_t * buf, size_t size
if (get_ru_state(s) != ru_ready) {
/* No resources available. */
logout("no resources, state=%u\n", get_ru_state(s));
+ /* TODO: RNR interrupt only at first failed frame? */
+ eepro100_rnr_interrupt(s);
s->statistics.rx_resource_errors++;
//~ assert(!"no resources");
return -1;
--
1.5.6.5
next prev parent reply other threads:[~2009-09-19 17:11 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-17 8:34 eepro100.c Michal Filka
2009-09-19 11:14 ` eepro100.c Jan Kiszka
2009-09-19 11:58 ` eepro100.c Stefan Weil
2009-09-19 17:10 ` Stefan Weil [this message]
2009-09-22 4:50 ` eepro100.c Michal Filka
2009-09-22 9:25 ` eepro100.c Michal Filka
2009-09-22 11:31 ` eepro100.c Michal Filka
2009-09-22 11:56 ` eepro100.c Amit Shah
2009-09-22 16:15 ` eepro100.c Stefan Weil
2009-09-23 5:34 ` eepro100.c Michal Filka
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=4AB510A1.9010702@mail.berlios.de \
--to=weil@mail.berlios.de \
--cc=kvm@vger.kernel.org \
--cc=mfilka@sitronics.com \
--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).