Discussion:
ne2k_isa: how to specify a custom iobase and irq?
Sebastian Herbszt
2009-12-17 21:29:49 UTC
Permalink
The default iobase and irq for the ne2k_isa card are 0x300 and 9.
It should be possible to override both using the "-net" syntax like
"-net nic,model=ne2k_isa,irq=5,iobase=0x280".

- Sebastian
Markus Armbruster
2009-12-18 06:12:55 UTC
Permalink
Post by Sebastian Herbszt
The default iobase and irq for the ne2k_isa card are 0x300 and 9.
It should be possible to override both using the "-net" syntax like
"-net nic,model=ne2k_isa,irq=5,iobase=0x280".
-device ne2k_isa,irq=5,iobase=0x280
Gerd Hoffmann
2009-12-18 08:37:38 UTC
Permalink
Post by Markus Armbruster
Post by Sebastian Herbszt
The default iobase and irq for the ne2k_isa card are 0x300 and 9.
It should be possible to override both using the "-net" syntax like
"-net nic,model=ne2k_isa,irq=5,iobase=0x280".
-device ne2k_isa,irq=5,iobase=0x280
Also needs vlan=0, otherwise you'll end up with an unconnected nic.

cheers,
Gerd
Sebastian Herbszt
2009-12-18 20:00:52 UTC
Permalink
Post by Gerd Hoffmann
Post by Markus Armbruster
Post by Sebastian Herbszt
The default iobase and irq for the ne2k_isa card are 0x300 and 9.
It should be possible to override both using the "-net" syntax like
"-net nic,model=ne2k_isa,irq=5,iobase=0x280".
-device ne2k_isa,irq=5,iobase=0x280
Also needs vlan=0, otherwise you'll end up with an unconnected nic.
Shouldn't vlan have a default value of 0 like it does with the "-net" syntax?

- Sebastian
Anthony Liguori
2009-12-18 20:54:12 UTC
Permalink
Post by Sebastian Herbszt
Post by Gerd Hoffmann
Post by Markus Armbruster
Post by Sebastian Herbszt
The default iobase and irq for the ne2k_isa card are 0x300 and 9.
It should be possible to override both using the "-net" syntax like
"-net nic,model=ne2k_isa,irq=5,iobase=0x280".
-device ne2k_isa,irq=5,iobase=0x280
Also needs vlan=0, otherwise you'll end up with an unconnected nic.
Shouldn't vlan have a default value of 0 like it does with the "-net" syntax?
No, you don't actually have to tie it to a vlan.

Regards,

Anthony Liguori
Sebastian Herbszt
2009-12-18 21:43:17 UTC
Permalink
Post by Anthony Liguori
Post by Sebastian Herbszt
Post by Gerd Hoffmann
Post by Markus Armbruster
Post by Sebastian Herbszt
The default iobase and irq for the ne2k_isa card are 0x300 and 9.
It should be possible to override both using the "-net" syntax like
"-net nic,model=ne2k_isa,irq=5,iobase=0x280".
-device ne2k_isa,irq=5,iobase=0x280
Also needs vlan=0, otherwise you'll end up with an unconnected nic.
Shouldn't vlan have a default value of 0 like it does with the "-net" syntax?
No, you don't actually have to tie it to a vlan.
Actually you have to else networking doesn't work at all. Without specifying
"vlan" with the "-device" syntax you end up with vlan=<null> and not vlan=0
with "info qtree".

- Sebastian
Anthony Liguori
2009-12-18 23:23:44 UTC
Permalink
Post by Sebastian Herbszt
Actually you have to else networking doesn't work at all. Without specifying
"vlan" with the "-device" syntax you end up with vlan=<null> and not vlan=0
with "info qtree".
-netdev type=tap,id=mynic -device ne2k_isa,irq=5,iobase=0x280,id=mynic

One of the changes in 0.12 allows for a network configuration that does
not have the builtin hub (aka vlans). This is really important for a
number of reasons. The main is that it allows for much more aggressive
optimization without having to teach the vlan code how to deal with
things like software GSO.

That might look awkward, but that's because it's designed to be used
from a config file. The config entry for that is:

[device "mynic"]
driver = "ne2k_isa"
irq = "5"
iobase = "0x280"

[netdev "mynic"]
type = "tap"

Which looks pretty nice IMHO.

Regards,

Anthony Liguori
Sebastian Herbszt
2009-12-18 19:58:10 UTC
Permalink
Post by Markus Armbruster
Post by Sebastian Herbszt
The default iobase and irq for the ne2k_isa card are 0x300 and 9.
It should be possible to override both using the "-net" syntax like
"-net nic,model=ne2k_isa,irq=5,iobase=0x280".
-device ne2k_isa,irq=5,iobase=0x280
Shouldn't this also be possible with the "-net" syntax? It does accept "addr"
which is pci specific.

- Sebastian
Anthony Liguori
2009-12-18 20:56:17 UTC
Permalink
This post might be inappropriate. Click to display it.
Sebastian Herbszt
2009-12-18 20:24:15 UTC
Permalink
Post by Markus Armbruster
Post by Sebastian Herbszt
The default iobase and irq for the ne2k_isa card are 0x300 and 9.
It should be possible to override both using the "-net" syntax like
"-net nic,model=ne2k_isa,irq=5,iobase=0x280".
-device ne2k_isa,irq=5,iobase=0x280
If i specify "-net nic,model=pcnet" i end up only with a pcnet nic. With
the above syntax i get a e1000 and a ne2k_isa. It also loads the e1000 rom.

- Sebastian
Anthony Liguori
2009-12-18 20:56:54 UTC
Permalink
Post by Sebastian Herbszt
Post by Markus Armbruster
Post by Sebastian Herbszt
The default iobase and irq for the ne2k_isa card are 0x300 and 9.
It should be possible to override both using the "-net" syntax like
"-net nic,model=ne2k_isa,irq=5,iobase=0x280".
-device ne2k_isa,irq=5,iobase=0x280
If i specify "-net nic,model=pcnet" i end up only with a pcnet nic. With
the above syntax i get a e1000 and a ne2k_isa. It also loads the e1000 rom.
Can you supply the full command lines. I'm a little confused about what
you're reporting.

Regards,

Anthony Liguori
Sebastian Herbszt
2009-12-18 21:16:34 UTC
Permalink
Post by Anthony Liguori
Post by Sebastian Herbszt
Post by Markus Armbruster
Post by Sebastian Herbszt
The default iobase and irq for the ne2k_isa card are 0x300 and 9.
It should be possible to override both using the "-net" syntax like
"-net nic,model=ne2k_isa,irq=5,iobase=0x280".
-device ne2k_isa,irq=5,iobase=0x280
If i specify "-net nic,model=pcnet" i end up only with a pcnet nic. With
the above syntax i get a e1000 and a ne2k_isa. It also loads the e1000 rom.
Can you supply the full command lines. I'm a little confused about what
you're reporting.
"qemu -device ne2k_isa,irq=10" and "info qtree" has e1000 and ne2k_isa.
"qemu -net nic,model=pcnet" and "info qtree" has only pcnet.

Maybe because of hw/pc.c:

if (!pci_enabled || (nd->model && strcmp(nd->model, "ne2k_isa") == 0))
pc_init_ne2k_isa(nd);
else
pci_nic_init_nofail(nd, "e1000", NULL);

- Sebastian
Markus Armbruster
2009-12-21 12:37:42 UTC
Permalink
Post by Sebastian Herbszt
Post by Anthony Liguori
Post by Sebastian Herbszt
Post by Markus Armbruster
Post by Sebastian Herbszt
The default iobase and irq for the ne2k_isa card are 0x300 and 9.
It should be possible to override both using the "-net" syntax like
"-net nic,model=ne2k_isa,irq=5,iobase=0x280".
-device ne2k_isa,irq=5,iobase=0x280
If i specify "-net nic,model=pcnet" i end up only with a pcnet nic. With
the above syntax i get a e1000 and a ne2k_isa. It also loads the e1000 rom.
Can you supply the full command lines. I'm a little confused about
what you're reporting.
"qemu -device ne2k_isa,irq=10" and "info qtree" has e1000 and ne2k_isa.
"qemu -net nic,model=pcnet" and "info qtree" has only pcnet.
Unlike -net nic, -device doesn't suppress the default NIC. Unfortunate.
You can get rid of it with -nodefaults, but that also rids you of other
default devices.

[...]

Loading...