aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Leech <christopher.leech@intel.com>2006-05-23 21:01:28 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2006-06-18 00:25:52 -0400
commit624d1164730d58a494cc5aa4afa37d02c41e83a7 (patch)
treeb6cc0776a826f8f2611eff41149410c7f4ccb355
parent0e4b4992b8007c6b62ec143cbbb292f98813ca11 (diff)
[I/OAT]: Make sk_eat_skb I/OAT aware.
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>
-rw-r--r--include/net/sock.h13
-rw-r--r--net/dccp/proto.c4
-rw-r--r--net/ipv4/tcp.c8
-rw-r--r--net/llc/af_llc.c2
4 files changed, 19 insertions, 8 deletions
diff --git a/include/net/sock.h b/include/net/sock.h
index 90c65cb091a8..75b0e97ed93d 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1273,11 +1273,22 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb)
1273 * This routine must be called with interrupts disabled or with the socket 1273 * This routine must be called with interrupts disabled or with the socket
1274 * locked so that the sk_buff queue operation is ok. 1274 * locked so that the sk_buff queue operation is ok.
1275*/ 1275*/
1276static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb) 1276#ifdef CONFIG_NET_DMA
1277static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_early)
1278{
1279 __skb_unlink(skb, &sk->sk_receive_queue);
1280 if (!copied_early)
1281 __kfree_skb(skb);
1282 else
1283 __skb_queue_tail(&sk->sk_async_wait_queue, skb);
1284}
1285#else
1286static inline void sk_eat_skb(struct sock *sk, struct sk_buff *skb, int copied_early)
1277{ 1287{
1278 __skb_unlink(skb, &sk->sk_receive_queue); 1288 __skb_unlink(skb, &sk->sk_receive_queue);
1279 __kfree_skb(skb); 1289 __kfree_skb(skb);
1280} 1290}
1291#endif
1281 1292
1282extern void sock_enable_timestamp(struct sock *sk); 1293extern void sock_enable_timestamp(struct sock *sk);
1283extern int sock_get_timestamp(struct sock *, struct timeval __user *); 1294extern int sock_get_timestamp(struct sock *, struct timeval __user *);
diff --git a/net/dccp/proto.c b/net/dccp/proto.c
index 2e0ee8355c41..5317fd3e6691 100644
--- a/net/dccp/proto.c
+++ b/net/dccp/proto.c
@@ -719,7 +719,7 @@ int dccp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
719 } 719 }
720 dccp_pr_debug("packet_type=%s\n", 720 dccp_pr_debug("packet_type=%s\n",
721 dccp_packet_name(dh->dccph_type)); 721 dccp_packet_name(dh->dccph_type));
722 sk_eat_skb(sk, skb); 722 sk_eat_skb(sk, skb, 0);
723verify_sock_status: 723verify_sock_status:
724 if (sock_flag(sk, SOCK_DONE)) { 724 if (sock_flag(sk, SOCK_DONE)) {
725 len = 0; 725 len = 0;
@@ -773,7 +773,7 @@ verify_sock_status:
773 } 773 }
774 found_fin_ok: 774 found_fin_ok:
775 if (!(flags & MSG_PEEK)) 775 if (!(flags & MSG_PEEK))
776 sk_eat_skb(sk, skb); 776 sk_eat_skb(sk, skb, 0);
777 break; 777 break;
778 } while (1); 778 } while (1);
779out: 779out:
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 1c0cfd7a8bbb..4e067d25a63c 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -1072,11 +1072,11 @@ int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
1072 break; 1072 break;
1073 } 1073 }
1074 if (skb->h.th->fin) { 1074 if (skb->h.th->fin) {
1075 sk_eat_skb(sk, skb); 1075 sk_eat_skb(sk, skb, 0);
1076 ++seq; 1076 ++seq;
1077 break; 1077 break;
1078 } 1078 }
1079 sk_eat_skb(sk, skb); 1079 sk_eat_skb(sk, skb, 0);
1080 if (!desc->count) 1080 if (!desc->count)
1081 break; 1081 break;
1082 } 1082 }
@@ -1356,14 +1356,14 @@ skip_copy:
1356 if (skb->h.th->fin) 1356 if (skb->h.th->fin)
1357 goto found_fin_ok; 1357 goto found_fin_ok;
1358 if (!(flags & MSG_PEEK)) 1358 if (!(flags & MSG_PEEK))
1359 sk_eat_skb(sk, skb); 1359 sk_eat_skb(sk, skb, 0);
1360 continue; 1360 continue;
1361 1361
1362 found_fin_ok: 1362 found_fin_ok:
1363 /* Process the FIN. */ 1363 /* Process the FIN. */
1364 ++*seq; 1364 ++*seq;
1365 if (!(flags & MSG_PEEK)) 1365 if (!(flags & MSG_PEEK))
1366 sk_eat_skb(sk, skb); 1366 sk_eat_skb(sk, skb, 0);
1367 break; 1367 break;
1368 } while (len > 0); 1368 } while (len > 0);
1369 1369
diff --git a/net/llc/af_llc.c b/net/llc/af_llc.c
index 5a04db745c8d..7465170a36ca 100644
--- a/net/llc/af_llc.c
+++ b/net/llc/af_llc.c
@@ -789,7 +789,7 @@ static int llc_ui_recvmsg(struct kiocb *iocb, struct socket *sock,
789 continue; 789 continue;
790 790
791 if (!(flags & MSG_PEEK)) { 791 if (!(flags & MSG_PEEK)) {
792 sk_eat_skb(sk, skb); 792 sk_eat_skb(sk, skb, 0);
793 *seq = 0; 793 *seq = 0;
794 } 794 }
795 } while (len > 0); 795 } while (len > 0);