[Top][All Lists]

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

Re: [lwip-users] Understanding retransmission

From: Jan Menzel
Subject: Re: [lwip-users] Understanding retransmission
Date: Mon, 16 Feb 2015 11:28:22 +0100
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

Hi All!
        Sorry, I've to open this thread again as the topic is still hot for me.
        At the weekend I remembered that I read a few times already that most
problems are related to user code and hardware driver. So I recapped my
code and found a possible source for the problem. I'll try to explain
may flow and would like to ask you for your comments:
        I'm using a LPC1768 with a driver supplied by NXP. The driver uses
zero-copy and two threads one to handle reception and one for
transmission. For out-going packets, the drivers registers a
"linkoutput" function in the netif structure. Insight this function, the
supplied pbuf is - guarded by a mutex - referenced (pbuf_ref()), stored
in a queue and prepared for transmission. On transmission complete
interrupt, the transmission clean-up task is woken which - again mutex
guarded - read the pbuf from the queue and frees it using pbuf_free(). I
assume, that netif->linkoutput is called from LwIPs main tcpip_thread()
context, so calling pbuf_ref() shall be safe. What about the pbuf_free()
in the clean-up task, is it safe to be called directly? Studding the
pbuf-code I did not found a mutexes or other guarding, so I assume no.
What would be the correct way to handle this?


On 21.01.2015 21:54, address@hidden wrote:
> Jan Menzel wrote:
>> Maybe I did not enabled all options as I have not seen
>> the ASSERT() message.
>> [..]
>> Today I discovered some more interesting points about the TCP checksum
>> problem: the content of the packet sometimes changes with each
>> retransmission. The first as lost of zeros at the end. The later one
>> less zeros and - unfortunately not in the capture I send you - I've seen
>> retransmissions without zeros and correct checksum. This is something I
>> don't understand at all:
>> a) If there is any memory problem, I would assume, that the packet
>> content gets worth every retransmission.
>> b) If there is any DMA problem (pbuf is send to EMAC using DMA on
>> LPC1768) I would assume some DMA errors but not all zero content.
>>     Do you have any idea whats going on there?
> Reading all this makes me think more of a port issue, not of a generic
> lwIP issue. If it was an lwIP-checksum-on-copy issue, the packet
> contents would not change between retransmissions.
> I'm afraid I don't have an idea of what to check right now, as I don't
> know your hardware.
> Simon
> _______________________________________________
> lwip-users mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/lwip-users

reply via email to

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