This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: RE: Trouble using lwIP (driver crash...)


With this fix, the driver doesn't crash, but it doesn't work either...

I send the ping request, the driver thinks it sends the reply, but the reply
never made to the switch. I'm using ethereal and all I see is the ICMP
request.

This is the driver debug log:


Device 0 (eth0), rx descriptor 0:
Rx 0 12e160 (status 8000a022): 1 sg's, 60 bytes
Tx 0 12e160: 1 sg's, 60 bytes, KEY 14fee0
Tx 0 12e160: Starting Engines: KEY 14fee0 TxCB 191ccc
Device 0 (eth0), rx descriptor 0:
Rx 0 12e160 (status 8000a022): 1 sg's, 60 bytes


After that, I can send ARP request and nothing will happen and the driver
will log nothing...


Michael


-----Original Message-----
From: Andrew Lunn [mailto:andrew@lunn.ch] 
Sent: April 5, 2006 10:49 AM
To: Michael Grimard
Cc: ecos-discuss@sourceware.org
Subject: Re: [ECOS] RE: Trouble using lwIP (driver crash...)

On Wed, Apr 05, 2006 at 10:34:19AM -0400, Michael Grimard wrote:
> This is the call stack of the recursion:
> 
> input_thread()
> i82559_deliver()
> PacketRxReady()
> eth_drv_recv()
> ecosif_input()
> etharp_arp_input()
> low_level_output()
> eth_drv_send()
> i82559_can_send()
> -->PacketRxReady
> eth_drv_recv()
> ecosif_input()
> ...
> 
> 
> So the recursion happens in i82559_can_send() when it calls
PacketRxReady().
> 
> This time, it was for the reply of an ARP request.

O.K.

Things are becoming clearer.

With FreeBsd and NetBSD, the stack will not generate a packet as soon as it
recevies a packet. It queues the received packet and another thread deals
with it. lwip does this differently, as you have just shown, when it
receives an arp request it will imeadiately generate an arp reply. 

As a quick, but potentially broken fix try changing

#ifndef CYGPKG_IO_ETH_DRIVERS_STAND_ALONE
    // We are not prepared to receive a packet now if we are in a polled
    // standalone configuration.
    PacketRxReady(p_i82559);
#endif

to

#if !defined(CYGPKG_IO_ETH_DRIVERS_STAND_ALONE) && !defined(CYGPKG_NET_LWIP)
    // We are not prepared to receive a packet now if we are in a polled
    // standalone configuration.
    PacketRxReady(p_i82559);
#endif

but you might find your receiver stops working because of lost interrupts,
or at least you might see big delays in receving packets.

        Andrew


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]