tcp: remove RFC3517/RFC6675 hint state: lost_skb_hint, lost_cnt_hint
Now that obsolete RFC3517/RFC6675 TCP loss detection has been removed, we can remove the somewhat complex and intrusive code to maintain its hint state: lost_skb_hint and lost_cnt_hint. This commit makes tcp_clear_retrans_hints_partial() empty. We will remove tcp_clear_retrans_hints_partial() and its call sites in the next commit. Suggested-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: Neal Cardwell <ncardwell@google.com> Reviewed-by: Yuchung Cheng <ycheng@google.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Link: https://patch.msgid.link/20250615001435.2390793-3-ncardwell.sw@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
1c120191dc
commit
ba4618885b
@@ -115,7 +115,6 @@ u32 lost_out read_mostly read_m
|
||||
u32 sacked_out read_mostly read_mostly tcp_left_out(tx);tcp_packets_in_flight(tx/rx);tcp_clean_rtx_queue(rx)
|
||||
struct hrtimer pacing_timer
|
||||
struct hrtimer compressed_ack_timer
|
||||
struct sk_buff* lost_skb_hint read_mostly tcp_clean_rtx_queue
|
||||
struct sk_buff* retransmit_skb_hint read_mostly tcp_clean_rtx_queue
|
||||
struct rb_root out_of_order_queue read_mostly tcp_data_queue,tcp_fast_path_check
|
||||
struct sk_buff* ooo_last_skb
|
||||
@@ -123,7 +122,6 @@ struct tcp_sack_block[1] duplicate_sack
|
||||
struct tcp_sack_block[4] selective_acks
|
||||
struct tcp_sack_block[4] recv_sack_cache
|
||||
struct sk_buff* highest_sack read_write tcp_event_new_data_sent
|
||||
int lost_cnt_hint
|
||||
u32 prior_ssthresh
|
||||
u32 high_seq
|
||||
u32 retrans_stamp
|
||||
|
||||
@@ -208,7 +208,6 @@ struct tcp_sock {
|
||||
u32 notsent_lowat; /* TCP_NOTSENT_LOWAT */
|
||||
u16 gso_segs; /* Max number of segs per GSO packet */
|
||||
/* from STCP, retrans queue hinting */
|
||||
struct sk_buff *lost_skb_hint;
|
||||
struct sk_buff *retransmit_skb_hint;
|
||||
__cacheline_group_end(tcp_sock_read_tx);
|
||||
|
||||
@@ -419,8 +418,6 @@ struct tcp_sock {
|
||||
|
||||
struct tcp_sack_block recv_sack_cache[4];
|
||||
|
||||
int lost_cnt_hint;
|
||||
|
||||
u32 prior_ssthresh; /* ssthresh saved at recovery start */
|
||||
u32 high_seq; /* snd_nxt at onset of congestion */
|
||||
|
||||
|
||||
@@ -1813,7 +1813,6 @@ static inline void tcp_mib_init(struct net *net)
|
||||
/* from STCP */
|
||||
static inline void tcp_clear_retrans_hints_partial(struct tcp_sock *tp)
|
||||
{
|
||||
tp->lost_skb_hint = NULL;
|
||||
}
|
||||
|
||||
static inline void tcp_clear_all_retrans_hints(struct tcp_sock *tp)
|
||||
|
||||
+1
-2
@@ -5053,9 +5053,8 @@ static void __init tcp_struct_check(void)
|
||||
CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_read_tx, reordering);
|
||||
CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_read_tx, notsent_lowat);
|
||||
CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_read_tx, gso_segs);
|
||||
CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_read_tx, lost_skb_hint);
|
||||
CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_read_tx, retransmit_skb_hint);
|
||||
CACHELINE_ASSERT_GROUP_SIZE(struct tcp_sock, tcp_sock_read_tx, 40);
|
||||
CACHELINE_ASSERT_GROUP_SIZE(struct tcp_sock, tcp_sock_read_tx, 32);
|
||||
|
||||
/* TXRX read-mostly hotpath cache lines */
|
||||
CACHELINE_ASSERT_GROUP_MEMBER(struct tcp_sock, tcp_sock_read_txrx, tsoffset);
|
||||
|
||||
@@ -1451,11 +1451,6 @@ static u8 tcp_sacktag_one(struct sock *sk,
|
||||
tp->sacked_out += pcount;
|
||||
/* Out-of-order packets delivered */
|
||||
state->sack_delivered += pcount;
|
||||
|
||||
/* Lost marker hint past SACKed? Tweak RFC3517 cnt */
|
||||
if (tp->lost_skb_hint &&
|
||||
before(start_seq, TCP_SKB_CB(tp->lost_skb_hint)->seq))
|
||||
tp->lost_cnt_hint += pcount;
|
||||
}
|
||||
|
||||
/* D-SACK. We can detect redundant retransmission in S|R and plain R
|
||||
@@ -1496,9 +1491,6 @@ static bool tcp_shifted_skb(struct sock *sk, struct sk_buff *prev,
|
||||
tcp_skb_timestamp_us(skb));
|
||||
tcp_rate_skb_delivered(sk, skb, state->rate);
|
||||
|
||||
if (skb == tp->lost_skb_hint)
|
||||
tp->lost_cnt_hint += pcount;
|
||||
|
||||
TCP_SKB_CB(prev)->end_seq += shifted;
|
||||
TCP_SKB_CB(skb)->seq += shifted;
|
||||
|
||||
@@ -1531,10 +1523,6 @@ static bool tcp_shifted_skb(struct sock *sk, struct sk_buff *prev,
|
||||
|
||||
if (skb == tp->retransmit_skb_hint)
|
||||
tp->retransmit_skb_hint = prev;
|
||||
if (skb == tp->lost_skb_hint) {
|
||||
tp->lost_skb_hint = prev;
|
||||
tp->lost_cnt_hint -= tcp_skb_pcount(prev);
|
||||
}
|
||||
|
||||
TCP_SKB_CB(prev)->tcp_flags |= TCP_SKB_CB(skb)->tcp_flags;
|
||||
TCP_SKB_CB(prev)->eor = TCP_SKB_CB(skb)->eor;
|
||||
@@ -3318,8 +3306,6 @@ static int tcp_clean_rtx_queue(struct sock *sk, const struct sk_buff *ack_skb,
|
||||
next = skb_rb_next(skb);
|
||||
if (unlikely(skb == tp->retransmit_skb_hint))
|
||||
tp->retransmit_skb_hint = NULL;
|
||||
if (unlikely(skb == tp->lost_skb_hint))
|
||||
tp->lost_skb_hint = NULL;
|
||||
tcp_highest_sack_replace(sk, skb, next);
|
||||
tcp_rtx_queue_unlink_and_free(skb, sk);
|
||||
}
|
||||
@@ -3377,14 +3363,9 @@ static int tcp_clean_rtx_queue(struct sock *sk, const struct sk_buff *ack_skb,
|
||||
if (flag & FLAG_RETRANS_DATA_ACKED)
|
||||
flag &= ~FLAG_ORIG_SACK_ACKED;
|
||||
} else {
|
||||
int delta;
|
||||
|
||||
/* Non-retransmitted hole got filled? That's reordering */
|
||||
if (before(reord, prior_fack))
|
||||
tcp_check_sack_reordering(sk, reord, 0);
|
||||
|
||||
delta = prior_sacked - tp->sacked_out;
|
||||
tp->lost_cnt_hint -= min(tp->lost_cnt_hint, delta);
|
||||
}
|
||||
} else if (skb && rtt_update && sack_rtt_us >= 0 &&
|
||||
sack_rtt_us > tcp_stamp_us_delta(tp->tcp_mstamp,
|
||||
|
||||
@@ -1554,11 +1554,6 @@ static void tcp_adjust_pcount(struct sock *sk, const struct sk_buff *skb, int de
|
||||
if (tcp_is_reno(tp) && decr > 0)
|
||||
tp->sacked_out -= min_t(u32, tp->sacked_out, decr);
|
||||
|
||||
if (tp->lost_skb_hint &&
|
||||
before(TCP_SKB_CB(skb)->seq, TCP_SKB_CB(tp->lost_skb_hint)->seq) &&
|
||||
(TCP_SKB_CB(skb)->sacked & TCPCB_SACKED_ACKED))
|
||||
tp->lost_cnt_hint -= decr;
|
||||
|
||||
tcp_verify_left_out(tp);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user