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

Function rack_process_ack

freebsd/netinet/tcp_stacks/rack.c:8202–8411  ·  view source on GitHub ↗

* Return value of 1, we do not need to call rack_process_data(). * return value of 0, rack_process_data can be called. * For ret_val if its 0 the TCP is locked, if its non-zero * its unlocked and probably unsafe to touch the TCB. */

Source from the content-addressed store, hash-verified

8200 * its unlocked and probably unsafe to touch the TCB.
8201 */
8202static int
8203rack_process_ack(struct mbuf *m, struct tcphdr *th, struct socket *so,
8204 struct tcpcb *tp, struct tcpopt *to,
8205 uint32_t tiwin, int32_t tlen,
8206 int32_t * ofia, int32_t thflags, int32_t * ret_val)
8207{
8208 int32_t ourfinisacked = 0;
8209 int32_t nsegs, acked_amount;
8210 int32_t acked;
8211 struct mbuf *mfree;
8212 struct tcp_rack *rack;
8213 int32_t under_pacing = 0;
8214 int32_t recovery = 0;
8215
8216 rack = (struct tcp_rack *)tp->t_fb_ptr;
8217 if (SEQ_GT(th->th_ack, tp->snd_max)) {
8218 ctf_do_dropafterack(m, tp, th, thflags, tlen, ret_val);
8219 rack->r_wanted_output = 1;
8220 return (1);
8221 }
8222 if (rack->rc_gp_filled &&
8223 (rack->r_ctl.rc_hpts_flags & PACE_PKT_OUTPUT)) {
8224 under_pacing = 1;
8225 }
8226 if (SEQ_GEQ(th->th_ack, tp->snd_una) || to->to_nsacks) {
8227 if (rack->rc_in_persist)
8228 tp->t_rxtshift = 0;
8229 if ((th->th_ack == tp->snd_una) && (tiwin == tp->snd_wnd))
8230 rack_strike_dupack(rack);
8231 rack_log_ack(tp, to, th);
8232 }
8233 if (__predict_false(SEQ_LEQ(th->th_ack, tp->snd_una))) {
8234 /*
8235 * Old ack, behind (or duplicate to) the last one rcv'd
8236 * Note: Should mark reordering is occuring! We should also
8237 * look for sack blocks arriving e.g. ack 1, 4-4 then ack 1,
8238 * 3-3, 4-4 would be reording. As well as ack 1, 3-3 <no
8239 * retran and> ack 3
8240 */
8241 return (0);
8242 }
8243 /*
8244 * If we reach this point, ACK is not a duplicate, i.e., it ACKs
8245 * something we sent.
8246 */
8247 if (tp->t_flags & TF_NEEDSYN) {
8248 /*
8249 * T/TCP: Connection was half-synchronized, and our SYN has
8250 * been ACK'd (so connection is now fully synchronized). Go
8251 * to non-starred state, increment snd_una for ACK of SYN,
8252 * and check if we can do window scaling.
8253 */
8254 tp->t_flags &= ~TF_NEEDSYN;
8255 tp->snd_una++;
8256 /* Do window scaling? */
8257 if ((tp->t_flags & (TF_RCVD_SCALE | TF_REQ_SCALE)) ==
8258 (TF_RCVD_SCALE | TF_REQ_SCALE)) {
8259 tp->rcv_scale = tp->request_r_scale;

Callers 8

rack_do_syn_sentFunction · 0.85
rack_do_syn_recvFunction · 0.85
rack_do_establishedFunction · 0.85
rack_do_close_waitFunction · 0.85
rack_do_fin_wait_1Function · 0.85
rack_do_closingFunction · 0.85
rack_do_lastackFunction · 0.85
rack_do_fin_wait_2Function · 0.85

Calls 15

ctf_do_dropafterackFunction · 0.85
rack_strike_dupackFunction · 0.85
rack_log_ackFunction · 0.85
maxFunction · 0.85
rack_cong_signalFunction · 0.85
rack_timer_cancelFunction · 0.85
tcp_rack_partialackFunction · 0.85
rack_post_recoveryFunction · 0.85
rack_ack_receivedFunction · 0.85
minFunction · 0.85
sbcut_lockedFunction · 0.85
rack_check_bottom_dragFunction · 0.85

Tested by

no test coverage detected