lwip-users
[Top][All Lists]
Advanced

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

Re: [lwip-users] LWIP Raw API receive issue


From: Sergio R. Caprile
Subject: Re: [lwip-users] LWIP Raw API receive issue
Date: Fri, 12 Jan 2018 18:49:57 -0300
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Thunderbird/52.5.2

>> You are _SENDING_ 512 but you are receiving "upto" 200, what does that mean ???
> That means p->tot_len is 512 or the exact no of bytes I have
> transmitted.

When receiving an Ethernet frame, the driver allocs from a memory pool (PBUF_POOL) and it might be a chain of blocks of memory When sending via TCP, it allocs from a different memory pool (unless you instruct to not copy and reference the source, it will alloc from PBUF_RAM) and although this might change in the future, it is a contiguous block of memory.
And you don't handle pbufs when sending via TCP, which you do on reception.

>>They might be chained, you can't memcpy(somewhere, p, p->tot_len), you
>>need to go pbuf by pbuf copying p->len and checking p->next until you
>>extract tot_len bytes; or just use the pbuf handling functions like
>>pbuf_copy_partial()
> This could be the reason, I need to check this. As I'm on vacation
> I'll check and follow up with this thread on Wednesday.

I think so.
Enjoy!

>>Unless you have DMA which you did not say
> Yes DMA is used. I'm using SAMA5D35 processor. I have created buffers
> and the locations of the buffer is stored in buffer descriptor and the
> location of that descriptor is stored in the DMA Queue pointer.

OK, I can't help in here, make sure your DMA controller does not interfere with lwIP and you don't have concurrency issues.
If this is zero-copy, you'd better double check.



reply via email to

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