|
@@ -66,6 +66,7 @@
|
|
#include <linux/mm.h>
|
|
#include <linux/mm.h>
|
|
#include <linux/module.h>
|
|
#include <linux/module.h>
|
|
#include <linux/sysctl.h>
|
|
#include <linux/sysctl.h>
|
|
|
|
+#include <net/dst.h>
|
|
#include <net/tcp.h>
|
|
#include <net/tcp.h>
|
|
#include <net/inet_common.h>
|
|
#include <net/inet_common.h>
|
|
#include <linux/ipsec.h>
|
|
#include <linux/ipsec.h>
|
|
@@ -605,7 +606,7 @@ static u32 tcp_rto_min(struct sock *sk)
|
|
u32 rto_min = TCP_RTO_MIN;
|
|
u32 rto_min = TCP_RTO_MIN;
|
|
|
|
|
|
if (dst && dst_metric_locked(dst, RTAX_RTO_MIN))
|
|
if (dst && dst_metric_locked(dst, RTAX_RTO_MIN))
|
|
- rto_min = dst->metrics[RTAX_RTO_MIN - 1];
|
|
|
|
|
|
+ rto_min = dst_metric(dst, RTAX_RTO_MIN);
|
|
return rto_min;
|
|
return rto_min;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -769,7 +770,7 @@ void tcp_update_metrics(struct sock *sk)
|
|
dst->metrics[RTAX_RTTVAR - 1] = m;
|
|
dst->metrics[RTAX_RTTVAR - 1] = m;
|
|
else
|
|
else
|
|
dst->metrics[RTAX_RTTVAR-1] -=
|
|
dst->metrics[RTAX_RTTVAR-1] -=
|
|
- (dst->metrics[RTAX_RTTVAR-1] - m)>>2;
|
|
|
|
|
|
+ (dst_metric(dst, RTAX_RTTVAR) - m)>>2;
|
|
}
|
|
}
|
|
|
|
|
|
if (tp->snd_ssthresh >= 0xFFFF) {
|
|
if (tp->snd_ssthresh >= 0xFFFF) {
|
|
@@ -788,21 +789,21 @@ void tcp_update_metrics(struct sock *sk)
|
|
dst->metrics[RTAX_SSTHRESH-1] =
|
|
dst->metrics[RTAX_SSTHRESH-1] =
|
|
max(tp->snd_cwnd >> 1, tp->snd_ssthresh);
|
|
max(tp->snd_cwnd >> 1, tp->snd_ssthresh);
|
|
if (!dst_metric_locked(dst, RTAX_CWND))
|
|
if (!dst_metric_locked(dst, RTAX_CWND))
|
|
- dst->metrics[RTAX_CWND-1] = (dst->metrics[RTAX_CWND-1] + tp->snd_cwnd) >> 1;
|
|
|
|
|
|
+ dst->metrics[RTAX_CWND-1] = (dst_metric(dst, RTAX_CWND) + tp->snd_cwnd) >> 1;
|
|
} else {
|
|
} else {
|
|
/* Else slow start did not finish, cwnd is non-sense,
|
|
/* Else slow start did not finish, cwnd is non-sense,
|
|
ssthresh may be also invalid.
|
|
ssthresh may be also invalid.
|
|
*/
|
|
*/
|
|
if (!dst_metric_locked(dst, RTAX_CWND))
|
|
if (!dst_metric_locked(dst, RTAX_CWND))
|
|
- dst->metrics[RTAX_CWND-1] = (dst->metrics[RTAX_CWND-1] + tp->snd_ssthresh) >> 1;
|
|
|
|
- if (dst->metrics[RTAX_SSTHRESH-1] &&
|
|
|
|
|
|
+ dst->metrics[RTAX_CWND-1] = (dst_metric(dst, RTAX_CWND) + tp->snd_ssthresh) >> 1;
|
|
|
|
+ if (dst_metric(dst, RTAX_SSTHRESH) &&
|
|
!dst_metric_locked(dst, RTAX_SSTHRESH) &&
|
|
!dst_metric_locked(dst, RTAX_SSTHRESH) &&
|
|
- tp->snd_ssthresh > dst->metrics[RTAX_SSTHRESH-1])
|
|
|
|
|
|
+ tp->snd_ssthresh > dst_metric(dst, RTAX_SSTHRESH))
|
|
dst->metrics[RTAX_SSTHRESH-1] = tp->snd_ssthresh;
|
|
dst->metrics[RTAX_SSTHRESH-1] = tp->snd_ssthresh;
|
|
}
|
|
}
|
|
|
|
|
|
if (!dst_metric_locked(dst, RTAX_REORDERING)) {
|
|
if (!dst_metric_locked(dst, RTAX_REORDERING)) {
|
|
- if (dst->metrics[RTAX_REORDERING-1] < tp->reordering &&
|
|
|
|
|
|
+ if (dst_metric(dst, RTAX_REORDERING) < tp->reordering &&
|
|
tp->reordering != sysctl_tcp_reordering)
|
|
tp->reordering != sysctl_tcp_reordering)
|
|
dst->metrics[RTAX_REORDERING-1] = tp->reordering;
|
|
dst->metrics[RTAX_REORDERING-1] = tp->reordering;
|
|
}
|
|
}
|