| 4401 | } |
| 4402 | |
| 4403 | static __inline void |
| 4404 | bbr_clone_rsm(struct tcp_bbr *bbr, struct bbr_sendmap *nrsm, struct bbr_sendmap *rsm, uint32_t start) |
| 4405 | { |
| 4406 | int idx; |
| 4407 | |
| 4408 | nrsm->r_start = start; |
| 4409 | nrsm->r_end = rsm->r_end; |
| 4410 | nrsm->r_rtr_cnt = rsm->r_rtr_cnt; |
| 4411 | nrsm->r_flags = rsm->r_flags; |
| 4412 | /* We don't transfer forward the SYN flag */ |
| 4413 | nrsm->r_flags &= ~BBR_HAS_SYN; |
| 4414 | /* We move forward the FIN flag, not that this should happen */ |
| 4415 | rsm->r_flags &= ~BBR_HAS_FIN; |
| 4416 | nrsm->r_dupack = rsm->r_dupack; |
| 4417 | nrsm->r_rtr_bytes = 0; |
| 4418 | nrsm->r_is_gain = rsm->r_is_gain; |
| 4419 | nrsm->r_is_drain = rsm->r_is_drain; |
| 4420 | nrsm->r_delivered = rsm->r_delivered; |
| 4421 | nrsm->r_ts_valid = rsm->r_ts_valid; |
| 4422 | nrsm->r_del_ack_ts = rsm->r_del_ack_ts; |
| 4423 | nrsm->r_del_time = rsm->r_del_time; |
| 4424 | nrsm->r_app_limited = rsm->r_app_limited; |
| 4425 | nrsm->r_first_sent_time = rsm->r_first_sent_time; |
| 4426 | nrsm->r_flight_at_send = rsm->r_flight_at_send; |
| 4427 | /* We split a piece the lower section looses any just_ret flag. */ |
| 4428 | nrsm->r_bbr_state = rsm->r_bbr_state; |
| 4429 | for (idx = 0; idx < nrsm->r_rtr_cnt; idx++) { |
| 4430 | nrsm->r_tim_lastsent[idx] = rsm->r_tim_lastsent[idx]; |
| 4431 | } |
| 4432 | rsm->r_end = nrsm->r_start; |
| 4433 | idx = min((bbr->rc_tp->t_maxseg - bbr->rc_last_options), bbr->r_ctl.rc_pace_max_segs); |
| 4434 | idx /= 8; |
| 4435 | /* Check if we got too small */ |
| 4436 | if ((rsm->r_is_smallmap == 0) && |
| 4437 | ((rsm->r_end - rsm->r_start) <= idx)) { |
| 4438 | bbr->r_ctl.rc_num_small_maps_alloced++; |
| 4439 | rsm->r_is_smallmap = 1; |
| 4440 | } |
| 4441 | /* Check the new one as well */ |
| 4442 | if ((nrsm->r_end - nrsm->r_start) <= idx) { |
| 4443 | bbr->r_ctl.rc_num_small_maps_alloced++; |
| 4444 | nrsm->r_is_smallmap = 1; |
| 4445 | } |
| 4446 | } |
| 4447 | |
| 4448 | static int |
| 4449 | bbr_sack_mergable(struct bbr_sendmap *at, |
no test coverage detected