Support for multiple ethernet ports

Thomas Doerfler Thomas.Doerfler at imd-systems.de
Thu Jan 3 15:27:39 UTC 2002


Hi Alex,

things sound rather strange. I am working with rtems-4.5.0 in 
the application I mentioned, so here we are in sync.

It seems you have already gone quite deep into the related 
code. Do you have the capabilities to trace through the 
network stack? I don't know if MIPS has some sort of 
background debug facility or so...

Another way to get more info about the problem is to list the 
interface table and routing info after your initialization. 
This is done with the functions:

    rtems_bsdnet_show_if_stats();
    rtems_bsdnet_show_inet_routes();
    rtems_bsdnet_show_mbuf_stats();

and try also:

    rtems_bsdnet_show_icmp_stats();
    rtems_bsdnet_show_ip_stats();
    rtems_bsdnet_show_tcp_stats();
    rtems_bsdnet_show_udp_stats();

By the way: does your system accept to add the local loopback 
interface instead of your second ethernet device? I have 
installed it in the following way:

/*
 * Loopback network interface
 */
int rtems_bsdnet_loopattach(struct rtems_bsdnet_ifconfig *);
static struct rtems_bsdnet_ifconfig loopdriver_config = {
	"lo0",       /* name */
	rtems_bsdnet_loopattach,  /* attach function */
	NULL,	       /* link to next interface */
	"127.0.0.1", /* IP address */
	"255.0.0.0", /* IP net mask */
	NULL,        /* Driver supplies hardware address */
	0            /* Use default driver parameters */
};

/*
 * Default network interface
 */
static struct rtems_bsdnet_ifconfig netdriver_config = {
	RTEMS_BSP_NETWORK_DRIVER_NAME, /* name */
	RTEMS_BSP_NETWORK_DRIVER_ATTACH, /* attach function */
	&loopdriver_config, /* link to next interface */
	NULL,	          /* BOOTP supplies IP address */
	NULL,	          /* BOOTP supplies IP net mask */
	NULL,           /* Driver supplies hw addr*/
 	0               /* Use default driver parameters */
};

Would be interesting of the local interface is rejected 
aswell...

Bye,
	Thomas.

> On Wed, 2 Jan 2002, suvrat gupta wrote:
> 
> > Hi,
> > I am using RTEMS with 2 Ethernet interfaces. Thomas is right, you need
> > to modify your driver to support multiple interfaces. The driver that
> > comes with RTEMS doesn't do that.
> > thanks
> > -suvrat
> 
> When I developed the driver for the dp83815, I implemented it to handle
> multiple Ethernet devices.  Each device has a unique name: eth0, eth1 and
> eth2.
> 
> When I configure the network table to use two ports (eth1 and eth2 for
> example), the driver_attach() gets called twice once for eth1 and
> once for eth2.  I use the device number, 1 and 2 in this case, as an index
> into my version of the softc structure.
> 
> After the driver_attach() for the second device is called,
> driver_ioctl() is called three times for the first device, eth1.  The
> first and third invocations of driver_ioctl() call driver_init() for
> eth1.  driver_init() is design to be called multiple times without causing
> any problems.
> 
> Then driver_ioctl() get called three times for the second device, eth2.
> After the third call to driver_ioctl(), the error message indicated in my
> first e-mail is generated, see below.
> 
> Since the error is not generated by the driver code but by RTEMS code, I
> do not think it is a problem with the device driver, but I could be wrong.
> 
> If the RTEMS application ignores the error, I can receive ping traffic on
> both ports, but RTEMS sends the majority of the ping return messages out
> the first port initialized and only sends a single message out of the
> second port initialized.
> 
> What version of RTEMS are you using?
> 
> Alex
> 
> 
> >
> > Thomas Doerfler wrote:
> > >
> > > Hi,
> > >
> > > since nobody answered up to now, I will try to add my 2 cents
> > > of knowledge here...
> > >
> > > >
> > > >
> > > > It appears from reading the RTEMS network supplement that RTEMS can
> > > > supports multiple Ethernet ports.  For my application, I would like to
> > > > configure RTEMS to support 3 Ethernet ports.
> > >
> > > I have an application running with one ethernet port
> > > (MC68360), one local loopback interface, and one PPP
> > > interface, so from the protocol stack point of view this must
> > > be quite similar. RTEMS should definitely support multiple
> > > networking interfaces.
> > >
> > > The only difference to your application is, that you have a
> > > different device and possibly multiple devices of the same
> > > type. How do you distinguish the network interfaces on driver
> > > level? Maybe some part of the software doesn't work properly
> > > with an identical major number or so?
> > >
> > > >
> > > > I have successfully configured RTEMS to use a single Ethernet port.  When
> > > > I configure RTEMS to use two ports, part way through the initialization of
> > > > the second port I get the following error:
> > > >
> > > >     Can't set eth2 address: File exists
> > > >
> > > > This error message is in rtems_glue.c at approximately line 828.  The call
> > > > to ioctl (s, SIOCSIFADDR, &ifreq) returns with a failure.
> > > >
> > > > Since RTEMS seems to support multiple Ethernet port, I am assuming that I
> > > > have not correctly configured the building of RTEMS.  How do I configure
> > > > RTEMS to support 3 Ethernet ports?
> > >
> > > I don't think this is a building problem, possibly you should
> > > look for a problem in the code involved. I had a look into the
> > > "gen68360" networking driver, it does not distinguish between
> > > multiple devices, although the hardware would be capable to
> > > supply multiple ethernet interface. The same is true for the
> > > entries in the "netdriver_config" table. So have you created
> > > your own mechanism to distinguish multiple devices on
> > > driver/configuration level? Maybe you got a problem there?
> > >
> > > Bye,
> > >         Thomas.
> > >
> > > >
> > > >
> > > > TIA
> > > > Alex
> > > >
> > > > --
> > > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > > > Alex Holeczy (alex at wmi.com)
> > > >
> > > > Communication Automation Corporation (CAC)      www.cacdsp.com www.wmi.com
> > > > 1180 McDermott Drive, West Chester, PA  19380
> > > >
> > > > 800-367-6735 Ext. 122 or 610-692-9526 Ext. 122 (Voice)
> > > > 610-436-8258 (Fax)
> > > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > >
> > > --------------------------------------------
> > > IMD Ingenieurbuero fuer Microcomputertechnik
> > > Thomas Doerfler           Herbststrasse 8
> > > D-82178 Puchheim          Germany
> > > email:    Thomas.Doerfler at imd-systems.de
> > > PGP public key available at: http://www.imd-
> > > systems.de/pgp_key.htm
> >
> 
> -- 
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> Alex Holeczy (alex at wmi.com)
> 
> Communication Automation Corporation (CAC)      www.cacdsp.com www.wmi.com
> 1180 McDermott Drive, West Chester, PA  19380
> 
> 800-367-6735 Ext. 122 or 610-692-9526 Ext. 122 (Voice)
> 610-436-8258 (Fax)
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

--------------------------------------------
IMD Ingenieurbuero fuer Microcomputertechnik
Thomas Doerfler           Herbststrasse 8
D-82178 Puchheim          Germany
email:    Thomas.Doerfler at imd-systems.de
PGP public key available at: http://www.imd-
systems.de/pgp_key.htm




More information about the users mailing list