From: EXT Bill Fischofer [mailto:[email protected]] Sent: Thursday, April 14, 2016 10:28 PM To: Savolainen, Petri (Nokia - FI/Espoo) <[email protected]> Cc: LNG ODP Mailman List <[email protected]> Subject: Re: [lng-odp] [API-NEXT PATCH] api: queue: add queue context length
On Thu, Apr 14, 2016 at 9:21 AM, Petri Savolainen <[email protected]<mailto:[email protected]>> wrote: Added queue context length parameter, which is a hint for the implementation for how much to prefetch. Added the same in to the set function. It's not needed for get function since application can store the same into context data and implementation may avoid to save the length if it does not need it (e.g. always prefetches a fixed number of bytes). The code looks fine, but I'm a bit confused about this comment. Is the length the actual byte length of the context or is it a prefetch length request? If the latter (i.e., the actual struct pointed to by the user context is may be longer than this field) then perhaps prefetch_len would be a better name to make it clear what its intended purpose is. The parameter name follows the naming convention what we already have (“context”). Similarly, context pointer is a hint for prefetching, so it could have been named prefetch_ptr. I think “context” and “context_len” are more logical pair than “context” and “prefetch_len”. Also I think the comment of context_len is pretty clear on the intended usage, but I could e.g. couple of words in that if it helps /** Queue context data length in bytes for prefetching * * The implementation may use this value as a hint for the number of * context data bytes to prefetch. Default value is zero (no hint). */ uint32_t context_len; -Petri Signed-off-by: Petri Savolainen <[email protected]<mailto:[email protected]>> --- include/odp/api/spec/queue.h | 9 ++++++++- platform/linux-generic/odp_queue.c | 3 ++- test/validation/queue/queue.c | 10 ++++++---- test/validation/scheduler/scheduler.c | 6 +++--- 4 files changed, 19 insertions(+), 9 deletions(-) diff --git a/include/odp/api/spec/queue.h b/include/odp/api/spec/queue.h index 51d94a2..ecb1a6d 100644 --- a/include/odp/api/spec/queue.h +++ b/include/odp/api/spec/queue.h @@ -139,6 +139,12 @@ typedef struct odp_queue_param_t { * pointer for prefetching the context data. Default value of the * pointer is NULL. */ void *context; + + /** Queue context data length in bytes + * + * The implementation may use this value as a hint for the number of + * context data bytes to prefetch. Default value is zero (no hint). */ + uint32_t context_len; } odp_queue_param_t;
_______________________________________________ lng-odp mailing list [email protected] https://lists.linaro.org/mailman/listinfo/lng-odp
