it's implementation specific.

Full code is:

+               offset = pool->headroom;
+
+               /* move to correct align */
+               while (((uintptr_t)&data[offset]) % pool->align != 0)
+                       offset++;
<skip>
+
+               /* Pointer to data start (of the first segment) */
+               buf_hdr->addr[0] = &data[offset];
+               /* Store buffer into the global pool */
+               ring_enq(ring, mask, (uint32_t)(uintptr_t)buf_hdl);

If I understood idea right there should be odp specific packet header
with odp fields which is needed to implement api but missing in hardware
buffer field. Then hw buffer which is aligned by default with pointer to
data. Everything depends on implementation and it's not mandatory.

If your platform reuses this linux-generic file and that alignment does
not work for you then we rework it somehow.

Bet regards.
Maxim.


On 08/07/17 21:58, Bill Fischofer wrote:
> This is part of the latest pool restructure code contributed by Nokia. If
> you'd like to join the ODP public call tomorrow at 15:00 UTC we can discuss
> this then.
> 
> On Mon, Aug 7, 2017 at 8:57 AM, Liron Himi <lir...@marvell.com> wrote:
> 
>> Hi,
>>
>> I'm trying to move to odp1.15 and encounter with an buffer alignment issue.
>> It seems that linux-generic implementation make sure that the data address
>> is align with the requested alignment and not the buffer address itself
>> (look at the code sniped below).
>> On ODP1.11 (the current version we use) the buffer was aligned correctly.
>>
>> Is the current behavior is the expected one?
>> Our HW (and probably other HWs) rely on the fact that the buffers are
>> aligned.
>>
>> From odp_pool.c, init_buffers:
>>
>>                                 offset = pool->headroom;
>>
>>                                 /* move to correct align */
>>                                 while (((uintptr_t)&data[offset]) %
>> pool->align != 0)
>>                                                 offset++;
>>
>>
>> Regards,
>> Liron
>>

Reply via email to