diff options
-rw-r--r-- | include/linux/ktime.h | 12 | ||||
-rw-r--r-- | include/linux/skbuff.h | 4 | ||||
-rw-r--r-- | net/ipv4/tcp_illinois.c | 3 | ||||
-rw-r--r-- | net/ipv4/tcp_input.c | 15 | ||||
-rw-r--r-- | net/ipv4/tcp_lp.c | 3 | ||||
-rw-r--r-- | net/ipv4/tcp_vegas.c | 3 | ||||
-rw-r--r-- | net/ipv4/tcp_veno.c | 3 | ||||
-rw-r--r-- | net/rxrpc/ar-connection.c | 2 |
8 files changed, 38 insertions, 7 deletions
diff --git a/include/linux/ktime.h b/include/linux/ktime.h index c762954bda14..2b139f66027f 100644 --- a/include/linux/ktime.h +++ b/include/linux/ktime.h | |||
@@ -261,6 +261,18 @@ static inline s64 ktime_to_ns(const ktime_t kt) | |||
261 | 261 | ||
262 | #endif | 262 | #endif |
263 | 263 | ||
264 | /** | ||
265 | * ktime_equal - Compares two ktime_t variables to see if they are equal | ||
266 | * @cmp1: comparable1 | ||
267 | * @cmp2: comparable2 | ||
268 | * | ||
269 | * Compare two ktime_t variables, returns 1 if equal | ||
270 | */ | ||
271 | static inline int ktime_equal(const ktime_t cmp1, const ktime_t cmp2) | ||
272 | { | ||
273 | return cmp1.tv64 == cmp2.tv64; | ||
274 | } | ||
275 | |||
264 | static inline s64 ktime_to_us(const ktime_t kt) | 276 | static inline s64 ktime_to_us(const ktime_t kt) |
265 | { | 277 | { |
266 | struct timeval tv = ktime_to_timeval(kt); | 278 | struct timeval tv = ktime_to_timeval(kt); |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index e7367c74e1bb..6f0b2f7d0010 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1579,6 +1579,10 @@ static inline ktime_t net_timedelta(ktime_t t) | |||
1579 | return ktime_sub(ktime_get_real(), t); | 1579 | return ktime_sub(ktime_get_real(), t); |
1580 | } | 1580 | } |
1581 | 1581 | ||
1582 | static inline ktime_t net_invalid_timestamp(void) | ||
1583 | { | ||
1584 | return ktime_set(0, 0); | ||
1585 | } | ||
1582 | 1586 | ||
1583 | extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); | 1587 | extern __sum16 __skb_checksum_complete_head(struct sk_buff *skb, int len); |
1584 | extern __sum16 __skb_checksum_complete(struct sk_buff *skb); | 1588 | extern __sum16 __skb_checksum_complete(struct sk_buff *skb); |
diff --git a/net/ipv4/tcp_illinois.c b/net/ipv4/tcp_illinois.c index 4adc47c55351..b2b2256d3b84 100644 --- a/net/ipv4/tcp_illinois.c +++ b/net/ipv4/tcp_illinois.c | |||
@@ -90,6 +90,9 @@ static void tcp_illinois_acked(struct sock *sk, u32 pkts_acked, ktime_t last) | |||
90 | 90 | ||
91 | ca->acked = pkts_acked; | 91 | ca->acked = pkts_acked; |
92 | 92 | ||
93 | if (ktime_equal(last, net_invalid_timestamp())) | ||
94 | return; | ||
95 | |||
93 | rtt = ktime_to_us(net_timedelta(last)); | 96 | rtt = ktime_to_us(net_timedelta(last)); |
94 | 97 | ||
95 | /* ignore bogus values, this prevents wraparound in alpha math */ | 98 | /* ignore bogus values, this prevents wraparound in alpha math */ |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index d6d0f9b6cdc6..69f9f1ef3ef6 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -953,7 +953,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ | |||
953 | int prior_fackets; | 953 | int prior_fackets; |
954 | u32 lost_retrans = 0; | 954 | u32 lost_retrans = 0; |
955 | int flag = 0; | 955 | int flag = 0; |
956 | int dup_sack = 0; | 956 | int found_dup_sack = 0; |
957 | int cached_fack_count; | 957 | int cached_fack_count; |
958 | int i; | 958 | int i; |
959 | int first_sack_index; | 959 | int first_sack_index; |
@@ -964,20 +964,20 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ | |||
964 | 964 | ||
965 | /* Check for D-SACK. */ | 965 | /* Check for D-SACK. */ |
966 | if (before(ntohl(sp[0].start_seq), TCP_SKB_CB(ack_skb)->ack_seq)) { | 966 | if (before(ntohl(sp[0].start_seq), TCP_SKB_CB(ack_skb)->ack_seq)) { |
967 | dup_sack = 1; | 967 | found_dup_sack = 1; |
968 | tp->rx_opt.sack_ok |= 4; | 968 | tp->rx_opt.sack_ok |= 4; |
969 | NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV); | 969 | NET_INC_STATS_BH(LINUX_MIB_TCPDSACKRECV); |
970 | } else if (num_sacks > 1 && | 970 | } else if (num_sacks > 1 && |
971 | !after(ntohl(sp[0].end_seq), ntohl(sp[1].end_seq)) && | 971 | !after(ntohl(sp[0].end_seq), ntohl(sp[1].end_seq)) && |
972 | !before(ntohl(sp[0].start_seq), ntohl(sp[1].start_seq))) { | 972 | !before(ntohl(sp[0].start_seq), ntohl(sp[1].start_seq))) { |
973 | dup_sack = 1; | 973 | found_dup_sack = 1; |
974 | tp->rx_opt.sack_ok |= 4; | 974 | tp->rx_opt.sack_ok |= 4; |
975 | NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOFORECV); | 975 | NET_INC_STATS_BH(LINUX_MIB_TCPDSACKOFORECV); |
976 | } | 976 | } |
977 | 977 | ||
978 | /* D-SACK for already forgotten data... | 978 | /* D-SACK for already forgotten data... |
979 | * Do dumb counting. */ | 979 | * Do dumb counting. */ |
980 | if (dup_sack && | 980 | if (found_dup_sack && |
981 | !after(ntohl(sp[0].end_seq), prior_snd_una) && | 981 | !after(ntohl(sp[0].end_seq), prior_snd_una) && |
982 | after(ntohl(sp[0].end_seq), tp->undo_marker)) | 982 | after(ntohl(sp[0].end_seq), tp->undo_marker)) |
983 | tp->undo_retrans--; | 983 | tp->undo_retrans--; |
@@ -1058,6 +1058,7 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ | |||
1058 | __u32 start_seq = ntohl(sp->start_seq); | 1058 | __u32 start_seq = ntohl(sp->start_seq); |
1059 | __u32 end_seq = ntohl(sp->end_seq); | 1059 | __u32 end_seq = ntohl(sp->end_seq); |
1060 | int fack_count; | 1060 | int fack_count; |
1061 | int dup_sack = (found_dup_sack && (i == first_sack_index)); | ||
1061 | 1062 | ||
1062 | skb = cached_skb; | 1063 | skb = cached_skb; |
1063 | fack_count = cached_fack_count; | 1064 | fack_count = cached_fack_count; |
@@ -2409,7 +2410,7 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p) | |||
2409 | int acked = 0; | 2410 | int acked = 0; |
2410 | int prior_packets = tp->packets_out; | 2411 | int prior_packets = tp->packets_out; |
2411 | __s32 seq_rtt = -1; | 2412 | __s32 seq_rtt = -1; |
2412 | ktime_t last_ackt = ktime_set(0,0); | 2413 | ktime_t last_ackt = net_invalid_timestamp(); |
2413 | 2414 | ||
2414 | while ((skb = tcp_write_queue_head(sk)) && | 2415 | while ((skb = tcp_write_queue_head(sk)) && |
2415 | skb != tcp_send_head(sk)) { | 2416 | skb != tcp_send_head(sk)) { |
@@ -2487,6 +2488,10 @@ static int tcp_clean_rtx_queue(struct sock *sk, __s32 *seq_rtt_p) | |||
2487 | tcp_ack_update_rtt(sk, acked, seq_rtt); | 2488 | tcp_ack_update_rtt(sk, acked, seq_rtt); |
2488 | tcp_ack_packets_out(sk); | 2489 | tcp_ack_packets_out(sk); |
2489 | 2490 | ||
2491 | /* Is the ACK triggering packet unambiguous? */ | ||
2492 | if (acked & FLAG_RETRANS_DATA_ACKED) | ||
2493 | last_ackt = net_invalid_timestamp(); | ||
2494 | |||
2490 | if (ca_ops->pkts_acked) | 2495 | if (ca_ops->pkts_acked) |
2491 | ca_ops->pkts_acked(sk, pkts_acked, last_ackt); | 2496 | ca_ops->pkts_acked(sk, pkts_acked, last_ackt); |
2492 | } | 2497 | } |
diff --git a/net/ipv4/tcp_lp.c b/net/ipv4/tcp_lp.c index 43294ad9f63e..e49836ce012e 100644 --- a/net/ipv4/tcp_lp.c +++ b/net/ipv4/tcp_lp.c | |||
@@ -266,7 +266,8 @@ static void tcp_lp_pkts_acked(struct sock *sk, u32 num_acked, ktime_t last) | |||
266 | struct tcp_sock *tp = tcp_sk(sk); | 266 | struct tcp_sock *tp = tcp_sk(sk); |
267 | struct lp *lp = inet_csk_ca(sk); | 267 | struct lp *lp = inet_csk_ca(sk); |
268 | 268 | ||
269 | tcp_lp_rtt_sample(sk, ktime_to_us(net_timedelta(last))); | 269 | if (!ktime_equal(last, net_invalid_timestamp())) |
270 | tcp_lp_rtt_sample(sk, ktime_to_us(net_timedelta(last))); | ||
270 | 271 | ||
271 | /* calc inference */ | 272 | /* calc inference */ |
272 | if (tcp_time_stamp > tp->rx_opt.rcv_tsecr) | 273 | if (tcp_time_stamp > tp->rx_opt.rcv_tsecr) |
diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c index 73e19cf7df21..e218a51ceced 100644 --- a/net/ipv4/tcp_vegas.c +++ b/net/ipv4/tcp_vegas.c | |||
@@ -117,6 +117,9 @@ void tcp_vegas_pkts_acked(struct sock *sk, u32 cnt, ktime_t last) | |||
117 | struct vegas *vegas = inet_csk_ca(sk); | 117 | struct vegas *vegas = inet_csk_ca(sk); |
118 | u32 vrtt; | 118 | u32 vrtt; |
119 | 119 | ||
120 | if (ktime_equal(last, net_invalid_timestamp())) | ||
121 | return; | ||
122 | |||
120 | /* Never allow zero rtt or baseRTT */ | 123 | /* Never allow zero rtt or baseRTT */ |
121 | vrtt = ktime_to_us(net_timedelta(last)) + 1; | 124 | vrtt = ktime_to_us(net_timedelta(last)) + 1; |
122 | 125 | ||
diff --git a/net/ipv4/tcp_veno.c b/net/ipv4/tcp_veno.c index 9edb340f2f95..ec854cc5fad5 100644 --- a/net/ipv4/tcp_veno.c +++ b/net/ipv4/tcp_veno.c | |||
@@ -74,6 +74,9 @@ static void tcp_veno_pkts_acked(struct sock *sk, u32 cnt, ktime_t last) | |||
74 | struct veno *veno = inet_csk_ca(sk); | 74 | struct veno *veno = inet_csk_ca(sk); |
75 | u32 vrtt; | 75 | u32 vrtt; |
76 | 76 | ||
77 | if (ktime_equal(last, net_invalid_timestamp())) | ||
78 | return; | ||
79 | |||
77 | /* Never allow zero rtt or baseRTT */ | 80 | /* Never allow zero rtt or baseRTT */ |
78 | vrtt = ktime_to_us(net_timedelta(last)) + 1; | 81 | vrtt = ktime_to_us(net_timedelta(last)) + 1; |
79 | 82 | ||
diff --git a/net/rxrpc/ar-connection.c b/net/rxrpc/ar-connection.c index 43cb3e051ece..482750efc235 100644 --- a/net/rxrpc/ar-connection.c +++ b/net/rxrpc/ar-connection.c | |||
@@ -211,7 +211,7 @@ static struct rxrpc_connection *rxrpc_alloc_connection(gfp_t gfp) | |||
211 | conn->header_size = sizeof(struct rxrpc_header); | 211 | conn->header_size = sizeof(struct rxrpc_header); |
212 | } | 212 | } |
213 | 213 | ||
214 | _leave(" = %p{%d}", conn, conn->debug_id); | 214 | _leave(" = %p{%d}", conn, conn ? conn->debug_id : 0); |
215 | return conn; | 215 | return conn; |
216 | } | 216 | } |
217 | 217 | ||