Commit 1ed83465 authored by Pavel Emelyanov's avatar Pavel Emelyanov Committed by David S. Miller

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: default avatarPavel Emelyanov <xemul@openvz.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ca12a1a4
...@@ -1169,10 +1169,11 @@ static void tcp_mark_lost_retrans(struct sock *sk) ...@@ -1169,10 +1169,11 @@ static void tcp_mark_lost_retrans(struct sock *sk)
tp->lost_retrans_low = new_low_seq; tp->lost_retrans_low = new_low_seq;
} }
static int tcp_check_dsack(struct tcp_sock *tp, struct sk_buff *ack_skb, static int tcp_check_dsack(struct sock *sk, struct sk_buff *ack_skb,
struct tcp_sack_block_wire *sp, int num_sacks, struct tcp_sack_block_wire *sp, int num_sacks,
u32 prior_snd_una) u32 prior_snd_una)
{ {
struct tcp_sock *tp = tcp_sk(sk);
u32 start_seq_0 = get_unaligned_be32(&sp[0].start_seq); u32 start_seq_0 = get_unaligned_be32(&sp[0].start_seq);
u32 end_seq_0 = get_unaligned_be32(&sp[0].end_seq); u32 end_seq_0 = get_unaligned_be32(&sp[0].end_seq);
int dup_sack = 0; int dup_sack = 0;
...@@ -1434,7 +1435,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, ...@@ -1434,7 +1435,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb,
tcp_highest_sack_reset(sk); tcp_highest_sack_reset(sk);
} }
found_dup_sack = tcp_check_dsack(tp, ack_skb, sp_wire, found_dup_sack = tcp_check_dsack(sk, ack_skb, sp_wire,
num_sacks, prior_snd_una); num_sacks, prior_snd_una);
if (found_dup_sack) if (found_dup_sack)
flag |= FLAG_DSACKING_ACK; flag |= FLAG_DSACKING_ACK;
...@@ -3711,8 +3712,10 @@ static inline int tcp_sack_extend(struct tcp_sack_block *sp, u32 seq, ...@@ -3711,8 +3712,10 @@ static inline int tcp_sack_extend(struct tcp_sack_block *sp, u32 seq,
return 0; return 0;
} }
static void tcp_dsack_set(struct tcp_sock *tp, u32 seq, u32 end_seq) static void tcp_dsack_set(struct sock *sk, u32 seq, u32 end_seq)
{ {
struct tcp_sock *tp = tcp_sk(sk);
if (tcp_is_sack(tp) && sysctl_tcp_dsack) { if (tcp_is_sack(tp) && sysctl_tcp_dsack) {
int mib_idx; int mib_idx;
...@@ -3731,10 +3734,12 @@ static void tcp_dsack_set(struct tcp_sock *tp, u32 seq, u32 end_seq) ...@@ -3731,10 +3734,12 @@ static void tcp_dsack_set(struct tcp_sock *tp, u32 seq, u32 end_seq)
} }
} }
static void tcp_dsack_extend(struct tcp_sock *tp, u32 seq, u32 end_seq) static void tcp_dsack_extend(struct sock *sk, u32 seq, u32 end_seq)
{ {
struct tcp_sock *tp = tcp_sk(sk);
if (!tp->rx_opt.dsack) if (!tp->rx_opt.dsack)
tcp_dsack_set(tp, seq, end_seq); tcp_dsack_set(sk, seq, end_seq);
else else
tcp_sack_extend(tp->duplicate_sack, seq, end_seq); tcp_sack_extend(tp->duplicate_sack, seq, end_seq);
} }
...@@ -3753,7 +3758,7 @@ static void tcp_send_dupack(struct sock *sk, struct sk_buff *skb) ...@@ -3753,7 +3758,7 @@ static void tcp_send_dupack(struct sock *sk, struct sk_buff *skb)
if (after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) if (after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt))
end_seq = tp->rcv_nxt; end_seq = tp->rcv_nxt;
tcp_dsack_set(tp, TCP_SKB_CB(skb)->seq, end_seq); tcp_dsack_set(sk, TCP_SKB_CB(skb)->seq, end_seq);
} }
} }
...@@ -3906,7 +3911,7 @@ static void tcp_ofo_queue(struct sock *sk) ...@@ -3906,7 +3911,7 @@ static void tcp_ofo_queue(struct sock *sk)
__u32 dsack = dsack_high; __u32 dsack = dsack_high;
if (before(TCP_SKB_CB(skb)->end_seq, dsack_high)) if (before(TCP_SKB_CB(skb)->end_seq, dsack_high))
dsack_high = TCP_SKB_CB(skb)->end_seq; dsack_high = TCP_SKB_CB(skb)->end_seq;
tcp_dsack_extend(tp, TCP_SKB_CB(skb)->seq, dsack); tcp_dsack_extend(sk, TCP_SKB_CB(skb)->seq, dsack);
} }
if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) { if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) {
...@@ -4035,7 +4040,7 @@ queue_and_out: ...@@ -4035,7 +4040,7 @@ queue_and_out:
if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) { if (!after(TCP_SKB_CB(skb)->end_seq, tp->rcv_nxt)) {
/* A retransmit, 2nd most common case. Force an immediate ack. */ /* A retransmit, 2nd most common case. Force an immediate ack. */
NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKLOST); NET_INC_STATS_BH(LINUX_MIB_DELAYEDACKLOST);
tcp_dsack_set(tp, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq); tcp_dsack_set(sk, TCP_SKB_CB(skb)->seq, TCP_SKB_CB(skb)->end_seq);
out_of_window: out_of_window:
tcp_enter_quickack_mode(sk); tcp_enter_quickack_mode(sk);
...@@ -4057,7 +4062,7 @@ drop: ...@@ -4057,7 +4062,7 @@ drop:
tp->rcv_nxt, TCP_SKB_CB(skb)->seq, tp->rcv_nxt, TCP_SKB_CB(skb)->seq,
TCP_SKB_CB(skb)->end_seq); TCP_SKB_CB(skb)->end_seq);
tcp_dsack_set(tp, TCP_SKB_CB(skb)->seq, tp->rcv_nxt); tcp_dsack_set(sk, TCP_SKB_CB(skb)->seq, tp->rcv_nxt);
/* If window is closed, drop tail of packet. But after /* If window is closed, drop tail of packet. But after
* remembering D-SACK for its head made in previous line. * remembering D-SACK for its head made in previous line.
...@@ -4122,12 +4127,12 @@ drop: ...@@ -4122,12 +4127,12 @@ drop:
if (!after(end_seq, TCP_SKB_CB(skb1)->end_seq)) { if (!after(end_seq, TCP_SKB_CB(skb1)->end_seq)) {
/* All the bits are present. Drop. */ /* All the bits are present. Drop. */
__kfree_skb(skb); __kfree_skb(skb);
tcp_dsack_set(tp, seq, end_seq); tcp_dsack_set(sk, seq, end_seq);
goto add_sack; goto add_sack;
} }
if (after(seq, TCP_SKB_CB(skb1)->seq)) { if (after(seq, TCP_SKB_CB(skb1)->seq)) {
/* Partial overlap. */ /* Partial overlap. */
tcp_dsack_set(tp, seq, tcp_dsack_set(sk, seq,
TCP_SKB_CB(skb1)->end_seq); TCP_SKB_CB(skb1)->end_seq);
} else { } else {
skb1 = skb1->prev; skb1 = skb1->prev;
...@@ -4140,12 +4145,12 @@ drop: ...@@ -4140,12 +4145,12 @@ drop:
(struct sk_buff *)&tp->out_of_order_queue && (struct sk_buff *)&tp->out_of_order_queue &&
after(end_seq, TCP_SKB_CB(skb1)->seq)) { after(end_seq, TCP_SKB_CB(skb1)->seq)) {
if (before(end_seq, TCP_SKB_CB(skb1)->end_seq)) { if (before(end_seq, TCP_SKB_CB(skb1)->end_seq)) {
tcp_dsack_extend(tp, TCP_SKB_CB(skb1)->seq, tcp_dsack_extend(sk, TCP_SKB_CB(skb1)->seq,
end_seq); end_seq);
break; break;
} }
__skb_unlink(skb1, &tp->out_of_order_queue); __skb_unlink(skb1, &tp->out_of_order_queue);
tcp_dsack_extend(tp, TCP_SKB_CB(skb1)->seq, tcp_dsack_extend(sk, TCP_SKB_CB(skb1)->seq,
TCP_SKB_CB(skb1)->end_seq); TCP_SKB_CB(skb1)->end_seq);
__kfree_skb(skb1); __kfree_skb(skb1);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment