Bill Fischofer(Bill-Fischofer-Linaro) replied on github web page: platform/linux-generic/odp_pool.c line 80 @@ -403,6 +430,12 @@ static odp_pool_t pool_create(const char *name, odp_pool_param_t *params, block_size = ROUNDUP_CACHE_LINE(hdr_size + align + headroom + data_size + tailroom); + /* Allocate extra memory for skipping packet buffers which cross page + * boundaries. */ + if (params->type == ODP_POOL_PACKET) + num_extra = 2 * (((uint64_t)(num * block_size) + + CONT_PAGE_SIZE - 1) / CONT_PAGE_SIZE);
Comment: The blocks are contiguous so you're computing how many of them can fit in a 2M huge page. Since blocks aren't themselves larger than a huge page I don't see what's wrong with my analysis. > Bill Fischofer(Bill-Fischofer-Linaro) wrote: > Fair enough. I agree these sort of considerations should be transparent to > the application. This will complicate the sort of index-juggling that VPP > does (see PR #200). We'll have to consider this in the discussions planned > for Monday's ARCH call. >> Bill Fischofer(Bill-Fischofer-Linaro) wrote: >> I'd call it huge pages if that's the problem you're trying to address. Any >> jumbo packet is going to cross a 4K boundary if it isn't segmented. I assume >> that isn't a problem? >>> Matias Elo(matiaselo) wrote: >>> Yes, I'm referring to all page sizes >= 2MB, so the same operation is also >>> done with 1GB pages. I was struggling to figure out a good name for this >>> define, so all ideas are welcome. >>>> Matias Elo(matiaselo) wrote: >>>> Currently this is required for the dpdk pmd drivers only, but if/when we >>>> are adding support for more drivers this issue is likely to re-emerge. >>>> IMHO the applications shouldn't have to know about this, so I wouldn't add >>>> a new parameter. >>>>> Matias Elo(matiaselo) wrote: >>>>> Also the extra buffers can cross page boundaries. >>>>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote: >>>>>> Why the `2 *` factor here? The number of block size "page" crossings is >>>>>> going to be limited to the rounded up number of pages: >>>>>> >>>>>> ``` >>>>>> <--------------------------> "n" pages in size >>>>>> ---+--------+--- ... ---+---- There can be at most n crossings, >>>>>> (n - 1) if block happily starts on a page >>>>>> boundary. >>>>>> >>>>>> ``` >>>>>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote: >>>>>>> Shouldn't this processing be an `odp_pool_param_t` option? Doing this >>>>>>> unconditionally because "some NICs" may have problems seems unnecessary. >>>>>>>> Bill Fischofer(Bill-Fischofer-Linaro) wrote: >>>>>>>> This is somewhat confusing terminology. Pages are typically 4K in >>>>>>>> size. It seems you're referring to huge pages here. How about systems >>>>>>>> that configured 1GB huge pages? https://github.com/Linaro/odp/pull/223#discussion_r143274648 updated_at 2017-10-06 19:17:38