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

Function bbr_remxt_tmr

freebsd/netinet/tcp_stacks/bbr.c:4882–4967  ·  view source on GitHub ↗

* Retransmit helper function, clear up all the ack * flags and take care of important book keeping. */

Source from the content-addressed store, hash-verified

4880 * flags and take care of important book keeping.
4881 */
4882static void
4883bbr_remxt_tmr(struct tcpcb *tp)
4884{
4885 /*
4886 * The retransmit timer went off, all sack'd blocks must be
4887 * un-acked.
4888 */
4889 struct bbr_sendmap *rsm, *trsm = NULL;
4890 struct tcp_bbr *bbr;
4891 uint32_t cts, lost;
4892
4893 bbr = (struct tcp_bbr *)tp->t_fb_ptr;
4894 cts = tcp_get_usecs(&bbr->rc_tv);
4895 lost = bbr->r_ctl.rc_lost;
4896 if (bbr->r_state && (bbr->r_state != tp->t_state))
4897 bbr_set_state(tp, bbr, 0);
4898
4899 TAILQ_FOREACH(rsm, &bbr->r_ctl.rc_map, r_next) {
4900 if (rsm->r_flags & BBR_ACKED) {
4901 uint32_t old_flags;
4902
4903 rsm->r_dupack = 0;
4904 if (rsm->r_in_tmap == 0) {
4905 /* We must re-add it back to the tlist */
4906 if (trsm == NULL) {
4907 TAILQ_INSERT_HEAD(&bbr->r_ctl.rc_tmap, rsm, r_tnext);
4908 } else {
4909 TAILQ_INSERT_AFTER(&bbr->r_ctl.rc_tmap, trsm, rsm, r_tnext);
4910 }
4911 rsm->r_in_tmap = 1;
4912 }
4913 old_flags = rsm->r_flags;
4914 rsm->r_flags |= BBR_RXT_CLEARED;
4915 rsm->r_flags &= ~(BBR_ACKED | BBR_SACK_PASSED | BBR_WAS_SACKPASS);
4916 bbr_log_type_rsmclear(bbr, cts, rsm, old_flags, __LINE__);
4917 } else {
4918 if ((tp->t_state < TCPS_ESTABLISHED) &&
4919 (rsm->r_start == tp->snd_una)) {
4920 /*
4921 * Special case for TCP FO. Where
4922 * we sent more data beyond the snd_max.
4923 * We don't mark that as lost and stop here.
4924 */
4925 break;
4926 }
4927 if ((rsm->r_flags & BBR_MARKED_LOST) == 0) {
4928 bbr->r_ctl.rc_lost += rsm->r_end - rsm->r_start;
4929 bbr->r_ctl.rc_lost_bytes += rsm->r_end - rsm->r_start;
4930 }
4931 if (bbr_marks_rxt_sack_passed) {
4932 /*
4933 * With this option, we will rack out
4934 * in 1ms increments the rest of the packets.
4935 */
4936 rsm->r_flags |= BBR_SACK_PASSED | BBR_MARKED_LOST;
4937 rsm->r_flags &= ~BBR_WAS_SACKPASS;
4938 } else {
4939 /*

Callers 1

bbr_timeout_rxtFunction · 0.85

Calls 5

tcp_get_usecsFunction · 0.85
bbr_set_stateFunction · 0.85
bbr_log_type_rsmclearFunction · 0.85
bbr_log_to_eventFunction · 0.85
bbr_lt_bw_samplingFunction · 0.85

Tested by

no test coverage detected