Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page: include/odp/api/spec/pool.h @@ -214,6 +221,17 @@ typedef struct odp_pool_param_t { defined by pool capability pkt.max_uarea_size. Specify as 0 if no user area is needed. */ uint32_t uarea_size; + + /** Minimum Headroom size in bytes. Minimum number of + bytes of space preceding packet data to reserve for + use as headroom. This value will be used as a hint + and implementation might configure a value of + headroom greater than this value. + Must not exceed the implementation defined + 'max_headroom' in odp_pool_capability(). + If the value is less than 'min_headroom' defined in + 'odp_pool_capability' then it will be ignored.*/
Comment: If we have defined min and max values, then values outside this range should result in the `odp_pool_create()` call failing, not being silently ignored. Such is the case for other limits so headroom should be no different. However, as noted previously, I don't think a `min_headroom` is particularly meaningful/useful so this should be reworded. We should definitely include the use case that a `min_headroom` of 0 indicates that the application does not require headroom so the implementation may omit this to conserve storage. It may also be appropriate to revisit the question of headroom and packet alignment. The current linux-generic pool allocation structure ensures that the IP header will be misaligned due to the presence of a 14-byte Ethernet header, meaning `odp_packet_l3_ptr()` will return an address that is 2-byte rather than 4-byte aligned because we're now aligning `data[offset]` rather than `data[0]`. I realize this is not directly related to this PR, but since we're making changes in this area something we should make clear. html_url=https://github.com/Linaro/odp/pull/152#discussion_r135948688 updated_at=2017-09-01 13:45:37