qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] Can you commit the pcnet patch ?
@ 2005-07-20 10:32 Ludovic Drolez
  2005-07-20 12:37 ` Paul Brook
  2005-07-21  7:29 ` Lars Munch
  0 siblings, 2 replies; 19+ messages in thread
From: Ludovic Drolez @ 2005-07-20 10:32 UTC (permalink / raw)
  To: qemu-devel

Hi !

I've tried the latest AMD pcnet patch (made by Antony T Curtis) with qemu 0.7 
because I was tired of the sloooww PXE booting of my QEMU. For exemple, to load 
a linux kernel + initrd over TFTP, it takes 4m30s with a ne2000, and 1m35s with 
the PCNET card.

I had no problems with this driver under Windows and Linux, so it would be nice 
to have this driver for the next Qemu release...

Cheers,

-- 
Ludovic DROLEZ                              Linbox / Free&ALter Soft
www.linbox.com www.linbox.org	              tel: +33 3 87 50 87 90
152 rue de Grigy - Technopole Metz 2000                   57070 METZ

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-20 10:32 [Qemu-devel] Can you commit the pcnet patch ? Ludovic Drolez
@ 2005-07-20 12:37 ` Paul Brook
  2005-07-20 12:48   ` Christian MICHON
  2005-07-20 12:56   ` Ludovic Drolez
  2005-07-21  7:29 ` Lars Munch
  1 sibling, 2 replies; 19+ messages in thread
From: Paul Brook @ 2005-07-20 12:37 UTC (permalink / raw)
  To: qemu-devel; +Cc: Ludovic Drolez

On Wednesday 20 July 2005 11:32, Ludovic Drolez wrote:
> Hi !
>
> I've tried the latest AMD pcnet patch (made by Antony T Curtis) with qemu
> 0.7 because I was tired of the sloooww PXE booting of my QEMU. For exemple,
> to load a linux kernel + initrd over TFTP, it takes 4m30s with a ne2000,
> and 1m35s with the PCNET card.

A reference URL would be handy. I assume you mean:

http://dad-answers.com/qemu/patches/AMD-PCNET-II/qemu-pcnet.patch6.gz

Paul

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-20 12:37 ` Paul Brook
@ 2005-07-20 12:48   ` Christian MICHON
  2005-07-21 15:32     ` Ludovic Drolez
  2005-07-20 12:56   ` Ludovic Drolez
  1 sibling, 1 reply; 19+ messages in thread
From: Christian MICHON @ 2005-07-20 12:48 UTC (permalink / raw)
  To: qemu-devel; +Cc: Ludovic Drolez

or maybe this one, containing more of Anthony's patches:

http://cyberkinetica.homeunix.net/qemu/

:)

Christian

On 7/20/05, Paul Brook wrote:
> A reference URL would be handy. I assume you mean:
> 
> http://dad-answers.com/qemu/patches/AMD-PCNET-II/qemu-pcnet.patch6.gz
>

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-20 12:37 ` Paul Brook
  2005-07-20 12:48   ` Christian MICHON
@ 2005-07-20 12:56   ` Ludovic Drolez
  2005-07-20 14:26     ` Christian MICHON
  1 sibling, 1 reply; 19+ messages in thread
From: Ludovic Drolez @ 2005-07-20 12:56 UTC (permalink / raw)
  To: qemu-devel

Paul Brook wrote:
> A reference URL would be handy. I assume you mean:
> 
> http://dad-answers.com/qemu/patches/AMD-PCNET-II/qemu-pcnet.patch6.gz
> 

Yes, this one !

-- 
Ludovic DROLEZ

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-20 12:56   ` Ludovic Drolez
@ 2005-07-20 14:26     ` Christian MICHON
  2005-07-20 14:45       ` Christian MICHON
  0 siblings, 1 reply; 19+ messages in thread
From: Christian MICHON @ 2005-07-20 14:26 UTC (permalink / raw)
  To: qemu-devel

anyway, this patch as it is fails on v0.7.0
needs re-alignment badly...
if you've an updated patch, could you post it, please ?

Thx
Christian

On 7/20/05, Ludovic Drolez <ldrolez@linbox.com> wrote:
> Paul Brook wrote:
> > A reference URL would be handy. I assume you mean:
> >
> > http://dad-answers.com/qemu/patches/AMD-PCNET-II/qemu-pcnet.patch6.gz
> >
> 
> Yes, this one !
> 
> --
> Ludovic DROLEZ
> 
> 
> _______________________________________________
> Qemu-devel mailing list
> Qemu-devel@nongnu.org
> http://lists.nongnu.org/mailman/listinfo/qemu-devel
> 


-- 
Christian

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-20 14:26     ` Christian MICHON
@ 2005-07-20 14:45       ` Christian MICHON
  2005-07-20 15:19         ` Christian MICHON
  2005-07-20 15:37         ` Filip Navara
  0 siblings, 2 replies; 19+ messages in thread
From: Christian MICHON @ 2005-07-20 14:45 UTC (permalink / raw)
  To: qemu-devel

> > Yes, this one !

I think I understand now why it's not in the mainline yet.
This is only for linux hosts. I doesn't compile (yet :) ) 
on Windows hosts.

I already tapped into the patch to see if I can make it
work on Windows.

Christian

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-20 14:45       ` Christian MICHON
@ 2005-07-20 15:19         ` Christian MICHON
  2005-07-20 15:29           ` Paul Brook
  2005-07-20 15:37         ` Filip Navara
  1 sibling, 1 reply; 19+ messages in thread
From: Christian MICHON @ 2005-07-20 15:19 UTC (permalink / raw)
  To: qemu-devel

When I try to replace bcmp (inexistant in mingw32) with memcmp
inside pcnet.h, like this:

int result = (!CSR_DRCVPA(s)) && !bcmp(hdr->ether_dhost, padr, 6);

into 

int result = (!CSR_DRCVPA(s)) && !bcmp(hdr->ether_dhost, padr, 6);

I get the following error:
In file included from C:/dev/msys/1.0/home/xian/qemu-0.7.0/hw/pcnet.c:64:
C:/dev/msys/1.0/home/xian/qemu-0.7.0/hw/pcnet.h: In function `padr_match':
C:/dev/msys/1.0/home/xian/qemu-0.7.0/hw/pcnet.h:531: error:
dereferencing pointer to incomplete type

anyone having a fix. I'm quite puzzled by the gcc error message.

Thx
Christian

=============================================
static inline int padr_match(PCNetState *s, const uint8_t *buf, int size)
{
    struct ether_header *hdr = (void *)buf;
    uint8_t padr[6] = { 
        s->csr[12] & 0xff, s->csr[12] >> 8,
        s->csr[13] & 0xff, s->csr[13] >> 8,
        s->csr[14] & 0xff, s->csr[14] >> 8 
    };
int result = (!CSR_DRCVPA(s)) && !memcmp(hdr->ether_dhost, padr, 6);

for better understanding of the faulty piece of code

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-20 15:19         ` Christian MICHON
@ 2005-07-20 15:29           ` Paul Brook
  0 siblings, 0 replies; 19+ messages in thread
From: Paul Brook @ 2005-07-20 15:29 UTC (permalink / raw)
  To: qemu-devel, Christian MICHON

> I get the following error:
> In file included from C:/dev/msys/1.0/home/xian/qemu-0.7.0/hw/pcnet.c:64:
> C:/dev/msys/1.0/home/xian/qemu-0.7.0/hw/pcnet.h: In function `padr_match':
> C:/dev/msys/1.0/home/xian/qemu-0.7.0/hw/pcnet.h:531: error:
> dereferencing pointer to incomplete type
>...
>     struct ether_header *hdr = (void *)buf;
>     uint8_t padr[6] = {
>         s->csr[12] & 0xff, s->csr[12] >> 8,
>         s->csr[13] & 0xff, s->csr[13] >> 8,
>         s->csr[14] & 0xff, s->csr[14] >> 8
>     };
> int result = (!CSR_DRCVPA(s)) && !memcmp(hdr->ether_dhost, padr, 6);

Probably win32 doesn't have a definition for "struct ether_header".

Paul

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-20 14:45       ` Christian MICHON
  2005-07-20 15:19         ` Christian MICHON
@ 2005-07-20 15:37         ` Filip Navara
  2005-07-21 11:33           ` Christian MICHON
  1 sibling, 1 reply; 19+ messages in thread
From: Filip Navara @ 2005-07-20 15:37 UTC (permalink / raw)
  To: Christian MICHON, qemu-devel

Christian MICHON wrote:

>>>Yes, this one !
>>>      
>>>
>
>I think I understand now why it's not in the mainline yet.
>This is only for linux hosts. I doesn't compile (yet :) ) 
>on Windows hosts.
>
>I already tapped into the patch to see if I can make it
>work on Windows.
>
>Christian
>
Hmm, I used it on Windows some time ago...

- Filip

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-20 10:32 [Qemu-devel] Can you commit the pcnet patch ? Ludovic Drolez
  2005-07-20 12:37 ` Paul Brook
@ 2005-07-21  7:29 ` Lars Munch
  2005-07-21 13:19   ` Paul Brook
  1 sibling, 1 reply; 19+ messages in thread
From: Lars Munch @ 2005-07-21  7:29 UTC (permalink / raw)
  To: qemu-devel

On Wed, Jul 20, 2005 at 12:32:10PM +0200, Ludovic Drolez wrote:
> Hi !
> 
> I've tried the latest AMD pcnet patch (made by Antony T Curtis) with qemu 
> 0.7 because I was tired of the sloooww PXE booting of my QEMU. For exemple, 
> to load a linux kernel + initrd over TFTP, it takes 4m30s with a ne2000, 
> and 1m35s with the PCNET card.

Does anyone know why pcnet is so much faster than ne2000? is it easier
to emulate? or is there room for improvements on the ne2000?  

-- Lars Munch

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-20 15:37         ` Filip Navara
@ 2005-07-21 11:33           ` Christian MICHON
  2005-07-21 16:43             ` Filip Navara
  0 siblings, 1 reply; 19+ messages in thread
From: Christian MICHON @ 2005-07-21 11:33 UTC (permalink / raw)
  To: Filip Navara; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 521 bytes --]

Hi Filip,

On 7/20/05, Filip Navara wrote:
> Hmm, I used it on Windows some time ago...

did it work ? I manage to update and compile the patch for qemu 0.7.0
and windows host (see attached file). I added some #ifdef and followed
Paul's hint of yesterday (thx Paul :) ).

It compiles fine, but all my clients crash whenever the tcp/ip layer gets
loaded. I tried on linux slaxpro.iso, win95b and win2003/sp1 eval.

Any uber-hacker on windows who could get this to work, pls ?
Thanks in advance.

Christian

[-- Attachment #2: qemu-pcnet.patch7.gz --]
[-- Type: application/x-gzip, Size: 14677 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-21  7:29 ` Lars Munch
@ 2005-07-21 13:19   ` Paul Brook
  2005-07-21 13:49     ` Christian MICHON
  2005-07-21 21:14     ` Fabrice Bellard
  0 siblings, 2 replies; 19+ messages in thread
From: Paul Brook @ 2005-07-21 13:19 UTC (permalink / raw)
  To: qemu-devel

On Thursday 21 July 2005 08:29, Lars Munch wrote:
> On Wed, Jul 20, 2005 at 12:32:10PM +0200, Ludovic Drolez wrote:
> > Hi !
> >
> > I've tried the latest AMD pcnet patch (made by Antony T Curtis) with qemu
> > 0.7 because I was tired of the sloooww PXE booting of my QEMU. For
> > exemple, to load a linux kernel + initrd over TFTP, it takes 4m30s with a
> > ne2000, and 1m35s with the PCNET card.
>
> Does anyone know why pcnet is so much faster than ne2000? is it easier
> to emulate? or is there room for improvements on the ne2000?

Probably because it's a DMA capable controller. IIRC the ne2k is pio based, so 
has to shuffle the data through an IO port one byte at a time.

Paul

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-21 13:19   ` Paul Brook
@ 2005-07-21 13:49     ` Christian MICHON
  2005-07-21 19:10       ` Antony T Curtis
  2005-07-21 21:14     ` Fabrice Bellard
  1 sibling, 1 reply; 19+ messages in thread
From: Christian MICHON @ 2005-07-21 13:49 UTC (permalink / raw)
  To: qemu-devel

I tried using pxe (at least the probe) to get more diagnostics
regarding this pcnet failure.

Based on the windows host patches I posted earlier on, I get
this message:

=============================================
Probing pci nic...
[lancepci]pcnet32.c: Found lancepci, Vendor=0x1022 Device=0x2000
lancepci: 52:54:00:12:34:56 at ioaddr C020, No MII tranceiver found!
=============================================

This apparently tells the hw emulation is incomplete. When using
realtek, I do not get this tranceiver message.

If I try to boot win95 guest with "-nic-pcnet -nics 2", I finally get an IP
thru the DHCP, but the network does not work.

The patch needs badly some update/improvement on the windows side.
Any specialist around? I'm puzzled, not being an expert in this field.

Christian

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-20 12:48   ` Christian MICHON
@ 2005-07-21 15:32     ` Ludovic Drolez
  0 siblings, 0 replies; 19+ messages in thread
From: Ludovic Drolez @ 2005-07-21 15:32 UTC (permalink / raw)
  To: Christian MICHON, qemu-devel

Christian MICHON wrote:
> =============================================
> Probing pci nic...
> [lancepci]pcnet32.c: Found lancepci, Vendor=0x1022 Device=0x2000
> lancepci: 52:54:00:12:34:56 at ioaddr C020, No MII tranceiver found!
> =============================================

Very strange... I had no problems with Etherboot's PXE and a linux host.

Why a virtual network driver works under linux and not under windows ?

-- 
Ludovic DROLEZ

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-21 11:33           ` Christian MICHON
@ 2005-07-21 16:43             ` Filip Navara
  2005-07-21 20:21               ` Filip Navara
  0 siblings, 1 reply; 19+ messages in thread
From: Filip Navara @ 2005-07-21 16:43 UTC (permalink / raw)
  To: Christian MICHON, qemu-devel

Christian MICHON wrote:

>Hi Filip,
>
>On 7/20/05, Filip Navara wrote:
>  
>
>>Hmm, I used it on Windows some time ago...
>>    
>>
>
>did it work ? I manage to update and compile the patch for qemu 0.7.0
>and windows host (see attached file). I added some #ifdef and followed
>Paul's hint of yesterday (thx Paul :) ).
>
>It compiles fine, but all my clients crash whenever the tcp/ip layer gets
>loaded. I tried on linux slaxpro.iso, win95b and win2003/sp1 eval.
>
>Any uber-hacker on windows who could get this to work, pls ?
>Thanks in advance.
>  
>
I used it with ReactOS and WinXP. I remember that except the compilation 
fixes I also had to fix the PCI subsystem id ... Anyway, the patch that 
I made at that time should be available somewhere in the qemu-devel 
archives. I'll try to find it when I get at my home computer.

- Filip

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-21 13:49     ` Christian MICHON
@ 2005-07-21 19:10       ` Antony T Curtis
  0 siblings, 0 replies; 19+ messages in thread
From: Antony T Curtis @ 2005-07-21 19:10 UTC (permalink / raw)
  To: qemu-devel, Christian MICHON

On Thu, 2005-07-21 at 15:49 +0200, Christian MICHON wrote:
> I tried using pxe (at least the probe) to get more diagnostics
> regarding this pcnet failure.
> 
> Based on the windows host patches I posted earlier on, I get
> this message:
> 
> =============================================
> Probing pci nic...
> [lancepci]pcnet32.c: Found lancepci, Vendor=0x1022 Device=0x2000
> lancepci: 52:54:00:12:34:56 at ioaddr C020, No MII tranceiver found!
> =============================================
> 
> This apparently tells the hw emulation is incomplete. When using
> realtek, I do not get this tranceiver message.
> 
> If I try to boot win95 guest with "-nic-pcnet -nics 2", I finally get an IP
> thru the DHCP, but the network does not work.
> 
> The patch needs badly some update/improvement on the windows side.
> Any specialist around? I'm puzzled, not being an expert in this field.

Early AMD PCNet controllers did not need/use a seperate MII chip. The
PCNet device as emulated is one of these earlier devices. (I can provide
pdf copy datasheet, and I have one such adaptor here in hardware)


-- 
Antony T Curtis, BSc.                   UNIX, Linux, *BSD, Networking
antony.t.curtis@ntlworld.com            C++, J2EE, Perl, MySQL, Apache
                                        IT Consultancy.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-21 16:43             ` Filip Navara
@ 2005-07-21 20:21               ` Filip Navara
  2005-07-21 20:54                 ` Christian MICHON
  0 siblings, 1 reply; 19+ messages in thread
From: Filip Navara @ 2005-07-21 20:21 UTC (permalink / raw)
  To: qemu-devel

Filip Navara wrote:

> Christian MICHON wrote:
>
>> Hi Filip,
>>
>> On 7/20/05, Filip Navara wrote:
>>  
>>
>>> Hmm, I used it on Windows some time ago...
>>>   
>>
>>
>> did it work ? I manage to update and compile the patch for qemu 0.7.0
>> and windows host (see attached file). I added some #ifdef and followed
>> Paul's hint of yesterday (thx Paul :) ).
>>
>> It compiles fine, but all my clients crash whenever the tcp/ip layer 
>> gets
>> loaded. I tried on linux slaxpro.iso, win95b and win2003/sp1 eval.
>>
>> Any uber-hacker on windows who could get this to work, pls ?
>> Thanks in advance.
>>  
>>
> I used it with ReactOS and WinXP. I remember that except the 
> compilation fixes I also had to fix the PCI subsystem id ... Anyway, 
> the patch that I made at that time should be available somewhere in 
> the qemu-devel archives. I'll try to find it when I get at my home 
> computer.

Ok, I lost the compilation patch ... but the other one is here: 
www.volny.cz/xnavara/pcnet.c.diff

- Filip

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-21 20:21               ` Filip Navara
@ 2005-07-21 20:54                 ` Christian MICHON
  0 siblings, 0 replies; 19+ messages in thread
From: Christian MICHON @ 2005-07-21 20:54 UTC (permalink / raw)
  To: qemu-devel

On 7/21/05, Filip Navara wrote:
> Ok, I lost the compilation patch ... but the other one is here:
> www.volny.cz/xnavara/pcnet.c.diff
> 

the qemu instance still crashes. I'm using plain
http://ftp.sh.cvut.cz/MIRRORS/slax/SLAX-5.0.x/special-editions/slax-frodo-5.0.6.iso
for testing.

As soon as hotplug and RPC starts, the qemu dies. First time I
see such a crash in a *long* time, but I guess it's my fault too :)

-- 
Christian

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [Qemu-devel] Can you commit the pcnet patch ?
  2005-07-21 13:19   ` Paul Brook
  2005-07-21 13:49     ` Christian MICHON
@ 2005-07-21 21:14     ` Fabrice Bellard
  1 sibling, 0 replies; 19+ messages in thread
From: Fabrice Bellard @ 2005-07-21 21:14 UTC (permalink / raw)
  To: qemu-devel

Paul Brook wrote:
> On Thursday 21 July 2005 08:29, Lars Munch wrote:
> 
>>On Wed, Jul 20, 2005 at 12:32:10PM +0200, Ludovic Drolez wrote:
>>
>>>Hi !
>>>
>>>I've tried the latest AMD pcnet patch (made by Antony T Curtis) with qemu
>>>0.7 because I was tired of the sloooww PXE booting of my QEMU. For
>>>exemple, to load a linux kernel + initrd over TFTP, it takes 4m30s with a
>>>ne2000, and 1m35s with the PCNET card.
>>
>>Does anyone know why pcnet is so much faster than ne2000? is it easier
>>to emulate? or is there room for improvements on the ne2000?
> 
> 
> Probably because it's a DMA capable controller. IIRC the ne2k is pio based, so 
> has to shuffle the data through an IO port one byte at a time.

I don't think that the switch to DMA can explain a factor of 3. Another 
possibility is that there is a bug in the ne2000 code. It could be 
interesting to check the send and receive latencies by adding traces in 
the ne2000 code...

Fabrice.

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2005-07-21 21:25 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-20 10:32 [Qemu-devel] Can you commit the pcnet patch ? Ludovic Drolez
2005-07-20 12:37 ` Paul Brook
2005-07-20 12:48   ` Christian MICHON
2005-07-21 15:32     ` Ludovic Drolez
2005-07-20 12:56   ` Ludovic Drolez
2005-07-20 14:26     ` Christian MICHON
2005-07-20 14:45       ` Christian MICHON
2005-07-20 15:19         ` Christian MICHON
2005-07-20 15:29           ` Paul Brook
2005-07-20 15:37         ` Filip Navara
2005-07-21 11:33           ` Christian MICHON
2005-07-21 16:43             ` Filip Navara
2005-07-21 20:21               ` Filip Navara
2005-07-21 20:54                 ` Christian MICHON
2005-07-21  7:29 ` Lars Munch
2005-07-21 13:19   ` Paul Brook
2005-07-21 13:49     ` Christian MICHON
2005-07-21 19:10       ` Antony T Curtis
2005-07-21 21:14     ` Fabrice Bellard

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).