Josep Puigdemont(joseppc) replied on github web page: platform/linux-generic/odp_packet.c line 8 @@ -816,10 +816,7 @@ odp_packet_t odp_packet_alloc(odp_pool_t pool_hdl, uint32_t len) odp_packet_t pkt; int num, num_seg; - if (odp_unlikely(pool->params.type != ODP_POOL_PACKET)) { - __odp_errno = EINVAL; - return ODP_PACKET_INVALID; - } + ODP_ASSERT(pool->params.type == ODP_POOL_PACKET);
Comment: I think this is not correct. Before if we detected an error we interrupted the function returning an error code, now we will only interrupt this function (by calling abort_fn() global function) if and only if ODP was compiled with ODP_DEBUG enabled. > Bill Fischofer(Bill-Fischofer-Linaro) wrote: > My point is that we want two things: Cache alignment and no wasted space. > Kevin's PR addressed this issue. It seems all we need is document the > implications for those who wish to set `CONFIG_POOL_CACHE_SIZE` since > otherwise we'll just be inserting a lot of padding that once again will waste > space. >> nagarahalli wrote >> Kevin's PR is to adjust the default value so that by default we are using 1 >> cache line. However, CONFIG_POOL_CACHE_SIZE is configurable. If the user is >> not aware of the internal details of the pool implementation, parts of 2 >> elements of the pool cache array will be in the same cache line. This change >> will guard against that. If the CONFIG_POOL_CACHE_SIZE is configured >> correctly, this will not add any additional space. >>> Bill Fischofer(Bill-Fischofer-Linaro) wrote: >>> With Kevin's latest change (PR #326) this is already an integral multiple >>> of the cache size. Not sure what value we're gaining here. Is this to guard >>> against random changes to `CONFIG_POOL_CACHE_SIZE`? That still could leave >>> a lot of wasted space, which was the idea behind Kevin's PR. https://github.com/Linaro/odp/pull/346#discussion_r157737389 updated_at 2017-12-19 12:16:42