diff options
author | Chris Leech <christopher.leech@intel.com> | 2006-05-23 20:55:33 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2006-06-18 00:25:48 -0400 |
commit | 97fc2f0848c928c63c2ae619deee61a0b1107b69 (patch) | |
tree | 651f5ec78128605736d6c777a13697d5e58a1b62 | |
parent | de5506e155276d385712c2aa1c2d9a27cd4ed947 (diff) |
[I/OAT]: Structure changes for TCP recv offload to I/OAT
Adds an async_wait_queue and some additional fields to tcp_sock, and a
dma_cookie_t to sk_buff.
Signed-off-by: Chris Leech <christopher.leech@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | include/linux/skbuff.h | 4 | ||||
-rw-r--r-- | include/linux/tcp.h | 8 | ||||
-rw-r--r-- | include/net/sock.h | 2 | ||||
-rw-r--r-- | include/net/tcp.h | 7 | ||||
-rw-r--r-- | net/core/sock.c | 6 |
5 files changed, 27 insertions, 0 deletions
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index f8f234708b98..23bad3bf3c9d 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/net.h> | 29 | #include <linux/net.h> |
30 | #include <linux/textsearch.h> | 30 | #include <linux/textsearch.h> |
31 | #include <net/checksum.h> | 31 | #include <net/checksum.h> |
32 | #include <linux/dmaengine.h> | ||
32 | 33 | ||
33 | #define HAVE_ALLOC_SKB /* For the drivers to know */ | 34 | #define HAVE_ALLOC_SKB /* For the drivers to know */ |
34 | #define HAVE_ALIGNABLE_SKB /* Ditto 8) */ | 35 | #define HAVE_ALIGNABLE_SKB /* Ditto 8) */ |
@@ -285,6 +286,9 @@ struct sk_buff { | |||
285 | __u16 tc_verd; /* traffic control verdict */ | 286 | __u16 tc_verd; /* traffic control verdict */ |
286 | #endif | 287 | #endif |
287 | #endif | 288 | #endif |
289 | #ifdef CONFIG_NET_DMA | ||
290 | dma_cookie_t dma_cookie; | ||
291 | #endif | ||
288 | 292 | ||
289 | 293 | ||
290 | /* These elements must be at the end, see alloc_skb() for details. */ | 294 | /* These elements must be at the end, see alloc_skb() for details. */ |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 542d39596bd8..c90daa5da6c3 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #define _LINUX_TCP_H | 18 | #define _LINUX_TCP_H |
19 | 19 | ||
20 | #include <linux/types.h> | 20 | #include <linux/types.h> |
21 | #include <linux/dmaengine.h> | ||
21 | #include <asm/byteorder.h> | 22 | #include <asm/byteorder.h> |
22 | 23 | ||
23 | struct tcphdr { | 24 | struct tcphdr { |
@@ -233,6 +234,13 @@ struct tcp_sock { | |||
233 | struct iovec *iov; | 234 | struct iovec *iov; |
234 | int memory; | 235 | int memory; |
235 | int len; | 236 | int len; |
237 | #ifdef CONFIG_NET_DMA | ||
238 | /* members for async copy */ | ||
239 | struct dma_chan *dma_chan; | ||
240 | int wakeup; | ||
241 | struct dma_pinned_list *pinned_list; | ||
242 | dma_cookie_t dma_cookie; | ||
243 | #endif | ||
236 | } ucopy; | 244 | } ucopy; |
237 | 245 | ||
238 | __u32 snd_wl1; /* Sequence for window update */ | 246 | __u32 snd_wl1; /* Sequence for window update */ |
diff --git a/include/net/sock.h b/include/net/sock.h index c9fad6fb629b..90c65cb091a8 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -132,6 +132,7 @@ struct sock_common { | |||
132 | * @sk_receive_queue: incoming packets | 132 | * @sk_receive_queue: incoming packets |
133 | * @sk_wmem_alloc: transmit queue bytes committed | 133 | * @sk_wmem_alloc: transmit queue bytes committed |
134 | * @sk_write_queue: Packet sending queue | 134 | * @sk_write_queue: Packet sending queue |
135 | * @sk_async_wait_queue: DMA copied packets | ||
135 | * @sk_omem_alloc: "o" is "option" or "other" | 136 | * @sk_omem_alloc: "o" is "option" or "other" |
136 | * @sk_wmem_queued: persistent queue size | 137 | * @sk_wmem_queued: persistent queue size |
137 | * @sk_forward_alloc: space allocated forward | 138 | * @sk_forward_alloc: space allocated forward |
@@ -205,6 +206,7 @@ struct sock { | |||
205 | atomic_t sk_omem_alloc; | 206 | atomic_t sk_omem_alloc; |
206 | struct sk_buff_head sk_receive_queue; | 207 | struct sk_buff_head sk_receive_queue; |
207 | struct sk_buff_head sk_write_queue; | 208 | struct sk_buff_head sk_write_queue; |
209 | struct sk_buff_head sk_async_wait_queue; | ||
208 | int sk_wmem_queued; | 210 | int sk_wmem_queued; |
209 | int sk_forward_alloc; | 211 | int sk_forward_alloc; |
210 | gfp_t sk_allocation; | 212 | gfp_t sk_allocation; |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 3c989db8a7aa..d0c2c2fa7587 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/cache.h> | 28 | #include <linux/cache.h> |
29 | #include <linux/percpu.h> | 29 | #include <linux/percpu.h> |
30 | #include <linux/skbuff.h> | 30 | #include <linux/skbuff.h> |
31 | #include <linux/dmaengine.h> | ||
31 | 32 | ||
32 | #include <net/inet_connection_sock.h> | 33 | #include <net/inet_connection_sock.h> |
33 | #include <net/inet_timewait_sock.h> | 34 | #include <net/inet_timewait_sock.h> |
@@ -817,6 +818,12 @@ static inline void tcp_prequeue_init(struct tcp_sock *tp) | |||
817 | tp->ucopy.len = 0; | 818 | tp->ucopy.len = 0; |
818 | tp->ucopy.memory = 0; | 819 | tp->ucopy.memory = 0; |
819 | skb_queue_head_init(&tp->ucopy.prequeue); | 820 | skb_queue_head_init(&tp->ucopy.prequeue); |
821 | #ifdef CONFIG_NET_DMA | ||
822 | tp->ucopy.dma_chan = NULL; | ||
823 | tp->ucopy.wakeup = 0; | ||
824 | tp->ucopy.pinned_list = NULL; | ||
825 | tp->ucopy.dma_cookie = 0; | ||
826 | #endif | ||
820 | } | 827 | } |
821 | 828 | ||
822 | /* Packet is added to VJ-style prequeue for processing in process | 829 | /* Packet is added to VJ-style prequeue for processing in process |
diff --git a/net/core/sock.c b/net/core/sock.c index ed2afdb9ea2d..5d820c376653 100644 --- a/net/core/sock.c +++ b/net/core/sock.c | |||
@@ -832,6 +832,9 @@ struct sock *sk_clone(const struct sock *sk, const gfp_t priority) | |||
832 | atomic_set(&newsk->sk_omem_alloc, 0); | 832 | atomic_set(&newsk->sk_omem_alloc, 0); |
833 | skb_queue_head_init(&newsk->sk_receive_queue); | 833 | skb_queue_head_init(&newsk->sk_receive_queue); |
834 | skb_queue_head_init(&newsk->sk_write_queue); | 834 | skb_queue_head_init(&newsk->sk_write_queue); |
835 | #ifdef CONFIG_NET_DMA | ||
836 | skb_queue_head_init(&newsk->sk_async_wait_queue); | ||
837 | #endif | ||
835 | 838 | ||
836 | rwlock_init(&newsk->sk_dst_lock); | 839 | rwlock_init(&newsk->sk_dst_lock); |
837 | rwlock_init(&newsk->sk_callback_lock); | 840 | rwlock_init(&newsk->sk_callback_lock); |
@@ -1383,6 +1386,9 @@ void sock_init_data(struct socket *sock, struct sock *sk) | |||
1383 | skb_queue_head_init(&sk->sk_receive_queue); | 1386 | skb_queue_head_init(&sk->sk_receive_queue); |
1384 | skb_queue_head_init(&sk->sk_write_queue); | 1387 | skb_queue_head_init(&sk->sk_write_queue); |
1385 | skb_queue_head_init(&sk->sk_error_queue); | 1388 | skb_queue_head_init(&sk->sk_error_queue); |
1389 | #ifdef CONFIG_NET_DMA | ||
1390 | skb_queue_head_init(&sk->sk_async_wait_queue); | ||
1391 | #endif | ||
1386 | 1392 | ||
1387 | sk->sk_send_head = NULL; | 1393 | sk->sk_send_head = NULL; |
1388 | 1394 | ||