[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <11973738393633-git-send-email-ilpo.jarvinen@helsinki.fi>
Date: Tue, 11 Dec 2007 13:50:38 +0200
From: "Ilpo Järvinen" <ilpo.jarvinen@...sinki.fi>
To: David Miller <davem@...emloft.net>
Cc: netdev@...r.kernel.org
Subject: [PATCH 1/2] [TCP]: Push fack_count calculation deeper into functions
This shouldn't have a significant impact because the call to
tcp_sacktag_one is typically made just once per ACK (this
doesn't hold if there were some ACK losses in between or the
receiver didn't generate all ACKs that it should have, but
those are not very likely events to occur).
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@...sinki.fi>
---
net/ipv4/tcp_input.c | 16 +++++++---------
1 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index 75a16b3..977c68c 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -1214,11 +1214,15 @@ static int tcp_match_skb_to_sack(struct sock *sk, struct sk_buff *skb,
}
static int tcp_sacktag_one(struct sk_buff *skb, struct sock *sk,
- int *reord, int dup_sack, int fack_count)
+ int *reord, int dup_sack)
{
struct tcp_sock *tp = tcp_sk(sk);
u8 sacked = TCP_SKB_CB(skb)->sacked;
int flag = 0;
+ int fack_count;
+
+ fack_count = TCP_SKB_CB(skb)->fack_count -
+ TCP_SKB_CB(tcp_write_queue_head(sk))->fack_count;
/* Account D-SACK for retransmitted packet. */
if (dup_sack && (sacked & TCPCB_RETRANS)) {
@@ -1315,13 +1319,9 @@ static struct sk_buff *tcp_sacktag_walk(struct sk_buff *skb, struct sock *sk,
int queue)
{
struct sk_buff *next;
- unsigned int fack_count_base;
-
- fack_count_base = TCP_SKB_CB(tcp_write_queue_head(sk))->fack_count;
tcp_for_write_queue_from_safe(skb, next, sk, queue) {
int in_sack = 0;
- unsigned int fack_count;
if (skb == tcp_send_head(sk))
break;
@@ -1334,10 +1334,8 @@ static struct sk_buff *tcp_sacktag_walk(struct sk_buff *skb, struct sock *sk,
if (unlikely(in_sack < 0))
break;
- if (in_sack) {
- fack_count = TCP_SKB_CB(skb)->fack_count - fack_count_base;
- *flag |= tcp_sacktag_one(skb, sk, reord, dup_sack, fack_count);
- }
+ if (in_sack)
+ *flag |= tcp_sacktag_one(skb, sk, reord, dup_sack);
}
return skb;
}
--
1.5.0.6
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists