diff options
author | Pavel Emelyanov <xemul@openvz.org> | 2008-07-16 23:29:51 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-07-16 23:29:51 -0400 |
commit | 1ed834655a0d42ecd80ff051e681e2ea44747b6c (patch) | |
tree | 065943419a374616442027fc60c499565e1f16d5 /net | |
parent | ca12a1a443a51298afcca627ad0bcbd8ad1dcddc (diff) |
tcp: replace tcp_sock argument with sock in some places
These places have a tcp_sock, but we'd prefer the sock itself to
get net from it. Fortunately, tcp_sk macro is just a type cast, so
this replace is really cheap.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv4/tcp_input.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 01e8004911b4..f50d8433f042 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -1169,10 +1169,11 @@ static void tcp_mark_lost_retrans(struct sock *sk) | |||
1169 | tp->lost_retrans_low = new_low_seq; | 1169 | tp->lost_retrans_low = new_low_seq; |
1170 | } | 1170 | } |
1171 | 1171 | ||
1172 | static int tcp_check_dsack(struct tcp_sock *tp, struct sk_buff *ack_skb, | 1172 | static int tcp_check_dsack(struct sock *sk, struct sk_buff *ack_skb, |
1173 | struct tcp_sack_block_wire *sp, int num_sacks, | 1173 | struct tcp_sack_block_wire *sp, int num_sacks, |
1174 | u32 prior_snd_una) | 1174 | u32 prior_snd_una) |
1175 | { | 1175 | { |
1176 | struct tcp_sock *tp = tcp_sk(sk); | ||
1176 | u32 start_seq_0 = get_unaligned_be32(&sp[0].start_seq); | 1177 | u32 start_seq_0 = get_unaligned_be32(&sp[0].start_seq); |
1177 | u32 end_seq_0 = get_unaligned_be32(&sp[0].end_seq); | 1178 | u32 end_seq_0 = get_unaligned_be32(&sp[0].end_seq); |
1178 | int dup_sack = 0; | 1179 | int dup_sack = 0; |
@@ -1434,7 +1435,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, | |||
1434 | tcp_highest_sack_reset(sk); | 1435 | tcp_highest_sack_reset(sk); |
1435 | } | 1436 | } |
1436 | 1437 | ||
1437 | found_dup_sack = tcp_check_dsack(tp, ack_skb, sp_wire, | 1438 | found_dup_sack = tcp_check_dsack(sk, ack_skb, sp_wire, |
1438 | num_sacks, prior_snd_una); | 1439 | num_sacks, prior_snd_una); |
1439 | if (found_dup_sack) | 1440 | if (found_dup_sack) |
1440 | flag |= FLAG_DSACKING_ACK; | 1441 | flag |= FLAG_DSACKING_ACK; |
@@ -3711,8 +3712,10 @@ static inline int tcp_sack_extend(struct tcp_sack_block *sp, u32 seq, | |||
3711 | return 0; | 3712 | return 0; |
3712 | } | 3713 | } |
3713 | 3714 | ||
3714 | static void tcp_dsack_set(struct tcp_sock *tp, u32 seq, u32 end_seq) | 3715 | static void tcp_dsack_set(struct sock *sk, u32 seq, u32 end_seq) |
3715 | { | 3716 | { |
3717 | struct tcp_sock *tp = tcp_sk(sk); | ||
3718 | |||
3716 | if (tcp_is_sack(tp) && sysctl_tcp_dsack) { | 3719 | if (tcp_is_sack(tp) && sysctl_tcp_dsack) { |
3717 | int mib_idx; | 3720 | int mib_idx; |
3718 | 3721 | ||
@@ -3731,10 +3734,12 @@ static void tcp_dsack_set(struct tcp_sock *tp, u32 seq, u32 end_seq) | |||
3731 | } | 3734 | } |
3732 | } | 3735 | } |
3733 | 3736 | ||
3734 | static void tcp_dsack_extend(struct tcp_sock *tp, u32 seq, u32 end_seq) | 3737 | static void tcp_dsack_extend(struct sock *sk, u32 seq, u32 end_seq) |
3735 | { | 3738 | { |
3739 | struct tcp_sock *tp = tcp_sk(sk); | ||
3740 | |||
3736 | if (!tp->rx_opt.dsack) | 3741 | if (!tp->rx_opt.dsack) |
3737 | tcp_dsack_set(tp, seq, end_seq); | 3742 | tcp_dsack_set(sk, seq, end_seq); |
3738 | else | 3743 | else |
3739 | tcp_sack_extend(tp->duplicate_sack, seq, end_seq); | 3744 | tcp_sack_extend(tp->duplicate_sack, seq, end_seq); |
3740 | } | 3745 | } |
@@ -3753,7 +3758,7 @@ static void tcp_send_dupack(struct sock *sk, struct sk_buff *skb) | |||
3753 | 3758 | ||
3754 | if (after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) | 3759 | if (after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) |
3755 | end_seq = tp->rcv_nxt; | 3760 | end_seq = tp->rcv_nxt; |
3756 | tcp_dsack_set(tp, TCP_SKB_CB(skb)->seq, end_seq); | 3761 | tcp_dsack_set(sk, TCP_SKB_CB(skb)->seq, end_seq); |
3757 | } | 3762 | } |
3758 | } | 3763 | } |
3759 | 3764 | ||
@@ -3906,7 +3911,7 @@ static void tcp_ofo_queue(struct sock *sk) | |||
3906 | __u32 dsack = dsack_high; | 3911 | __u32 dsack = dsack_high; |
3907 | if (before(TCP_SKB_CB(skb)->end_seq, dsack_high)) | 3912 | if (before(TCP_SKB_CB(skb)->end_seq, dsack_high)) |
3908 | dsack_high = TCP_SKB_CB(skb)->end_seq; | 3913 | dsack_high = TCP_SKB_CB(skb)->end_seq; |
3909 | tcp_dsack_extend(tp, TCP_SKB_CB(skb)->seq, dsack); | 3914 | tcp_dsack_extend(sk, TCP_SKB_CB(skb)->seq, dsack); |
3910 | } | 3915 | } |
3911 | 3916 | ||
3912 | if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) { | 3917 | if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) { |
@@ -4035,7 +4040,7 @@ queue_and_out: | |||
4035 | if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) { | 4040 | if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) { |
4036 | /* A retransmit, 2nd most common case. Force an immediate ack. */ | 4041 | /* A retransmit, 2nd most common case. Force an immediate ack. */ |
4037 | NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKLOST); | 4042 | NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKLOST); |
4038 | tcp_dsack_set(tp, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq); | 4043 | tcp_dsack_set(sk, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq); |
4039 | 4044 | ||
4040 | out_of_window: | 4045 | out_of_window: |
4041 | tcp_enter_quickack_mode(sk); | 4046 | tcp_enter_quickack_mode(sk); |
@@ -4057,7 +4062,7 @@ drop: | |||
4057 | tp->rcv_nxt, TCP_SKB_CB(skb)->seq, | 4062 | tp->rcv_nxt, TCP_SKB_CB(skb)->seq, |
4058 | TCP_SKB_CB(skb)->end_seq); | 4063 | TCP_SKB_CB(skb)->end_seq); |
4059 | 4064 | ||
4060 | tcp_dsack_set(tp, TCP_SKB_CB(skb)->seq, tp->rcv_nxt); | 4065 | tcp_dsack_set(sk, TCP_SKB_CB(skb)->seq, tp->rcv_nxt); |
4061 | 4066 | ||
4062 | /* If window is closed, drop tail of packet. But after | 4067 | /* If window is closed, drop tail of packet. But after |
4063 | * remembering D-SACK for its head made in previous line. | 4068 | * remembering D-SACK for its head made in previous line. |
@@ -4122,12 +4127,12 @@ drop: | |||
4122 | if (!after(end_seq, TCP_SKB_CB(skb1)->end_seq)) { | 4127 | if (!after(end_seq, TCP_SKB_CB(skb1)->end_seq)) { |
4123 | /* All the bits are present. Drop. */ | 4128 | /* All the bits are present. Drop. */ |
4124 | __kfree_skb(skb); | 4129 | __kfree_skb(skb); |
4125 | tcp_dsack_set(tp, seq, end_seq); | 4130 | tcp_dsack_set(sk, seq, end_seq); |
4126 | goto add_sack; | 4131 | goto add_sack; |
4127 | } | 4132 | } |
4128 | if (after(seq, TCP_SKB_CB(skb1)->seq)) { | 4133 | if (after(seq, TCP_SKB_CB(skb1)->seq)) { |
4129 | /* Partial overlap. */ | 4134 | /* Partial overlap. */ |
4130 | tcp_dsack_set(tp, seq, | 4135 | tcp_dsack_set(sk, seq, |
4131 | TCP_SKB_CB(skb1)->end_seq); | 4136 | TCP_SKB_CB(skb1)->end_seq); |
4132 | } else { | 4137 | } else { |
4133 | skb1 = skb1->prev; | 4138 | skb1 = skb1->prev; |
@@ -4140,12 +4145,12 @@ drop: | |||
4140 | (struct sk_buff *)&tp->out_of_order_queue && | 4145 | (struct sk_buff *)&tp->out_of_order_queue && |
4141 | after(end_seq, TCP_SKB_CB(skb1)->seq)) { | 4146 | after(end_seq, TCP_SKB_CB(skb1)->seq)) { |
4142 | if (before(end_seq, TCP_SKB_CB(skb1)->end_seq)) { | 4147 | if (before(end_seq, TCP_SKB_CB(skb1)->end_seq)) { |
4143 | tcp_dsack_extend(tp, TCP_SKB_CB(skb1)->seq, | 4148 | tcp_dsack_extend(sk, TCP_SKB_CB(skb1)->seq, |
4144 | end_seq); | 4149 | end_seq); |
4145 | break; | 4150 | break; |
4146 | } | 4151 | } |
4147 | __skb_unlink(skb1, &tp->out_of_order_queue); | 4152 | __skb_unlink(skb1, &tp->out_of_order_queue); |
4148 | tcp_dsack_extend(tp, TCP_SKB_CB(skb1)->seq, | 4153 | tcp_dsack_extend(sk, TCP_SKB_CB(skb1)->seq, |
4149 | TCP_SKB_CB(skb1)->end_seq); | 4154 | TCP_SKB_CB(skb1)->end_seq); |
4150 | __kfree_skb(skb1); | 4155 | __kfree_skb(skb1); |
4151 | } | 4156 | } |