Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Setting up NIC driver instances with different options: (10 Items)
   
Setting up NIC driver instances with different options  
Hi all, 

with io-net I did something like this 

io-net -dmp85xx mac=00E00C0000FD,pci=0,<more options> -ptcpip-v4
waitfor /dev/socket
waitfor /dev/io-net/en0
mount -Tio-net -o mac=00E00C0000FE,pci=1,<more options> /lib/dll/devn-mpc85xx.so

to be able to setup driver instances with different options from the command line. 

Is that possible to do that with io-pkt, i.e. is the mount type available again ? 

Alternatively - actually I would prefer that method - can someone please point me to documentation or example code or 
structure definitions or ...  for setting up NIC driver options in the system page before starting io-pkt. I'm 
specifically interested in setting up two instances of devnp-mpc85xx.so. 

Thanks, 
Christopher
RE: Setting up NIC driver instances with different options  
Hi Christopher:

	As long as the options are supported by the driver, the mount
command should work the same as it did with io-net.

In terms of setting things up in the system page, it's pretty easy.  If
you have the source code for the BSP, you can find it in init_hwinfo.c.


There's a function:

add_one_tsec(unsigned off, 
		unsigned intr_tx, 
		unsigned int intr_rx, 
		unsigned int intr_err,
		unsigned char *mac,
		unsigned char phy_addr)

which is pretty much self-explanatory :>.  The driver will examine the
system page when you pass it the "syspage" option.

	Robert.

-----Original Message-----
From: Christopher Pohl [mailto:christopher.pohl@etas.com] 
Sent: Monday, July 14, 2008 11:06 AM
To: ionetmig-networking
Subject: Setting up NIC driver instances with different options

Hi all, 

with io-net I did something like this 

io-net -dmp85xx mac=00E00C0000FD,pci=0,<more options> -ptcpip-v4
waitfor /dev/socket
waitfor /dev/io-net/en0
mount -Tio-net -o mac=00E00C0000FE,pci=1,<more options>
/lib/dll/devn-mpc85xx.so

to be able to setup driver instances with different options from the
command line. 

Is that possible to do that with io-pkt, i.e. is the mount type
available again ? 

Alternatively - actually I would prefer that method - can someone please
point me to documentation or example code or structure definitions or
...  for setting up NIC driver options in the system page before
starting io-pkt. I'm specifically interested in setting up two instances
of devnp-mpc85xx.so. 

Thanks, 
Christopher

_______________________________________________
io-net migration
http://community.qnx.com/sf/go/post10472
Re: RE: Setting up NIC driver instances with different options  
Hi Robert, 

thanks for the quick reply. Mounting a second driver instance works (almost) as a charm. 

The default stack size of 4096 seems to be too small for doing : 

# io-pkt-v4-hc -dmpc85xx mac=006034016A74,pci=0 -ptcpip 
(waitfor /dev/socket)
# mount -Tio-pkt -o mac=006034016A75,pci=1 /lib/dll/devnp-mpc85xx.so

io-pkt-v4-hc sig aborts in that case, so I increased it to 8192 using 

# io-pkt-v4-hc -dmpc85xx mac=006034016A74,pci=0 -ptcpip stackisze=8192

Christopher. 
Re: RE: Setting up NIC driver instances with different options  
There is one other small problem with the way devnp-mpc85xx.so parses its command line options: 

Doing 

# io-pkt-v4-hc -dmpc85xx mac=006034016A74,pci=0 -ptcpip 
(waitfor /dev/socket)
# mount -Tio-pkt -o mac=006034016A75,pci=1 /lib/dll/devnp-mpc85xx.so

yields a different MAC (+1) than expected on tsec1: 

# ifconfig tsec1
tsec1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1500
        capabilities rx=7<IP4CSUM,TCP4CSUM,UDP4CSUM>
        capabilities tx=0
        enabled=0
        address: 00:60:34:01:6a:76
        media: Ethernet none

That seems to be caused by detect.c lines 447-449

    if ((tparms_p == NULL) || (!tparms_p->mac_present)) {
        cfg->current_address[5] += idx;
    }

The driver probably shouldn't do that if cfg->device_index != 0xFFFFFFFF, as the user gave a specific instance to init 
and specific paramters for it. 

The same is probably true for the phy=X command line parameter (lines 443-445). 

Christopher. 
RE: RE: Setting up NIC driver instances with different options  
Hi Christopher:
	You're quite right.  It's not so much the mac being present so
much as the PCI index being specified.  The MAC and PHY should increment
if you're trying to set up multiple interfaces with one driver
instantiation.  If the pci= option is there, it should use things as
specified.  I've created a PR (59664) and it'll get fixed shortly. 
	Thanks for the report!

	Robert

-----Original Message-----
From: Christopher Pohl [mailto:christopher.pohl@etas.com] 
Sent: Tuesday, July 15, 2008 4:37 AM
To: ionetmig-networking
Subject: Re: RE: Setting up NIC driver instances with different options


There is one other small problem with the way devnp-mpc85xx.so parses
its command line options: 

Doing 

# io-pkt-v4-hc -dmpc85xx mac=006034016A74,pci=0 -ptcpip 
(waitfor /dev/socket)
# mount -Tio-pkt -o mac=006034016A75,pci=1 /lib/dll/devnp-mpc85xx.so

yields a different MAC (+1) than expected on tsec1: 

# ifconfig tsec1
tsec1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu
1500
        capabilities rx=7<IP4CSUM,TCP4CSUM,UDP4CSUM>
        capabilities tx=0
        enabled=0
        address: 00:60:34:01:6a:76
        media: Ethernet none

That seems to be caused by detect.c lines 447-449

    if ((tparms_p == NULL) || (!tparms_p->mac_present)) {
        cfg->current_address[5] += idx;
    }

The driver probably shouldn't do that if cfg->device_index !=
0xFFFFFFFF, as the user gave a specific instance to init and specific
paramters for it. 

The same is probably true for the phy=X command line parameter (lines
443-445). 

Christopher. 


_______________________________________________
io-net migration
http://community.qnx.com/sf/go/post10519
RE: RE: Setting up NIC driver instances with different options  
Oops!  I see that you DID say cfg->device_index != 0xFFFFFFFF (which
means pci option was specified) and not the mac.  Too quick to answer...

	Robert.

-----Original Message-----
From: Robert Craig 
Sent: Tuesday, July 15, 2008 10:23 AM
To: 'post10519@community.qnx.com'
Subject: RE: RE: Setting up NIC driver instances with different options

Hi Christopher:
	You're quite right.  It's not so much the mac being present so
much as the PCI index being specified.  The MAC and PHY should increment
if you're trying to set up multiple interfaces with one driver
instantiation.  If the pci= option is there, it should use things as
specified.  I've created a PR (59664) and it'll get fixed shortly. 
	Thanks for the report!

	Robert

-----Original Message-----
From: Christopher Pohl [mailto:christopher.pohl@etas.com] 
Sent: Tuesday, July 15, 2008 4:37 AM
To: ionetmig-networking
Subject: Re: RE: Setting up NIC driver instances with different options


There is one other small problem with the way devnp-mpc85xx.so parses
its command line options: 

Doing 

# io-pkt-v4-hc -dmpc85xx mac=006034016A74,pci=0 -ptcpip 
(waitfor /dev/socket)
# mount -Tio-pkt -o mac=006034016A75,pci=1 /lib/dll/devnp-mpc85xx.so

yields a different MAC (+1) than expected on tsec1: 

# ifconfig tsec1
tsec1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu
1500
        capabilities rx=7<IP4CSUM,TCP4CSUM,UDP4CSUM>
        capabilities tx=0
        enabled=0
        address: 00:60:34:01:6a:76
        media: Ethernet none

That seems to be caused by detect.c lines 447-449

    if ((tparms_p == NULL) || (!tparms_p->mac_present)) {
        cfg->current_address[5] += idx;
    }

The driver probably shouldn't do that if cfg->device_index !=
0xFFFFFFFF, as the user gave a specific instance to init and specific
paramters for it. 

The same is probably true for the phy=X command line parameter (lines
443-445). 

Christopher. 


_______________________________________________
io-net migration
http://community.qnx.com/sf/go/post10519
RE: RE: Setting up NIC driver instances with different options  
This has now been fixed on trunk.

	Robert.


-----Original Message-----
From: Christopher Pohl [mailto:christopher.pohl@etas.com] 
Sent: Tuesday, July 15, 2008 4:37 AM
To: ionetmig-networking
Subject: Re: RE: Setting up NIC driver instances with different options


There is one other small problem with the way devnp-mpc85xx.so parses
its command line options: 

Doing 

# io-pkt-v4-hc -dmpc85xx mac=006034016A74,pci=0 -ptcpip 
(waitfor /dev/socket)
# mount -Tio-pkt -o mac=006034016A75,pci=1 /lib/dll/devnp-mpc85xx.so

yields a different MAC (+1) than expected on tsec1: 

# ifconfig tsec1
tsec1: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu
1500
        capabilities rx=7<IP4CSUM,TCP4CSUM,UDP4CSUM>
        capabilities tx=0
        enabled=0
        address: 00:60:34:01:6a:76
        media: Ethernet none

That seems to be caused by detect.c lines 447-449

    if ((tparms_p == NULL) || (!tparms_p->mac_present)) {
        cfg->current_address[5] += idx;
    }

The driver probably shouldn't do that if cfg->device_index !=
0xFFFFFFFF, as the user gave a specific instance to init and specific
paramters for it. 

The same is probably true for the phy=X command line parameter (lines
443-445). 

Christopher. 


_______________________________________________
io-net migration
http://community.qnx.com/sf/go/post10519
Re: RE: RE: Setting up NIC driver instances with different options  
Tested it, works. Thanks Robert. 

Christopher 
Re: RE: Setting up NIC driver instances with different options  
On Tue, Jul 15, 2008 at 03:57:07AM -0400, Christopher Pohl wrote:
> Hi Robert, 
> 
> thanks for the quick reply. Mounting a second driver instance works (almost) as a charm. 
> 
> The default stack size of 4096 seems to be too small for doing : 
> 
> # io-pkt-v4-hc -dmpc85xx mac=006034016A74,pci=0 -ptcpip 
> (waitfor /dev/socket)
> # mount -Tio-pkt -o mac=006034016A75,pci=1 /lib/dll/devnp-mpc85xx.so
> 
> io-pkt-v4-hc sig aborts in that case, so I increased it to 8192 using 
> 
> # io-pkt-v4-hc -dmpc85xx mac=006034016A74,pci=0 -ptcpip stackisze=8192

If you update your driver this should be fixed.

Thanks,

-seanb
Re: RE: Setting up NIC driver instances with different options  
> On Tue, Jul 15, 2008 at 03:57:07AM -0400, Christopher Pohl wrote:
> > Hi Robert, 
> > 
> > thanks for the quick reply. Mounting a second driver instance works (almost)
>  as a charm. 
> > 
> > The default stack size of 4096 seems to be too small for doing : 
> > 
> > # io-pkt-v4-hc -dmpc85xx mac=006034016A74,pci=0 -ptcpip 
> > (waitfor /dev/socket)
> > # mount -Tio-pkt -o mac=006034016A75,pci=1 /lib/dll/devnp-mpc85xx.so
> > 
> > io-pkt-v4-hc sig aborts in that case, so I increased it to 8192 using 
> > 
> > # io-pkt-v4-hc -dmpc85xx mac=006034016A74,pci=0 -ptcpip stackisze=8192
> 
> If you update your driver this should be fixed.
> 
> Thanks,
> 
> -seanb


Tested it, works. Thanks Sean.

Christopher