Alternative VE Offloading  3.0.2
VEO VE DMA API (low-level)

VE DMA API functions for VEO. More...

Functions

int veo_dma_post (veo_proc_handle *phandle, uint64_t dst, uint64_t src, int size, ve_dma_handle_t *dhandle)
 This function issues asynchronous DMA. More...
 
int veo_dma_poll (veo_proc_handle *phandle, ve_dma_handle_t *dhandle)
 This function inquiries the completion of asynchronous DMA. More...
 
int veo_dma_post_wait (veo_proc_handle *phandle, uint64_t dst, uint64_t src, int size)
 This function issues synchronous DMA. More...
 
uint64_t veo_register_mem_to_dmaatb (void *vemva, size_t size)
 This function registers VE local memory to DMAATB. More...
 
int veo_unregister_mem_from_dmaatb (veo_proc_handle *h, uint64_t vehva)
 This function unregisters VE local memory from DMAATB. More...
 
void veo_access_pcircvsyc_register (veo_proc_handle *h)
 access PCIRCVSYC register to synchronize the transferred data More...
 

Detailed Description

VE DMA API functions for VEO.

This API is a low-level API and is intended to be called by upper layer software. This API is not intended to be called by a user program. To use VEO VE DMA API functions, include "ve_offload.h" header and "veo_vedma.h" header.

Function Documentation

int veo_dma_post ( veo_proc_handle *  phandle,
uint64_t  dst,
uint64_t  src,
int  size,
ve_dma_handle_t *  dhandle 
)

This function issues asynchronous DMA.

Note
This function writes the DMA transfer request to the DMA descriptor table.
Parameters
[in]phandleVEO process handle
[in]dst4 byte aligned VE host virtual address of destination
[in]src4 byte aligned VE host virtual address of source
[in]sizeTransfer size which is a multiple of 4 and less than 128MB
[out]dhandleHandle used to inquire DMA completion
Return values
0On success
-EAGAINThe DMA using the DMA descriptor to be used next is not yet completed
Need to call vedma_post() again.
-ENOTSUPLibrary load or symbol retrieval failed.
-EBUSYDMA start on VE or result wait failed.
-EFAULTdhandle is invalid.
int veo_dma_poll ( veo_proc_handle *  phandle,
ve_dma_handle_t *  dhandle 
)

This function inquiries the completion of asynchronous DMA.

Note
This function inquiries the completion of DMA transfer request issued by vedma_post().
Parameters
[in]phandleVEO process handle
[in]dhandleDMA transfer request issued by vedma_post()
Return values
0DMA completed normally
1-65535DMA failed
Exception value of DMA descriptor is returned.
DMA failed. The value is bitwise ORed combination of the values described below.
  • 0x8000: Memory protection exception
  • 0x4000: Missing page exception
  • 0x2000: Missing space exception
  • 0x1000: Memory access exception
  • 0x0800: I/O access exception
-EAGAINDMA has not completed yet
Need to call vedma_poll() again
-ENOTSUPLibrary load or symbol retrieval failed.
-EBUSYDMA start on VE or result wait failed.
-EFAULTdhandle is invalid.
int veo_dma_post_wait ( veo_proc_handle *  phandle,
uint64_t  dst,
uint64_t  src,
int  size 
)

This function issues synchronous DMA.

Note
This function writes the DMA transfer request to the DMA descriptor table, and waits for finish.
Parameters
[in]phandleVEO process handle
[in]dst4 byte aligned VE host virtual address of destination
[in]src4 byte aligned VE host virtual address of source
[in]sizeTransfer size which is a multiple of 4 and less than 128MB
Return values
0On success
1-65535DMA failed
Exception value of DMA descriptor is returned.
DMA failed. The value is bitwise ORed combination of the values described below.
  • 0x8000: Memory protection exception
  • 0x4000: Missing page exception
  • 0x2000: Missing space exception
  • 0x1000: Memory access exception
  • 0x0800: I/O access exception
-ENOTSUPLibrary load or symbol retrieval failed.
-EBUSYDMA start on VE or result wait failed.
uint64_t veo_register_mem_to_dmaatb ( void *  vemva,
size_t  size 
)

This function registers VE local memory to DMAATB.

Note
The default value of VE page size is 64MB.
In this case, values of vemva and size need to be aligned with 64MB boundary.
If VE page size is 2MB, values of vemva and size need to be aligned with 2MB boundary.
Parameters
[in]vemvaAn address of memory to be registered
The address needs to be aligned with 64MB boundary.
[in]sizeSize of memory aligned aligned with 64MB boundary
Return values
vehvaVE host virtual address on success
0xffffffffffffffffOn failure (set errno)
  • EINVAL Invalid argument.
  • EFAULT Bad address.
  • ESRCH No such process.
  • ENOENT No such memory.
  • EACCES Permission denied.
  • ECANCEL Operation canceled.
  • ENOTSUP Library load or symbol retrieval failed.
  • EBUSY Starting memory registration to DMAATB or waiting for result of it failed.
int veo_unregister_mem_from_dmaatb ( veo_proc_handle *  h,
uint64_t  vehva 
)

This function unregisters VE local memory from DMAATB.

Parameters
[in]hVEO process handle
[in]vehvaVE host virtual address of memory to be unregistered
Return values
0On success
-1On failure (set errno)
  • EINVAL Invalid argument.
  • ECANCELED No such memory.
  • ENOTSUP Library load or symbol retrieval failed.
  • EBUSY Starting memory unregistration from DMAATB or waiting for result of it failed.
void veo_access_pcircvsyc_register ( veo_proc_handle *  h)

access PCIRCVSYC register to synchronize the transferred data

PCIRCVSYC register is PCI receiver-side synchronization register which is accessed to wait the completion of inbound requests already received.

Parameters
[in]hVEO process handle