]> err.no Git - linux-2.6/commitdiff
[I/OAT]: Structure changes for TCP recv offload to I/OAT
authorChris Leech <christopher.leech@intel.com>
Wed, 24 May 2006 00:55:33 +0000 (17:55 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 18 Jun 2006 04:25:48 +0000 (21:25 -0700)
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>
include/linux/skbuff.h
include/linux/tcp.h
include/net/sock.h
include/net/tcp.h
net/core/sock.c

index f8f234708b984c58addf22edcef14a93d29b4df2..23bad3bf3c9dfc46428a873a2363bd58efb4c959 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/net.h>
 #include <linux/textsearch.h>
 #include <net/checksum.h>
+#include <linux/dmaengine.h>
 
 #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.  */
index 542d39596bd86f0c7cdc84b58977b4da440590a2..c90daa5da6c3053a96019ae7c713fafe4f9da6ad 100644 (file)
@@ -18,6 +18,7 @@
 #define _LINUX_TCP_H
 
 #include <linux/types.h>
+#include <linux/dmaengine.h>
 #include <asm/byteorder.h>
 
 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           */
index c9fad6fb629b652d4c27e3965859efe12c3d7895..90c65cb091a879ef904836ead82d092399d99e3b 100644 (file)
@@ -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;
index 3c989db8a7aa508e6b3c42f5b49e61d9a2ec7691..d0c2c2fa7587750ff77eb9b971d76a955448485c 100644 (file)
@@ -28,6 +28,7 @@
 #include <linux/cache.h>
 #include <linux/percpu.h>
 #include <linux/skbuff.h>
+#include <linux/dmaengine.h>
 
 #include <net/inet_connection_sock.h>
 #include <net/inet_timewait_sock.h>
@@ -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
index ed2afdb9ea2df7317794e31a1f034a605e0d9c7d..5d820c3766530a991056050d23be7013107ae20c 100644 (file)
@@ -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;