Thanks Taras, I was just about to post something along those lines.

Gilad, the whole idea behind direct application access to buffer contents
is for exception paths and is expected to be infrequent.  For normal
operation, the expectation is that the classifier will parse and abstract
the relevant information from that packet into meta data that the
application can access directly since at line rate the application doesn't
have the bandwidth to parse packets itself.

So the idea behind these calls is to expose a minimal set of APIs that can
allow the application to see the raw packet data in a controlled manner.
It's up to the implementation to decide whether that's done via direct
addressability or via some mapping function, but the releases are implicit
and handled by the implementation as Taras noted.


On Tue, Aug 26, 2014 at 6:39 AM, Taras Kondratiuk <
[email protected]> wrote:

> On 08/26/2014 02:01 PM, Gilad Ben Yossef wrote:
>
>> Hi Bill and everyone,
>>
>> As this is my first post (a few patches not withstanding), I'd like to
>> start by saying thank you for the work you and everyone are putting into
>> ODP.
>>
>> Now for the topic at hand - I know I am a bit of a Johnny-come-lately to
>> this discussion and a new comer to ODP. I apologize therefore if some of
>> these issues have been discussed in the past.
>>
>> The design docs specifies that " Applications cannot address the
>> contents of a buffer or a buffer segment until they explicitly request
>> addressability via the odp_buffer_addr(),  odp_buffer_segment_addr(), or
>> odp_buffer_offset_addr() calls. … The provision of this explicit step to
>> make buffers and buffer segments addressable to an application is for
>> NUMA architecture support since the actual memory area(s) that store
>> buffers may not be directly addressable to application processing cores
>> on such architectures".
>>
>> However, no API is provided to explicitly state that access to the
>> segment is no longer needed, thus allowing freeing any resources
>> required by making the segments available.
>>
>> Consider as an example an implementation where the odp_buffer_addr()
>> installs a virtual to physical mapping by populating a hardware MMU
>> register such as a TLB entry. Without an explicit point where the buffer
>> data is no longer required to be addressable, there is no point for the
>> implementation to release said entry.
>>
>
> Hi Gilad
>
> IMO explicit API can be avoided. Application owns buffer until it is
> pushed to some queue or consumed by implementation via some other API
> (odp_pktio_send, etc). After that point application has no access to
> the buffer, so any reserved resources can be cleaned up by
> implementation.
>
_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to