[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [lwip-users] Problem running lwip on cortex M7 with D cache enabled
From: |
Jan Menzel |
Subject: |
Re: [lwip-users] Problem running lwip on cortex M7 with D cache enabled |
Date: |
Fri, 1 Dec 2017 10:35:37 +0100 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 30.11.2017 15:58, goldsimon wrote:
>
>
> Jan Menzel wrote:
>> I'd suggest to align (position and size) all receive
>> buffers to d-cache lines so that invalidation does not cause any side
>> effects.
>
> And it's exactly this that lwip does not fully support yet. It doesn't work
> for the tx side at all and for the rx side, we only have the workaraound with
> custom pbufs (see the link Dirk posted).
>
For TX there is nothing really needed on the LWIP side. Draining the
d-cache is always possible without side effects. Its just a question of
efficiently if a packet content does not start at a cache line.
For RX the Ethernet data part has to be aligned to cache line to void
issues due to cache invalidation.
In my implementations I use pooled memory. From the lwip code I can
see, that LWIP_MEM_ALIGN_SIZE() is used to add padding between
management data and actual free space. If this Macro is used to force
cache-line alignment, it would be already possible to use zero-copy RX
with cache. I can't see if custom pools are padded using the same macro,
but selecting an aligned size is not that difficult.
(yes, the driver developer would have to add a few asserts to assure
the buffer used for rx is ready d-cache aligned)
Jan
- Re: [lwip-users] Problem running lwip on cortex M7 with D cache enabled,
Jan Menzel <=
Re: [lwip-users] Problem running lwip on cortex M7 with D cache enabled, Simon Goldschmidt, 2017/12/01