aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChris Leech <christopher.leech@intel.com>2006-05-23 20:50:37 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-18 00:25:46 -0400
commitde5506e155276d385712c2aa1c2d9a27cd4ed947 (patch)
tree219c30dab27b9aef2597d8735dfc19db8454849e /include
parentdb21733488f84a596faaad0d05430b3f51804692 (diff)
[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>
Diffstat (limited to 'include')
-rw-r--r--include/linux/dmaengine.h22
-rw-r--r--include/net/netdma.h6
2 files changed, 28 insertions, 0 deletions
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 30781546ac99..78b236ca04f8 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -333,5 +333,27 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
333int dma_async_device_register(struct dma_device *device); 333int dma_async_device_register(struct dma_device *device);
334void dma_async_device_unregister(struct dma_device *device); 334void dma_async_device_unregister(struct dma_device *device);
335 335
336/* --- Helper iov-locking functions --- */
337
338struct dma_page_list {
339 char *base_address;
340 int nr_pages;
341 struct page **pages;
342};
343
344struct dma_pinned_list {
345 int nr_iovecs;
346 struct dma_page_list page_list[0];
347};
348
349struct dma_pinned_list *dma_pin_iovec_pages(struct iovec *iov, size_t len);
350void dma_unpin_iovec_pages(struct dma_pinned_list* pinned_list);
351
352dma_cookie_t dma_memcpy_to_iovec(struct dma_chan *chan, struct iovec *iov,
353 struct dma_pinned_list *pinned_list, unsigned char *kdata, size_t len);
354dma_cookie_t dma_memcpy_pg_to_iovec(struct dma_chan *chan, struct iovec *iov,
355 struct dma_pinned_list *pinned_list, struct page *page,
356 unsigned int offset, size_t len);
357
336#endif /* CONFIG_DMA_ENGINE */ 358#endif /* CONFIG_DMA_ENGINE */
337#endif /* DMAENGINE_H */ 359#endif /* DMAENGINE_H */
diff --git a/include/net/netdma.h b/include/net/netdma.h
index cbfe89d7e5d0..19760eb131aa 100644
--- a/include/net/netdma.h
+++ b/include/net/netdma.h
@@ -23,6 +23,7 @@
23#include <linux/config.h> 23#include <linux/config.h>
24#ifdef CONFIG_NET_DMA 24#ifdef CONFIG_NET_DMA
25#include <linux/dmaengine.h> 25#include <linux/dmaengine.h>
26#include <linux/skbuff.h>
26 27
27static inline struct dma_chan *get_softnet_dma(void) 28static inline struct dma_chan *get_softnet_dma(void)
28{ 29{
@@ -34,5 +35,10 @@ static inline struct dma_chan *get_softnet_dma(void)
34 rcu_read_unlock(); 35 rcu_read_unlock();
35 return chan; 36 return chan;
36} 37}
38
39int dma_skb_copy_datagram_iovec(struct dma_chan* chan,
40 const struct sk_buff *skb, int offset, struct iovec *to,
41 size_t len, struct dma_pinned_list *pinned_list);
42
37#endif /* CONFIG_NET_DMA */ 43#endif /* CONFIG_NET_DMA */
38#endif /* NETDMA_H */ 44#endif /* NETDMA_H */