Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 52509afd authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman
Browse files

Revert "tcp: ensure to use the most recently sent skb when filling the rate sample"



This reverts commit 2cba6355 which is
commit b253a0680ceadc5d7b4acca7aa2d870326cad8ad upstream.

It breaks the abi and is not needed for Android systems, so revert it.

Bug: 161946584
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
Change-Id: I6c40e8900bcc80b03e3d5fb2c99c9e95615b81ff
parent aa172204
Loading
Loading
Loading
Loading
+0 −6
Original line number Original line Diff line number Diff line
@@ -1031,7 +1031,6 @@ struct rate_sample {
	int  losses;		/* number of packets marked lost upon ACK */
	int  losses;		/* number of packets marked lost upon ACK */
	u32  acked_sacked;	/* number of packets newly (S)ACKed upon ACK */
	u32  acked_sacked;	/* number of packets newly (S)ACKed upon ACK */
	u32  prior_in_flight;	/* in flight before this ACK */
	u32  prior_in_flight;	/* in flight before this ACK */
	u32  last_end_seq;	/* end_seq of most recently ACKed packet */
	bool is_app_limited;	/* is sample from packet with bubble in pipe? */
	bool is_app_limited;	/* is sample from packet with bubble in pipe? */
	bool is_retrans;	/* is sample from retransmission? */
	bool is_retrans;	/* is sample from retransmission? */
	bool is_ack_delayed;	/* is this (likely) a delayed ACK? */
	bool is_ack_delayed;	/* is this (likely) a delayed ACK? */
@@ -1141,11 +1140,6 @@ void tcp_rate_gen(struct sock *sk, u32 delivered, u32 lost,
		  bool is_sack_reneg, struct rate_sample *rs);
		  bool is_sack_reneg, struct rate_sample *rs);
void tcp_rate_check_app_limited(struct sock *sk);
void tcp_rate_check_app_limited(struct sock *sk);


static inline bool tcp_skb_sent_after(u64 t1, u64 t2, u32 seq1, u32 seq2)
{
	return t1 > t2 || (t1 == t2 && after(seq1, seq2));
}

/* These functions determine how the current flow behaves in respect of SACK
/* These functions determine how the current flow behaves in respect of SACK
 * handling. SACK is negotiated with the peer, and therefore it can vary
 * handling. SACK is negotiated with the peer, and therefore it can vary
 * between different flows.
 * between different flows.
+3 −8
Original line number Original line Diff line number Diff line
@@ -73,31 +73,26 @@ void tcp_rate_skb_sent(struct sock *sk, struct sk_buff *skb)
 *
 *
 * If an ACK (s)acks multiple skbs (e.g., stretched-acks), this function is
 * If an ACK (s)acks multiple skbs (e.g., stretched-acks), this function is
 * called multiple times. We favor the information from the most recently
 * called multiple times. We favor the information from the most recently
 * sent skb, i.e., the skb with the most recently sent time and the highest
 * sent skb, i.e., the skb with the highest prior_delivered count.
 * sequence.
 */
 */
void tcp_rate_skb_delivered(struct sock *sk, struct sk_buff *skb,
void tcp_rate_skb_delivered(struct sock *sk, struct sk_buff *skb,
			    struct rate_sample *rs)
			    struct rate_sample *rs)
{
{
	struct tcp_sock *tp = tcp_sk(sk);
	struct tcp_sock *tp = tcp_sk(sk);
	struct tcp_skb_cb *scb = TCP_SKB_CB(skb);
	struct tcp_skb_cb *scb = TCP_SKB_CB(skb);
	u64 tx_tstamp;


	if (!scb->tx.delivered_mstamp)
	if (!scb->tx.delivered_mstamp)
		return;
		return;


	tx_tstamp = tcp_skb_timestamp_us(skb);
	if (!rs->prior_delivered ||
	if (!rs->prior_delivered ||
	    tcp_skb_sent_after(tx_tstamp, tp->first_tx_mstamp,
	    after(scb->tx.delivered, rs->prior_delivered)) {
			       scb->end_seq, rs->last_end_seq)) {
		rs->prior_delivered  = scb->tx.delivered;
		rs->prior_delivered  = scb->tx.delivered;
		rs->prior_mstamp     = scb->tx.delivered_mstamp;
		rs->prior_mstamp     = scb->tx.delivered_mstamp;
		rs->is_app_limited   = scb->tx.is_app_limited;
		rs->is_app_limited   = scb->tx.is_app_limited;
		rs->is_retrans	     = scb->sacked & TCPCB_RETRANS;
		rs->is_retrans	     = scb->sacked & TCPCB_RETRANS;
		rs->last_end_seq     = scb->end_seq;


		/* Record send time of most recently ACKed packet: */
		/* Record send time of most recently ACKed packet: */
		tp->first_tx_mstamp  = tx_tstamp;
		tp->first_tx_mstamp  = tcp_skb_timestamp_us(skb);
		/* Find the duration of the "send phase" of this window: */
		/* Find the duration of the "send phase" of this window: */
		rs->interval_us = tcp_stamp_us_delta(tp->first_tx_mstamp,
		rs->interval_us = tcp_stamp_us_delta(tp->first_tx_mstamp,
						     scb->tx.first_tx_mstamp);
						     scb->tx.first_tx_mstamp);