[I/OAT]: Make sk_eat_skb I/OAT aware.
authorChris Leech <christopher.leech@intel.com>
Wed, 24 May 2006 01:01:28 +0000 (18:01 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Sun, 18 Jun 2006 04:25:52 +0000 (21:25 -0700)
Add an extra argument to sk_eat_skb, and make it move early copied
packets to the async_wait_queue instead of freeing them.

Signed-off-by: Chris Leech <christopher.leech@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/sock.h
net/dccp/proto.c
net/ipv4/tcp.c
net/llc/af_llc.c

index 90c65cb091a879ef904836ead82d092399d99e3b..75b0e97ed93db8328d5cf1aee4b7e416261011ae 100644 (file)
@@ -1273,11 +1273,22 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
  * This routine must be called with interrupts disabled or with the socket
  * locked so that the sk_buff queue operation is ok.
 */
-static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb)
+#ifdef CONFIG_NET_DMA
+static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_early)
+{
+       __skb_unlink(skb, &sk->sk_receive_queue);
+       if (!copied_early)
+               __kfree_skb(skb);
+       else
+               __skb_queue_tail(&sk->sk_async_wait_queue, skb);
+}
+#else
+static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_early)
 {
        __skb_unlink(skb, &sk->sk_receive_queue);
        __kfree_skb(skb);
 }
+#endif
 
 extern void sock_enable_timestamp(struct sock *sk);
 extern int sock_get_timestamp(struct sock *, struct timeval __user *);
index 2e0ee8355c415d24d13644e20ecb6d8e837d10c1..5317fd3e66910ca25f5d73bf9dbd63e7fe400183 100644 (file)
@@ -719,7 +719,7 @@ int dccp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
                }
                dccp_pr_debug("packet_type=%s\n",
                              dccp_packet_name(dh->dccph_type));
-               sk_eat_skb(sk, skb);
+               sk_eat_skb(sk, skb, 0);
 verify_sock_status:
                if (sock_flag(sk, SOCK_DONE)) {
                        len = 0;
@@ -773,7 +773,7 @@ verify_sock_status:
                }
        found_fin_ok:
                if (!(flags & MSG_PEEK))
-                       sk_eat_skb(sk, skb);
+                       sk_eat_skb(sk, skb, 0);
                break;
        } while (1);
 out:
index 1c0cfd7a8bbbc41ed591b47da610eaa1adb41cea..4e067d25a63cd1b03694c7c22a44885c80fe3328 100644 (file)
@@ -1072,11 +1072,11 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
                                break;
                }
                if (skb->h.th->fin) {
-                       sk_eat_skb(sk, skb);
+                       sk_eat_skb(sk, skb, 0);
                        ++seq;
                        break;
                }
-               sk_eat_skb(sk, skb);
+               sk_eat_skb(sk, skb, 0);
                if (!desc->count)
                        break;
        }
@@ -1356,14 +1356,14 @@ skip_copy:
                if (skb->h.th->fin)
                        goto found_fin_ok;
                if (!(flags & MSG_PEEK))
-                       sk_eat_skb(sk, skb);
+                       sk_eat_skb(sk, skb, 0);
                continue;
 
        found_fin_ok:
                /* Process the FIN. */
                ++*seq;
                if (!(flags & MSG_PEEK))
-                       sk_eat_skb(sk, skb);
+                       sk_eat_skb(sk, skb, 0);
                break;
        } while (len > 0);
 
index 5a04db745c8d64394ce074cdecaa69d84ede0aa0..7465170a36cabae04eca8f3f5d179924d0c33a58 100644 (file)
@@ -789,7 +789,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
                        continue;
 
                if (!(flags & MSG_PEEK)) {
-                       sk_eat_skb(sk, skb);
+                       sk_eat_skb(sk, skb, 0);
                        *seq = 0;
                }
        } while (len > 0);