From 1e74c213fa0d8e685af2378af721f5059f7490b0 Mon Sep 17 00:00:00 2001 From: Chris Leech Date: Tue, 23 May 2006 17:55:33 -0700 Subject: [PATCH] --- yaml --- r: 27493 b: refs/heads/master c: 97fc2f0848c928c63c2ae619deee61a0b1107b69 h: refs/heads/master i: 27491: 44db7d9ca0ca2be84669b4a899952cad90f36368 v: v3 --- [refs] | 2 +- trunk/include/linux/skbuff.h | 4 ++++ trunk/include/linux/tcp.h | 8 ++++++++ trunk/include/net/sock.h | 2 ++ trunk/include/net/tcp.h | 7 +++++++ trunk/net/core/sock.c | 6 ++++++ 6 files changed, 28 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 0d3578c83e21..3b90fc9be7a1 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: de5506e155276d385712c2aa1c2d9a27cd4ed947 +refs/heads/master: 97fc2f0848c928c63c2ae619deee61a0b1107b69 diff --git a/trunk/include/linux/skbuff.h b/trunk/include/linux/skbuff.h index f8f234708b98..23bad3bf3c9d 100644 --- a/trunk/include/linux/skbuff.h +++ b/trunk/include/linux/skbuff.h @@ -29,6 +29,7 @@ #include #include #include +#include #define HAVE_ALLOC_SKB /* For the drivers to know */ #define HAVE_ALIGNABLE_SKB /* Ditto 8) */ @@ -285,6 +286,9 @@ struct sk_buff { __u16 tc_verd; /* traffic control verdict */ #endif #endif +#ifdef CONFIG_NET_DMA + dma_cookie_t dma_cookie; +#endif /* These elements must be at the end, see alloc_skb() for details. */ diff --git a/trunk/include/linux/tcp.h b/trunk/include/linux/tcp.h index 542d39596bd8..c90daa5da6c3 100644 --- a/trunk/include/linux/tcp.h +++ b/trunk/include/linux/tcp.h @@ -18,6 +18,7 @@ #define _LINUX_TCP_H #include +#include #include struct tcphdr { @@ -233,6 +234,13 @@ struct tcp_sock { struct iovec *iov; int memory; int len; +#ifdef CONFIG_NET_DMA + /* members for async copy */ + struct dma_chan *dma_chan; + int wakeup; + struct dma_pinned_list *pinned_list; + dma_cookie_t dma_cookie; +#endif } ucopy; __u32 snd_wl1; /* Sequence for window update */ diff --git a/trunk/include/net/sock.h b/trunk/include/net/sock.h index c9fad6fb629b..90c65cb091a8 100644 --- a/trunk/include/net/sock.h +++ b/trunk/include/net/sock.h @@ -132,6 +132,7 @@ struct sock_common { * @sk_receive_queue: incoming packets * @sk_wmem_alloc: transmit queue bytes committed * @sk_write_queue: Packet sending queue + * @sk_async_wait_queue: DMA copied packets * @sk_omem_alloc: "o" is "option" or "other" * @sk_wmem_queued: persistent queue size * @sk_forward_alloc: space allocated forward @@ -205,6 +206,7 @@ struct sock { atomic_t sk_omem_alloc; struct sk_buff_head sk_receive_queue; struct sk_buff_head sk_write_queue; + struct sk_buff_head sk_async_wait_queue; int sk_wmem_queued; int sk_forward_alloc; gfp_t sk_allocation; diff --git a/trunk/include/net/tcp.h b/trunk/include/net/tcp.h index 3c989db8a7aa..d0c2c2fa7587 100644 --- a/trunk/include/net/tcp.h +++ b/trunk/include/net/tcp.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -817,6 +818,12 @@ static inline void tcp_prequeue_init(struct tcp_sock *tp) tp->ucopy.len = 0; tp->ucopy.memory = 0; skb_queue_head_init(&tp->ucopy.prequeue); +#ifdef CONFIG_NET_DMA + tp->ucopy.dma_chan = NULL; + tp->ucopy.wakeup = 0; + tp->ucopy.pinned_list = NULL; + tp->ucopy.dma_cookie = 0; +#endif } /* Packet is added to VJ-style prequeue for processing in process diff --git a/trunk/net/core/sock.c b/trunk/net/core/sock.c index ed2afdb9ea2d..5d820c376653 100644 --- a/trunk/net/core/sock.c +++ b/trunk/net/core/sock.c @@ -832,6 +832,9 @@ struct sock *sk_clone(const struct sock *sk, const gfp_t priority) atomic_set(&newsk->sk_omem_alloc, 0); skb_queue_head_init(&newsk->sk_receive_queue); skb_queue_head_init(&newsk->sk_write_queue); +#ifdef CONFIG_NET_DMA + skb_queue_head_init(&newsk->sk_async_wait_queue); +#endif rwlock_init(&newsk->sk_dst_lock); rwlock_init(&newsk->sk_callback_lock); @@ -1383,6 +1386,9 @@ void sock_init_data(struct socket *sock, struct sock *sk) skb_queue_head_init(&sk->sk_receive_queue); skb_queue_head_init(&sk->sk_write_queue); skb_queue_head_init(&sk->sk_error_queue); +#ifdef CONFIG_NET_DMA + skb_queue_head_init(&sk->sk_async_wait_queue); +#endif sk->sk_send_head = NULL;