mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-24 23:52:40 +00:00
[I/OAT]: Utility functions for offloading sk_buff to iovec copies
Provides for pinning user space pages in memory, copying to iovecs, and copying from sk_buffs including fragmented and chained sk_buffs. Signed-off-by: Chris Leech <christopher.leech@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
db21733488
commit
de5506e155
6 changed files with 459 additions and 1 deletions
|
@ -333,5 +333,27 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
|
|||
int dma_async_device_register(struct dma_device *device);
|
||||
void dma_async_device_unregister(struct dma_device *device);
|
||||
|
||||
/* --- Helper iov-locking functions --- */
|
||||
|
||||
struct dma_page_list {
|
||||
char *base_address;
|
||||
int nr_pages;
|
||||
struct page **pages;
|
||||
};
|
||||
|
||||
struct dma_pinned_list {
|
||||
int nr_iovecs;
|
||||
struct dma_page_list page_list[0];
|
||||
};
|
||||
|
||||
struct dma_pinned_list *dma_pin_iovec_pages(struct iovec *iov, size_t len);
|
||||
void dma_unpin_iovec_pages(struct dma_pinned_list* pinned_list);
|
||||
|
||||
dma_cookie_t dma_memcpy_to_iovec(struct dma_chan *chan, struct iovec *iov,
|
||||
struct dma_pinned_list *pinned_list, unsigned char *kdata, size_t len);
|
||||
dma_cookie_t dma_memcpy_pg_to_iovec(struct dma_chan *chan, struct iovec *iov,
|
||||
struct dma_pinned_list *pinned_list, struct page *page,
|
||||
unsigned int offset, size_t len);
|
||||
|
||||
#endif /* CONFIG_DMA_ENGINE */
|
||||
#endif /* DMAENGINE_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue