Hi,

On Fri, 7 Nov 2014 07:07:32 -0600 Bill Fischofer <[email protected]> 
wrote:
> Headroom permits applications to reserve buffer space for additional
> headers but it naturally also can serve to align packet frames.

[snip]

> So the call odp_buffer_pool_set_headroom(pool,hr+2); is a natural means of
> getting Ethernet packets aligned for header addressing purposes in addition
> to reserving some number of bytes for expansion.

There are 2 approaches:

1. Consider user headroom and packet data alignment as two distinct user
   requirements (e.g. presented as 2 different params in the API).

2. The user specifies the right headroom which also takes care of
   packet data alignment.

First approach has the slight advantage of preventing the user from
accidentally forgetting to take care of alignment, by means of a more
strict interface, that forces the user to provide and "alignment
requirement". OTOH, such interface may be considered overly explicit.

Second puts all responsibility on the user; It assumes users are well
aware of their doings.
Thus, it would be extremenly beneficial to document that users also need
to take care of alignment in their provided headroom.

Also, an approach where the implementation makes additional judgements
and adds more headroom than required (or even "steals" from tailroom)
may come as a surprise to the users.

Regards,
Shmulik

_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to