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

Function tcp_sack_partialack

freebsd/netinet/tcp_sack.c:786–804  ·  view source on GitHub ↗

* Partial ack handling within a sack recovery episode. Keeping this very * simple for now. When a partial ack is received, force snd_cwnd to a value * that will allow the sender to transmit no more than 2 segments. If * necessary, a better scheme can be adopted at a later point, but for now, * the goal is to prevent the sender from bursting a large amount of data in * the midst of sack rec

Source from the content-addressed store, hash-verified

784 * the midst of sack recovery.
785 */
786void
787tcp_sack_partialack(struct tcpcb *tp, struct tcphdr *th)
788{
789 int num_segs = 1;
790 u_int maxseg = tcp_maxseg(tp);
791
792 INP_WLOCK_ASSERT(tp->t_inpcb);
793 tcp_timer_activate(tp, TT_REXMT, 0);
794 tp->t_rtttime = 0;
795 /* Send one or 2 segments based on how much new data was acked. */
796 if ((BYTES_THIS_ACK(tp, th) / maxseg) >= 2)
797 num_segs = 2;
798 tp->snd_cwnd = (tp->sackhint.sack_bytes_rexmit +
799 (tp->snd_nxt - tp->snd_recover) + num_segs * maxseg);
800 if (tp->snd_cwnd > tp->snd_ssthresh)
801 tp->snd_cwnd = tp->snd_ssthresh;
802 tp->t_flags |= TF_ACKNOW;
803 (void) tp->t_fb->tfb_tcp_output(tp);
804}
805
806#if 0
807/*

Callers 1

tcp_do_segmentFunction · 0.85

Calls 2

tcp_maxsegFunction · 0.85
tcp_timer_activateFunction · 0.85

Tested by

no test coverage detected