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

Function rack_log_ack

freebsd/netinet/tcp_stacks/rack.c:7455–8071  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7453}
7454
7455static void
7456rack_log_ack(struct tcpcb *tp, struct tcpopt *to, struct tcphdr *th)
7457{
7458 uint32_t changed, entered_recovery = 0;
7459 struct tcp_rack *rack;
7460 struct rack_sendmap *rsm, *rm;
7461 struct sackblk sack, sack_blocks[TCP_MAX_SACK + 1];
7462 register uint32_t th_ack;
7463 int32_t i, j, k, num_sack_blks = 0;
7464 uint32_t cts, acked, ack_point, sack_changed = 0;
7465 int loop_start = 0, moved_two = 0;
7466 uint32_t tsused;
7467
7468 INP_WLOCK_ASSERT(tp->t_inpcb);
7469 if (th->th_flags & TH_RST) {
7470 /* We don't log resets */
7471 return;
7472 }
7473 rack = (struct tcp_rack *)tp->t_fb_ptr;
7474 cts = tcp_ts_getticks();
7475 rsm = RB_MIN(rack_rb_tree_head, &rack->r_ctl.rc_mtree);
7476 changed = 0;
7477 th_ack = th->th_ack;
7478 if (rack->sack_attack_disable == 0)
7479 rack_do_decay(rack);
7480 if (BYTES_THIS_ACK(tp, th) >= ctf_fixed_maxseg(rack->rc_tp)) {
7481 /*
7482 * You only get credit for
7483 * MSS and greater (and you get extra
7484 * credit for larger cum-ack moves).
7485 */
7486 int ac;
7487
7488 ac = BYTES_THIS_ACK(tp, th) / ctf_fixed_maxseg(rack->rc_tp);
7489 rack->r_ctl.ack_count += ac;
7490 counter_u64_add(rack_ack_total, ac);
7491 }
7492 if (rack->r_ctl.ack_count > 0xfff00000) {
7493 /*
7494 * reduce the number to keep us under
7495 * a uint32_t.
7496 */
7497 rack->r_ctl.ack_count /= 2;
7498 rack->r_ctl.sack_count /= 2;
7499 }
7500 if (SEQ_GT(th_ack, tp->snd_una)) {
7501 rack_log_progress_event(rack, tp, ticks, PROGRESS_UPDATE, __LINE__);
7502 tp->t_acktime = ticks;
7503 }
7504 if (rsm && SEQ_GT(th_ack, rsm->r_start))
7505 changed = th_ack - rsm->r_start;
7506 if (changed) {
7507 /*
7508 * The ACK point is advancing to th_ack, we must drop off
7509 * the packets in the rack log and calculate any eligble
7510 * RTT's.
7511 */
7512 rack->r_wanted_output = 1;

Callers 2

rack_process_ackFunction · 0.85
rack_fastackFunction · 0.85

Calls 15

rack_do_decayFunction · 0.85
ctf_fixed_maxsegFunction · 0.85
rack_log_progress_eventFunction · 0.85
rack_update_rttFunction · 0.85
tcp_tv_to_usectickFunction · 0.85
rack_need_set_testFunction · 0.85
rack_freeFunction · 0.85
rack_log_retran_reasonFunction · 0.85
rack_peer_renegesFunction · 0.85
sack_filter_blksFunction · 0.85
ctf_log_sack_filterFunction · 0.85
rack_proc_sack_blkFunction · 0.85

Tested by

no test coverage detected