On 5 February 2015 at 22:12, Taras Kondratiuk <taras.kondrat...@linaro.org> wrote: > On 02/03/2015 11:04 PM, Ola Liljedahl wrote: >> My alternative approach that should achieve that same goals as Petri >> but give more freedom to implementations. You don't have to approve of >> it, I just want to show that given a defined and understood problem, >> many potential solutions exist and the first alternative might not be >> the best. Let's work together. >> >> * init_seg_len: >> On input: user's required (desired) minimal length of initial >> segment (including headroom) >> On output: implementation's best effort to match user's request >> Purpose: ensure that those packet headers the application >> normally will process are stored in a consecutive memory area. >> Applications do not have to check any configuration in order >> to initialize a configuration which the implementation anyway has to >> check if it can support. >> Applications should check output values to see if its desired >> values were matched. The application decides whether a failure to >> match is a fatal error or the application can handle the situation >> anyway (e.g. with degraded performance because it has to do some >> workarounds in SW). >> >> * seg_len: >> On input: user's desired length of other segments >> On output: implementation's best effort to match user's request >> Purpose: a hint from the user how to partition to pool into >> segments for best trade-off between memory utilization and SW >> processing performance. >> Note: I know some HW can support multiple segment sizes so I >> think it is useful for the API to allow for this. Targets which only >> support one segment size (per packet pool) could use e.g. >> max(int_seg_len, seg_len). Some targets may not allow user-defined >> segment sizes at all, the ODP implementation will just return the >> actual values and the application can check whether those are >> acceptable. >> >> * init_seg_num: >> On input: Number of initial segments. >> On output: Updated with actual number of segments if a shared >> memory region was specified? >> * seg_num: >> On input: Number of other segments. >> On output: Updated with actual number of segments if a shared >> memory region was specified? > > Wouldn't it be simpler to create two pools and assign both to Pktio? Exactly the kind of constructive comments I want to enable by starting with defining and agreeing on the problem!
If this is not an acceptable solution because of some other (currently unknown) requirement, we need to understand and formalize that requirement as well. Is there any disadvantage of pre-segregating the buffers into different pools (with different segment sizes)? Could this limit how HW uses those segments for different purposes? Can a multi-segment packet contain segments from different pools? _______________________________________________ lng-odp mailing list lng-odp@lists.linaro.org http://lists.linaro.org/mailman/listinfo/lng-odp