On 01/18/2015 03:07 PM, Mrityunjay Kumar wrote:
> 
> I want to allocate memory by the ODP API, which will also seen by the 
> hardware. As per my understanding address actually seen by the memory 
> hardware is a physical address. Is there any way to find out the physical 
> address?  Might be there is a way to do but I am not able to figure it out.

Are you writing an ODP application or platform implementation?

Addresses that are exposed to ODP application are CPU-accessible and
can be either physical or virtual depending on a platform
implementation and execution environment. ODP does not explicitly
expose physical addresses.

You have mentioned odp_buffer_hdr_t which is an internal structure, so
I assume it is an ODP implementation. Then you can use whatever
internal function you have inside of your implementation to get a
physical address.

> 
> Regards
> 
> ________________________________________
> From: Taras Kondratiuk <[email protected]>
> Sent: Sunday, January 18, 2015 4:40 PM
> To: Mrityunjay Kumar; [email protected]; [email protected]
> Subject: Re: [lng-odp] Regarding reserve memory where both SW + HW can access.
> 
> On 01/18/2015 11:08 AM, Mrityunjay Kumar wrote:
>> Hi
>>
>> I want to reserve memory where both SW + HW can be access. I have
>> explore the code ODP v0.7. I come to know that we have only two flags:
>>
>> /* Share level */
>> #define ODP_SHM_SW_ONLY 0x1 /**< Application SW only, no HW access */
>> #define ODP_SHM_PROC    0x2 /**< Share with external processes */
>>
>> I come across the ODP v0.7 directly from ODP v0.2. I have seen that in
>> ODP v0.2; we have option to store physical memory in odp_buffer_hdr_t;
>> but in latest release (ODP v0.7) option to store physical memory has
>> been removed. if some body point me if there is any option to map
>> between virtual to physical memory?
>>
>> odp_shm_create takes a flag argument which has two values 1.
>> ODP_SHM_SW_ONLY and 2. ODP_SHM_PROC, but odp_pktio uses 0. could we also
>> explicitly extend this flag list to work across platforms?
> 
> Sorry I didn't get what is the issue. Could you please clarify your
> intent?
> 
> ODP_SHM_SW_ONLY is an optimization flag which should be set only if a
> caller is sure that memory won't be used by HW (not passed into any ODP
> API). If ODP_SHM_SW_ONLY is not set, implementation should expect it to
> be used by HW and should act accordingly.


_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to