Print this page
11546 Track TCP round-trip time in nanoseconds
Portions contributed by: Cody Peter Mello <cody.mello@joyent.com>
Portions contributed by: Brandon Baker <bbaker@delphix.com>
Reviewed by: Jason King <jason.king@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Dan McDonald <danmcd@joyent.com>
@@ -21,11 +21,11 @@
/*
* Copyright (c) 1991, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2011, Joyent Inc. All rights reserved.
* Copyright (c) 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2013,2014 by Delphix. All rights reserved.
+ * Copyright (c) 2013, 2016 by Delphix. All rights reserved.
* Copyright 2014, OmniTI Computer Consulting, Inc. All rights reserved.
*/
/* Copyright (c) 1990 Mentat Inc. */
#include <sys/types.h>
@@ -264,12 +264,10 @@
} tcpt_t;
/*
* Functions called directly via squeue having a prototype of edesc_t.
*/
-void tcp_input_listener(void *arg, mblk_t *mp, void *arg2,
- ip_recv_attr_t *ira);
void tcp_input_data(void *arg, mblk_t *mp, void *arg2,
ip_recv_attr_t *ira);
static void tcp_linger_interrupted(void *arg, mblk_t *mp, void *arg2,
ip_recv_attr_t *dummy);
@@ -638,19 +636,13 @@
return (error);
tcp->tcp_localnet = uinfo.iulp_localnet;
if (uinfo.iulp_rtt != 0) {
- clock_t rto;
-
- tcp->tcp_rtt_sa = uinfo.iulp_rtt;
- tcp->tcp_rtt_sd = uinfo.iulp_rtt_sd;
- rto = (tcp->tcp_rtt_sa >> 3) + tcp->tcp_rtt_sd +
- tcps->tcps_rexmit_interval_extra +
- (tcp->tcp_rtt_sa >> 5);
-
- TCP_SET_RTO(tcp, rto);
+ tcp->tcp_rtt_sa = MSEC2NSEC(uinfo.iulp_rtt);
+ tcp->tcp_rtt_sd = MSEC2NSEC(uinfo.iulp_rtt_sd);
+ tcp->tcp_rto = tcp_calculate_rto(tcp, tcps, 0);
}
if (uinfo.iulp_ssthresh != 0)
tcp->tcp_cwnd_ssthresh = uinfo.iulp_ssthresh;
else
tcp->tcp_cwnd_ssthresh = TCP_MAX_LARGEWIN;
@@ -2332,11 +2324,10 @@
void
tcp_init_values(tcp_t *tcp, tcp_t *parent)
{
tcp_stack_t *tcps = tcp->tcp_tcps;
conn_t *connp = tcp->tcp_connp;
- clock_t rto;
ASSERT((connp->conn_family == AF_INET &&
connp->conn_ipversion == IPV4_VERSION) ||
(connp->conn_family == AF_INET6 &&
(connp->conn_ipversion == IPV4_VERSION ||
@@ -2401,16 +2392,14 @@
* will be close to tcp_rexmit_interval_initial. By doing this, we
* allow the algorithm to adjust slowly to large fluctuations of RTT
* during first few transmissions of a connection as seen in slow
* links.
*/
- tcp->tcp_rtt_sa = tcp->tcp_rto_initial << 2;
- tcp->tcp_rtt_sd = tcp->tcp_rto_initial >> 1;
- rto = (tcp->tcp_rtt_sa >> 3) + tcp->tcp_rtt_sd +
- tcps->tcps_rexmit_interval_extra + (tcp->tcp_rtt_sa >> 5) +
- tcps->tcps_conn_grace_period;
- TCP_SET_RTO(tcp, rto);
+ tcp->tcp_rtt_sa = MSEC2NSEC(tcp->tcp_rto_initial) << 2;
+ tcp->tcp_rtt_sd = MSEC2NSEC(tcp->tcp_rto_initial) >> 1;
+ tcp->tcp_rto = tcp_calculate_rto(tcp, tcps,
+ tcps->tcps_conn_grace_period);
tcp->tcp_timer_backoff = 0;
tcp->tcp_ms_we_have_waited = 0;
tcp->tcp_last_recv_time = ddi_get_lbolt();
tcp->tcp_cwnd_max = tcps->tcps_cwnd_max_;