[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [lwip-users] tcp_write() errors on snd_queuelen
From: |
Tim Lambrix |
Subject: |
RE: [lwip-users] tcp_write() errors on snd_queuelen |
Date: |
Wed, 16 Mar 2011 15:56:17 +0000 |
Andrew,
Thanks for your help too. I will take all I can get right now. It looks like
SYS_ARCH_PROTECT is defined as follows and it does hit this line of code (only
from the interrupt itself however):
sys_prot_t
sys_arch_protect(void)
{
return((sys_prot_t)MAP_IntMasterDisable());
}
I think this is correct? However, the stellarisif_transmit function you
mention is called in three places and only one of them has the SYS_ARCH_PROTECT
called before it. I don't see the calls in the interrupt itself
stellarisif_interrupt.
Maybe I am missing something here but the problem I seem to have is the
Ethernet interrupt goes off while I am in the tcp_write->tcp_enqueue function
and changes the values of pcb->snd_queuelen. I have modified the local variable
in that function queuelen to not use the value read at line 195 from:
queuelen = pcb->snd_queuelen; to
queuelen = 0;
and line 411 from:
pcb->snd_queuelen = queuelen; to
pcb->snd_queuelen += queuelen;
This fixes the issue but I welcome your insight on why it should not happen in
the first place. I don't see any calls close to SYS_ARCH_PROTECT in the
tcp_write function to prevent the interrupt from going off. I also tried
disabling the Ethernet ISR for both ETH_INT_RX and ETH_INT_TX (the only two
enabled) before calling tcp_write and enabling both after the call. That also
works to prevent the corruption of pcb-> snd_queuelen.
>From what I have traced in code, the protection prevents the interrupt from
>going off again while in the interrupt. I have been trying to find where lwIP
>gets processed outside of the interrupts if the interrupt is not suppose to
>mess with the pbufs. It looks to me like they can.
My original post of findings is here:
http://lists.nongnu.org/archive/html/lwip-users/2011-03/msg00069.html
Tim
-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Andrew Foster
Sent: Wednesday, March 16, 2011 11:17 AM
To: Mailing list for lwIP users
Subject: Re: [lwip-users] tcp_write() errors on snd_queuelen
Tim,
Sorry for jumping in on this late in the thread. I've used the TI
Port(1.3.2) a couple of times on different projects. Typically, I've
used it in conjunction with FreeRTOS. One thing to be mindful of is
making sure you have SYS_ARCH_PROTECT defined correctly.
stellarisif_output and stellarisif_transmit must be ran in critical
sections with both the PBUF structure and the ETH TX FIFO protected.
Otherwise, the stellarisif_interrupt can come in and modify the PBUF chain.
Again, I apologize if I'm stating the obvious here or things you've
already ruled out. I wasn't able to find the original post.
Andrew
_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users
- [lwip-users] tcp_write() errors on snd_queuelen, Tim Lambrix, 2011/03/11
- Re: [lwip-users] tcp_write() errors on snd_queuelen, Kieran Mansley, 2011/03/14
- RE: [lwip-users] tcp_write() errors on snd_queuelen, Tim Lambrix, 2011/03/14
- RE: [lwip-users] tcp_write() errors on snd_queuelen, Kieran Mansley, 2011/03/14
- RE: [lwip-users] tcp_write() errors on snd_queuelen, Tim Lambrix, 2011/03/16
- Re: [lwip-users] Lwip timer ISR priority, Simon Goldschmidt, 2011/03/16
- Re: [lwip-users] Lwip timer ISR priority, Andrea Merello, 2011/03/18
- Re: [lwip-users] Lwip timer ISR priority, Kieran Mansley, 2011/03/18
- Re: RE: [lwip-users] tcp_write() errors on snd_queuelen, Simon Goldschmidt, 2011/03/16
- Re: [lwip-users] tcp_write() errors on snd_queuelen, Andrew Foster, 2011/03/16
- RE: [lwip-users] tcp_write() errors on snd_queuelen,
Tim Lambrix <=
- Re: [lwip-users] tcp_write() errors on snd_queuelen, Andrew Foster, 2011/03/16
- RE: [lwip-users] tcp_write() errors on snd_queuelen, Tim Lambrix, 2011/03/16
- Re: [lwip-users] tcp_write() errors on snd_queuelen, Simon Goldschmidt, 2011/03/16
- RE: [lwip-users] tcp_write() errors on snd_queuelen, Tim Lambrix, 2011/03/16
- RE: [lwip-users] tcp_write() errors on snd_queuelen, Kieran Mansley, 2011/03/17
- Re: [lwip-users] tcp_write() errors on snd_queuelen, Simon Goldschmidt, 2011/03/17
- Re: [lwip-users] tcp_write() errors on snd_queuelen, Kieran Mansley, 2011/03/17
- RE: [lwip-users] tcp_write() errors on snd_queuelen, Tim Lambrix, 2011/03/17
- RE: [lwip-users] tcp_write() errors on snd_queuelen, Kieran Mansley, 2011/03/17
- RE: [lwip-users] tcp_write() errors on snd_queuelen, Simon Goldschmidt, 2011/03/16