diff options
author | Yuchung Cheng <ycheng@google.com> | 2018-07-18 16:56:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-07-20 17:32:23 -0400 |
commit | 2987babb6982306509380fc11b450227a844493b (patch) | |
tree | 335148844dc2938c81979c8364867ad9978f6d2a /net/ipv4/tcp_output.c | |
parent | f7482683f1f4925c60941dbbd0813ceaa069d106 (diff) |
tcp: helpers to send special DCTCP ack
Refactor and create helpers to send the special ACK in DCTCP.
Signed-off-by: Yuchung Cheng <ycheng@google.com>
Acked-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_output.c')
-rw-r--r-- | net/ipv4/tcp_output.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 00e5a300ddb9..ee1b0705321d 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -1023,8 +1023,8 @@ static void tcp_update_skb_after_send(struct tcp_sock *tp, struct sk_buff *skb) | |||
1023 | * We are working here with either a clone of the original | 1023 | * We are working here with either a clone of the original |
1024 | * SKB, or a fresh unique copy made by the retransmit engine. | 1024 | * SKB, or a fresh unique copy made by the retransmit engine. |
1025 | */ | 1025 | */ |
1026 | static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, | 1026 | static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, |
1027 | gfp_t gfp_mask) | 1027 | int clone_it, gfp_t gfp_mask, u32 rcv_nxt) |
1028 | { | 1028 | { |
1029 | const struct inet_connection_sock *icsk = inet_csk(sk); | 1029 | const struct inet_connection_sock *icsk = inet_csk(sk); |
1030 | struct inet_sock *inet; | 1030 | struct inet_sock *inet; |
@@ -1100,7 +1100,7 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, | |||
1100 | th->source = inet->inet_sport; | 1100 | th->source = inet->inet_sport; |
1101 | th->dest = inet->inet_dport; | 1101 | th->dest = inet->inet_dport; |
1102 | th->seq = htonl(tcb->seq); | 1102 | th->seq = htonl(tcb->seq); |
1103 | th->ack_seq = htonl(tp->rcv_nxt); | 1103 | th->ack_seq = htonl(rcv_nxt); |
1104 | *(((__be16 *)th) + 6) = htons(((tcp_header_size >> 2) << 12) | | 1104 | *(((__be16 *)th) + 6) = htons(((tcp_header_size >> 2) << 12) | |
1105 | tcb->tcp_flags); | 1105 | tcb->tcp_flags); |
1106 | 1106 | ||
@@ -1178,6 +1178,13 @@ static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, | |||
1178 | return err; | 1178 | return err; |
1179 | } | 1179 | } |
1180 | 1180 | ||
1181 | static int tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, int clone_it, | ||
1182 | gfp_t gfp_mask) | ||
1183 | { | ||
1184 | return __tcp_transmit_skb(sk, skb, clone_it, gfp_mask, | ||
1185 | tcp_sk(sk)->rcv_nxt); | ||
1186 | } | ||
1187 | |||
1181 | /* This routine just queues the buffer for sending. | 1188 | /* This routine just queues the buffer for sending. |
1182 | * | 1189 | * |
1183 | * NOTE: probe0 timer is not checked, do not forget tcp_push_pending_frames, | 1190 | * NOTE: probe0 timer is not checked, do not forget tcp_push_pending_frames, |
@@ -3571,7 +3578,7 @@ void tcp_send_delayed_ack(struct sock *sk) | |||
3571 | } | 3578 | } |
3572 | 3579 | ||
3573 | /* This routine sends an ack and also updates the window. */ | 3580 | /* This routine sends an ack and also updates the window. */ |
3574 | void tcp_send_ack(struct sock *sk) | 3581 | void __tcp_send_ack(struct sock *sk, u32 rcv_nxt) |
3575 | { | 3582 | { |
3576 | struct sk_buff *buff; | 3583 | struct sk_buff *buff; |
3577 | 3584 | ||
@@ -3604,7 +3611,12 @@ void tcp_send_ack(struct sock *sk) | |||
3604 | skb_set_tcp_pure_ack(buff); | 3611 | skb_set_tcp_pure_ack(buff); |
3605 | 3612 | ||
3606 | /* Send it off, this clears delayed acks for us. */ | 3613 | /* Send it off, this clears delayed acks for us. */ |
3607 | tcp_transmit_skb(sk, buff, 0, (__force gfp_t)0); | 3614 | __tcp_transmit_skb(sk, buff, 0, (__force gfp_t)0, rcv_nxt); |
3615 | } | ||
3616 | |||
3617 | void tcp_send_ack(struct sock *sk) | ||
3618 | { | ||
3619 | __tcp_send_ack(sk, tcp_sk(sk)->rcv_nxt); | ||
3608 | } | 3620 | } |
3609 | EXPORT_SYMBOL_GPL(tcp_send_ack); | 3621 | EXPORT_SYMBOL_GPL(tcp_send_ack); |
3610 | 3622 | ||