@@ -92,6 +92,79 @@ int odp_buffer_is_valid(odp_buffer_t buf);
*/
void odp_buffer_print(odp_buffer_t buf);
+/**
+*Number of segments in this scatter-gather List
+*
+*@param buf Buffer Handle
+*
+*@return Total number of segments in this scatter-gather List.
+*
+**/
+int odp_buffer_segment_count(odp_buffer_t buf)
+
+/**
+*Address of the segment in the buffer list.
+*
+*@param buf Buffer Handle
+*@param n Index number for the segment in the SG list
+*@param size Returns the size of the current addressable segment
+
+*@return Segment start address
+**/
+
+void* odp_buffer_segment_addr(odp_buffer_t buf, int n, size_t* size);
+
+/*
+*Creates ODP Buffer from a memory region
+*
+*@param addr Address of the memory region
+*@param size Size of the memory region
+*
+*@return Buffer Handle to the newly create odp buffer
+*/
+odp_buffer_t odp_buffer_from_memory_region(void* addr, int size );
We should keep consistent with buffer sizes, odp_buffer_size for instance returns a size_t. Also, does this assume that the data will be copied, so that the user can safely free the memory area pointed to by addr?
+
+/**
+* Merge Buffer list into a singe buffer
+*@param buf Array of ODP Buffer Handles
+*@param num Number of Buffers in the buf Array
+
+*@return Buffer Handle to the newly created odp buffer
+**/
+odp_buffer_t odp_buffer_merge(odp_buffer_t[] buf, int num);
+
Which pool should the resulting buffer be allocated from? Will there be an SG list in the resulting buffer or just one big chunk?
+/**
+* Split a single Buffer into a list of odp buffers
+*
+*@param buf Buffer Handle
+*
+*@param size Maximum size of the individual buffers
+*
+*@return Array of newly created Buffer Handle
+**/
+odp_buffer_t[] odp_buffer_split(odp_buffer_t buf, int size);
This doesn't seem entirely related to SG support. Is there zero-copy here?
+
+/**
+* Append a buffer at the end of a scatter-gather list of buffer
+*
+*@param buf Buffer Handle to the scatter-gather list of buffer
+*
+*@param tail Buffer Handle to the buffer which is appended
+*
+*@return 1 if success 0 otherwise
+**/
+int odp_buffer_append(odp_buffer_t buf, odp_buffer_t tail );
+
+/**
+* Add a buffer at the head of a existing Scatter-gather Buffer
+*
+*@param buf Buffer Handle to the scatter-gather list of buffer
+*