summaryrefslogtreecommitdiff
path: root/net/sctp/transport.c
diff options
context:
space:
mode:
authorVlad Yasevich <vladislav.yasevich@hp.com>2009-11-23 15:53:58 -0500
committerVlad Yasevich <vladislav.yasevich@hp.com>2009-11-23 15:53:58 -0500
commit245cba7e55929dc2b10b7d915bfba0168eeeed17 (patch)
tree768264e6c1666552ba30cf7849ef4a5c1549a6e5 /net/sctp/transport.c
parenta242b41dedfe0fd51ab1c906daa703c09b196744 (diff)
sctp: Remove useless last_time_used variable
The transport last_time_used variable is rather useless. It was only used when determining if CWND needs to be updated due to idle transport. However, idle transport detection was based on a Heartbeat timer and last_time_used was not incremented when sending Heartbeats. As a result the check for cwnd reduction was always true. We can get rid of the variable and just base our cwnd manipulation on the HB timer (like the code comment sais). We also have to call into the cwnd manipulation function regardless of whether HBs are enabled or not. That way we will detect idle transports if the user has disabled Heartbeats. Signed-off-by: Vlad Yasevich <vladislav.yasevich@hp.com>
Diffstat (limited to 'net/sctp/transport.c')
-rw-r--r--net/sctp/transport.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/net/sctp/transport.c b/net/sctp/transport.c
index 3b141bb32faf..2df29cbdaf5a 100644
--- a/net/sctp/transport.c
+++ b/net/sctp/transport.c
@@ -83,7 +83,6 @@ static struct sctp_transport *sctp_transport_init(struct sctp_transport *peer,
peer->fast_recovery = 0;
peer->last_time_heard = jiffies;
- peer->last_time_used = jiffies;
peer->last_time_ecne_reduced = jiffies;
peer->init_sent_count = 0;
@@ -565,10 +564,8 @@ void sctp_transport_lower_cwnd(struct sctp_transport *transport,
* to be done every RTO interval, we do it every hearbeat
* interval.
*/
- if (time_after(jiffies, transport->last_time_used +
- transport->rto))
- transport->cwnd = max(transport->cwnd/2,
- 4*transport->asoc->pathmtu);
+ transport->cwnd = max(transport->cwnd/2,
+ 4*transport->asoc->pathmtu);
break;
}