Hi Sylvian,

The detailed implementation of PPP function is actually provided by our
supplier, I am not saying you did it buggy. Sorry for this
misunderstanding. Actually I am referring to our supplier, they ported
the LWIP, I am using it but I found something not quite right in it.

Best,
Jackie


On 01/22/15 22:48, Sylvain Rochet wrote:
> Hello Jackie,
>
>
> On Thu, Jan 22, 2015 at 10:36:17PM +0800, Jackie wrote:
>> Hi Simon & Sylvain,
>>
>> After re-examining the code, finally I got more understanding of what
>> can cause this problem. Instead of more than one threads are calling
>> tcp_output(), there is only one thread tcpip_thread(), but in which
>> tcp_output() is called recursively.
>>
>> The case happens when the lower-layer protocol (PPP) uses
>> sys_sem_wait(). In this function, it is not only waiting a semaphore,
>> but it also gives the timer chances to run. As long as it times out, the
>> tcp timer will be called, and in the timer, tcp_output() will be called
>> again, like,
>>
>> tcpip_thread()
>> {
>>     ...
>>     tcp_input()
>>     {
>>         ...
>>         tcp_output()
>>         {
>>             ...
>>             pppifOutput()
>>             {
>>                 ...
>>                 sys_sem_wait();  // Here the tcp_slowtmr() has a chance
>> to run again and tcp_output() may be called again in it.
> Which PPP function is actually calling sys_sem_wait() ?
>
>
>> @Sylvain,
>> You are right, this PPP protocol implementation is from a third party,
> Well, the "third party" for master is actually me.
>
>
>> so that I am not allowed to modify it so much.
> Of course you are, not fixing a bug because the software is third party 
> does not make sense, not at all.
>
>
>> But I think this design is quite buggy, and the worst case is 
>> tcp_output() can be called recursively several times.
> Yes, it looks buggy :)
>
>
> Sylvain
>
>
> _______________________________________________
> lwip-users mailing list
> [email protected]
> https://lists.nongnu.org/mailman/listinfo/lwip-users

_______________________________________________
lwip-users mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to