Comments
Patch
@@ -3263,7 +3263,7 @@ static int tcp_clean_rtx_queue(struct so
flag |= FLAG_NONHEAD_RETRANS_ACKED;
} else {
ca_seq_rtt = now - scb->when;
- last_ackt = skb->tstamp;
+ last_ackt = skb_get_ktime(skb);
if (seq_rtt < 0) {
seq_rtt = ca_seq_rtt;
}
@@ -3345,9 +3345,8 @@ static int tcp_clean_rtx_queue(struct so
/* Is the ACK triggering packet unambiguous? */
if (!(flag & FLAG_RETRANS_DATA_ACKED)) {
/* High resolution needed and available? */
- if (ca_ops->flags & TCP_CONG_RTT_STAMP &&
- !ktime_equal(last_ackt,
- net_invalid_timestamp()))
+ if ((ca_ops->flags & TCP_CONG_RTT_STAMP) &&
+ net_timestamp_isvalid(last_ackt))
rtt_us = ktime_us_delta(ktime_get_real(),
last_ackt);
else if (ca_seq_rtt >= 0)
@@ -1965,6 +1965,11 @@ static inline ktime_t net_invalid_timest
return ktime_set(0, 0);
}
+static inline bool net_timestamp_isvalid(ktime_t t)
+{
+ return !ktime_equal(t, net_invalid_timestamp());
+}
+
extern void skb_timestamping_init(void);
#ifdef CONFIG_NETWORK_PHY_TIMESTAMPING
Use inline functions to make the checking of ack timestamp clearer. Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html