lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] tcp_write() errors on snd_queuelen


From: Simon Goldschmidt
Subject: Re: [lwip-users] tcp_write() errors on snd_queuelen
Date: Wed, 16 Mar 2011 18:12:51 +0100

Hi Todd,

I think there's a bug in the stellarisif.c, function stellarisif_interrupt(). 
The following code seems not correct:

>>>>> snip >>>>>
#if NO_SYS
    if(ethernet_input(p, netif)!=ERR_OK) {
#else
    if(tcpip_input(p, netif)!=ERR_OK) {
#endif
<<<<< snap <<<<<

a) In the NO_SYS==1 case, the driver *must not* call into the lwIP code from 
interrupt context (unless you can make sure that lwIP is not used from any 
other ISR context or from the main loop). This will most certainly result in 
threading problems as seen by Tim. Instead, the packet must be put on a queue 
and fed into lwIP from the main context where lwIP is used.

b) In both cases, netif->input should be used. (Although I admit that's rather 
a cosmetic issue than a bug.)


Simon



"Mullanix, Todd" <address@hidden> wrote:
> Hi Tim,
> 
> Could I get a little back-ground. I know you are using version 1.3.2 from
> TI. Is this bundled in the StellarisWare package? 
> If so, which version of StellarisWare? 
> Which chip are you using? 
> What OS are you using?
> 
> I'm currently working on porting lwIP to TI's SYS/BIOS for the LM3S9B92.
> I'm basically using the same Ethernet code as StellarisWare (revision 6852).
> I might be seeing the same type of issue that you are. Based on what
> you've seen, I'll focus my debugging in that area.
> 
> Thanks,
> Todd
> 
> P.S. I did find one issue that you might want to change in the
> src/include/lwip/tcp.h file. As noted in the file, there is a compiler bug 
> that is
> impacting the TCP_SEQ_XXX macros. There is a work-around in this file.
> Unfortunately, the work-around is not correct for some versions of the 
> compiler.
> Here is the one I'm using in tcp.h. While heavier, it is correct on
> different versions of the compiler.
> 
> /* Modified by TI to work around a compiler bug */
> #if 0
> #define TCP_SEQ_LT(a,b)     ((s32_t)((a)-(b)) < 0)
> #define TCP_SEQ_LEQ(a,b)    ((s32_t)((a)-(b)) <= 0)
> #define TCP_SEQ_GT(a,b)     ((s32_t)((a)-(b)) > 0)
> #define TCP_SEQ_GEQ(a,b)    ((s32_t)((a)-(b)) >= 0)
> #else
> /* TI replacement definitions... */
> static inline int TCP_SEQ_LT(u32_t a, u32_t b)
> {
>       volatile s32_t zero = 0;
>       return ((s32_t)(a - b) < zero);
> }
> static inline int TCP_SEQ_LEQ(u32_t a, u32_t b)
> {
>       volatile s32_t zero = 0;
>       return ((s32_t)(a - b) <= zero);
> }
> static inline int TCP_SEQ_GT(u32_t a, u32_t b)
> {
>       volatile s32_t zero = 0;
>       return ((s32_t)(a - b) > zero);
> }
> static inline int TCP_SEQ_GEQ(u32_t a, u32_t b)
> {
>       volatile s32_t zero = 0;
>       return ((s32_t)(a - b) >= zero);
> }
> #endif
> 
> 
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users

-- 
NEU: FreePhone - kostenlos mobil telefonieren und surfen!                       
Jetzt informieren: http://www.gmx.net/de/go/freephone



reply via email to

[Prev in Thread] Current Thread [Next in Thread]