Skip to content

Commit fd21467

Browse files
yuchungchengdavem330
authored andcommitted
tcp: move tcp_mark_skb_lost
A pure refactor to move tcp_mark_skb_lost to tcp_input.c to prepare for the later loss marking consolidation. Signed-off-by: Yuchung Cheng <[email protected]> Signed-off-by: Neal Cardwell <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 179ac35 commit fd21467

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

net/ipv4/tcp_input.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,6 +1016,20 @@ static void tcp_verify_retransmit_hint(struct tcp_sock *tp, struct sk_buff *skb)
10161016
tp->retransmit_skb_hint = skb;
10171017
}
10181018

1019+
void tcp_mark_skb_lost(struct sock *sk, struct sk_buff *skb)
1020+
{
1021+
struct tcp_sock *tp = tcp_sk(sk);
1022+
1023+
tcp_skb_mark_lost_uncond_verify(tp, skb);
1024+
if (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_RETRANS) {
1025+
/* Account for retransmits that are lost again */
1026+
TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS;
1027+
tp->retrans_out -= tcp_skb_pcount(skb);
1028+
NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPLOSTRETRANSMIT,
1029+
tcp_skb_pcount(skb));
1030+
}
1031+
}
1032+
10191033
/* Sum the number of packets on the wire we have marked as lost.
10201034
* There are two cases we care about here:
10211035
* a) Packet hasn't been marked lost (nor retransmitted),

net/ipv4/tcp_recovery.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,6 @@
22
#include <linux/tcp.h>
33
#include <net/tcp.h>
44

5-
void tcp_mark_skb_lost(struct sock *sk, struct sk_buff *skb)
6-
{
7-
struct tcp_sock *tp = tcp_sk(sk);
8-
9-
tcp_skb_mark_lost_uncond_verify(tp, skb);
10-
if (TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_RETRANS) {
11-
/* Account for retransmits that are lost again */
12-
TCP_SKB_CB(skb)->sacked &= ~TCPCB_SACKED_RETRANS;
13-
tp->retrans_out -= tcp_skb_pcount(skb);
14-
NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPLOSTRETRANSMIT,
15-
tcp_skb_pcount(skb));
16-
}
17-
}
18-
195
static bool tcp_rack_sent_after(u64 t1, u64 t2, u32 seq1, u32 seq2)
206
{
217
return t1 > t2 || (t1 == t2 && after(seq1, seq2));

0 commit comments

Comments
 (0)