| 7453 | } |
| 7454 | |
| 7455 | static void |
| 7456 | rack_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; |
no test coverage detected