MCPcopy Create free account
hub / github.com/F-Stack/f-stack / chd_ack_received

Function chd_ack_received

freebsd/netinet/cc/cc_chd.c:234–302  ·  view source on GitHub ↗

* All ACK signals are used for timing measurements to determine delay-based * congestion. However, window increases are only performed when * ack_type == CC_ACK. */

Source from the content-addressed store, hash-verified

232 * ack_type == CC_ACK.
233 */
234static void
235chd_ack_received(struct cc_var *ccv, uint16_t ack_type)
236{
237 struct chd *chd_data;
238 struct ertt *e_t;
239 int backoff, new_measurement, qdly, rtt;
240
241 e_t = khelp_get_osd(CCV(ccv, osd), ertt_id);
242 chd_data = ccv->cc_data;
243 new_measurement = e_t->flags & ERTT_NEW_MEASUREMENT;
244 backoff = qdly = 0;
245
246 chd_data->maxrtt_in_rtt = imax(e_t->rtt, chd_data->maxrtt_in_rtt);
247
248 if (new_measurement) {
249 /*
250 * There is a new per RTT measurement, so check to see if there
251 * is delay based congestion.
252 */
253 rtt = V_chd_use_max ? chd_data->maxrtt_in_rtt : e_t->rtt;
254 chd_data->maxrtt_in_rtt = 0;
255
256 if (rtt && e_t->minrtt && !IN_RECOVERY(CCV(ccv, t_flags))) {
257 qdly = rtt - e_t->minrtt;
258 if (qdly > V_chd_qmin) {
259 /*
260 * Probabilistic delay based congestion
261 * indication.
262 */
263 backoff = should_backoff(qdly,
264 e_t->maxrtt - e_t->minrtt, chd_data);
265 } else
266 chd_data->loss_compete = 0;
267 }
268 /* Reset per RTT measurement flag to start a new measurement. */
269 e_t->flags &= ~ERTT_NEW_MEASUREMENT;
270 }
271
272 if (backoff) {
273 /*
274 * Update shadow_w before delay based backoff.
275 */
276 if (chd_data->loss_compete ||
277 qdly > chd_data->prev_backoff_qdly) {
278 /*
279 * Delay is higher than when we backed off previously,
280 * so it is possible that this flow is competing with
281 * loss based flows.
282 */
283 chd_data->shadow_w = max(CCV(ccv, snd_cwnd),
284 chd_data->shadow_w);
285 } else {
286 /*
287 * Reset shadow_w, as it is probable that this flow is
288 * not competing with loss based flows at the moment.
289 */
290 chd_data->shadow_w = 0;
291 }

Callers

nothing calls this directly

Calls 6

khelp_get_osdFunction · 0.85
imaxFunction · 0.85
maxFunction · 0.85
chd_cong_signalFunction · 0.85
chd_window_increaseFunction · 0.85
should_backoffFunction · 0.70

Tested by

no test coverage detected