Messages in this thread Patch in this message | | | Date | Mon, 8 Mar 1999 22:23:58 +0100 (CET) | From | Andrea Arcangeli <> | Subject | [patch] little TCP optimizations |
| |
I did some little TCP optimization. Patch against 2.2.2.
Index: include/linux/skbuff.h =================================================================== RCS file: /var/cvs/linux/include/linux/skbuff.h,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 skbuff.h --- skbuff.h 1999/01/18 01:27:09 1.1.1.1 +++ linux/include/linux/skbuff.h 1999/03/08 21:13:55 @@ -168,7 +168,7 @@ extern __inline__ int skb_queue_empty(struct sk_buff_head *list) { - return (list->next == (struct sk_buff *) list); + return !list->qlen; } extern __inline__ void kfree_skb(struct sk_buff *skb) Index: net/ipv4//tcp_input.c =================================================================== RCS file: /var/cvs/linux/net/ipv4/tcp_input.c,v retrieving revision 1.1.1.6 diff -u -r1.1.1.6 tcp_input.c --- tcp_input.c 1999/02/23 16:48:26 1.1.1.6 +++ linux/net/ipv4/tcp_input.c 1999/03/08 21:15:31 @@ -1415,7 +1415,7 @@ SOCK_DEBUG(sk, "out of order segment: rcv_next %X seq %X - %X\n", tp->rcv_nxt, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq); - if (skb_peek(&tp->out_of_order_queue) == NULL) { + if (skb_queue_empty(&tp->out_of_order_queue)) { /* Initial out of order segment, build 1 SACK. */ if(tp->sack_ok) { tp->num_sacks = 1; @@ -1580,7 +1601,7 @@ /* We entered "quick ACK" mode or... */ tcp_in_quickack_mode(tp) || /* We have out of order data */ - (skb_peek(&tp->out_of_order_queue) != NULL)) { + skb_queue_len(&tp->out_of_order_queue)) { /* Then ack it now */ tcp_send_ack(sk); } else { Index: net/core/datagram.c =================================================================== RCS file: /var/cvs/linux/net/core/datagram.c,v retrieving revision 1.1.1.1 diff -u -r1.1.1.1 datagram.c --- datagram.c 1999/01/18 01:27:49 1.1.1.1 +++ linux/net/core/datagram.c 1999/03/08 21:14:07 @@ -59,7 +59,7 @@ add_wait_queue(sk->sleep, &wait); current->state = TASK_INTERRUPTIBLE; - if (skb_peek(&sk->receive_queue) == NULL) + if (skb_queue_empty(&sk->receive_queue)) schedule(); current->state = TASK_RUNNING;
Andrea Arcangeli
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/
| |