Changeset View
Changeset View
Standalone View
Standalone View
sys/netinet/khelp/h_ertt.c
Show First 20 Lines • Show All 147 Lines • ▼ Show 20 Lines | marked_packet_rtt(struct txseginfo *txsi, struct ertt *e_t, struct tcpcb *tp, | ||||
* transmitted bytes. Then pretend the next txsi was marked. | * transmitted bytes. Then pretend the next txsi was marked. | ||||
*/ | */ | ||||
if (mflag & (MULTI_ACK|OLD_TXSI)) { | if (mflag & (MULTI_ACK|OLD_TXSI)) { | ||||
*pmeasurenext = txsi->tx_ts; | *pmeasurenext = txsi->tx_ts; | ||||
*pmeasurenext_len = txsi->len; | *pmeasurenext_len = txsi->len; | ||||
*prtt_bytes_adjust += *pmeasurenext_len; | *prtt_bytes_adjust += *pmeasurenext_len; | ||||
} else { | } else { | ||||
if (mflag & FORCED_MEASUREMENT) { | if (mflag & FORCED_MEASUREMENT) { | ||||
e_t->markedpkt_rtt = tcp_ts_getticks() - | e_t->markedpkt_rtt = tcp_ts_getsbintime() - | ||||
*pmeasurenext + 1; | *pmeasurenext + 1; | ||||
e_t->bytes_tx_in_marked_rtt = e_t->bytes_tx_in_rtt + | e_t->bytes_tx_in_marked_rtt = e_t->bytes_tx_in_rtt + | ||||
*pmeasurenext_len - *prtt_bytes_adjust; | *pmeasurenext_len - *prtt_bytes_adjust; | ||||
} else { | } else { | ||||
e_t->markedpkt_rtt = tcp_ts_getticks() - | e_t->markedpkt_rtt = tcp_ts_getsbintime() - | ||||
txsi->tx_ts + 1; | txsi->tx_ts + 1; | ||||
e_t->bytes_tx_in_marked_rtt = e_t->bytes_tx_in_rtt - | e_t->bytes_tx_in_marked_rtt = e_t->bytes_tx_in_rtt - | ||||
*prtt_bytes_adjust; | *prtt_bytes_adjust; | ||||
} | } | ||||
e_t->marked_snd_cwnd = tp->snd_cwnd; | e_t->marked_snd_cwnd = tp->snd_cwnd; | ||||
/* | /* | ||||
* Reset the ERTT_MEASUREMENT_IN_PROGRESS flag to indicate to | * Reset the ERTT_MEASUREMENT_IN_PROGRESS flag to indicate to | ||||
▲ Show 20 Lines • Show All 178 Lines • ▼ Show 20 Lines | while (txsi != NULL) { | ||||
* for a single segment will have been delayed by the | * for a single segment will have been delayed by the | ||||
* receiver and will yield an inaccurate measurement. In | * receiver and will yield an inaccurate measurement. In | ||||
* this case, we only make the measurement if more than | * this case, we only make the measurement if more than | ||||
* one segment is being acknowledged or sack is | * one segment is being acknowledged or sack is | ||||
* currently being used. | * currently being used. | ||||
*/ | */ | ||||
if (!e_t->dlyack_rx || multiack || new_sacked_bytes) { | if (!e_t->dlyack_rx || multiack || new_sacked_bytes) { | ||||
/* Make an accurate new measurement. */ | /* Make an accurate new measurement. */ | ||||
e_t->rtt = tcp_ts_getticks() - txsi->tx_ts + 1; | e_t->rtt = tcp_ts_getsbintime() - txsi->tx_ts + 1; | ||||
if (e_t->rtt < e_t->minrtt || e_t->minrtt == 0) | if (e_t->rtt < e_t->minrtt || e_t->minrtt == 0) | ||||
e_t->minrtt = e_t->rtt; | e_t->minrtt = e_t->rtt; | ||||
if (e_t->rtt > e_t->maxrtt || e_t->maxrtt == 0) | if (e_t->rtt > e_t->maxrtt || e_t->maxrtt == 0) | ||||
e_t->maxrtt = e_t->rtt; | e_t->maxrtt = e_t->rtt; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 108 Lines • ▼ Show 20 Lines | if (txsi != NULL) { | ||||
} else { | } else { | ||||
txsi->flags |= TXSI_RTT_MEASURE_START; | txsi->flags |= TXSI_RTT_MEASURE_START; | ||||
e_t->flags |= ERTT_MEASUREMENT_IN_PROGRESS; | e_t->flags |= ERTT_MEASUREMENT_IN_PROGRESS; | ||||
e_t->bytes_tx_in_rtt = len; | e_t->bytes_tx_in_rtt = len; | ||||
} | } | ||||
if (((tp->t_flags & TF_NOOPT) == 0) && | if (((tp->t_flags & TF_NOOPT) == 0) && | ||||
(to->to_flags & TOF_TS)) { | (to->to_flags & TOF_TS)) { | ||||
txsi->tx_ts = ntohl(to->to_tsval) - | txsi->tx_ts = ntohl(to->to_tsval); | ||||
tp->ts_offset; | |||||
txsi->rx_ts = ntohl(to->to_tsecr); | txsi->rx_ts = ntohl(to->to_tsecr); | ||||
} else { | } else { | ||||
txsi->tx_ts = tcp_ts_getticks(); | txsi->tx_ts = tcp_ts_getsbintime(); | ||||
txsi->rx_ts = 0; /* No received time stamp. */ | txsi->rx_ts = 0; /* No received time stamp. */ | ||||
} | } | ||||
TAILQ_INSERT_TAIL(&e_t->txsegi_q, txsi, txsegi_lnk); | TAILQ_INSERT_TAIL(&e_t->txsegi_q, txsi, txsegi_lnk); | ||||
} | } | ||||
} | } | ||||
return (0); | return (0); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 57 Lines • Show Last 20 Lines |