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

Function dctcp_ack_received

freebsd/netinet/cc/cc_dctcp.c:104–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102};
103
104static void
105dctcp_ack_received(struct cc_var *ccv, uint16_t type)
106{
107 struct dctcp *dctcp_data;
108 int bytes_acked = 0;
109
110 dctcp_data = ccv->cc_data;
111
112 if (CCV(ccv, t_flags2) & TF2_ECN_PERMIT) {
113 /*
114 * DCTCP doesn't treat receipt of ECN marked packet as a
115 * congestion event. Thus, DCTCP always executes the ACK
116 * processing out of congestion recovery.
117 */
118 if (IN_CONGRECOVERY(CCV(ccv, t_flags))) {
119 EXIT_CONGRECOVERY(CCV(ccv, t_flags));
120 newreno_cc_algo.ack_received(ccv, type);
121 ENTER_CONGRECOVERY(CCV(ccv, t_flags));
122 } else
123 newreno_cc_algo.ack_received(ccv, type);
124
125 if (type == CC_DUPACK)
126 bytes_acked = min(ccv->bytes_this_ack, CCV(ccv, t_maxseg));
127
128 if (type == CC_ACK)
129 bytes_acked = ccv->bytes_this_ack;
130
131 /* Update total bytes. */
132 dctcp_data->bytes_total += bytes_acked;
133
134 /* Update total marked bytes. */
135 if (dctcp_data->ece_curr) {
136 //XXRMS: For fluid-model DCTCP, update
137 //cwnd here during for RTT fairness
138 if (!dctcp_data->ece_prev
139 && bytes_acked > CCV(ccv, t_maxseg)) {
140 dctcp_data->bytes_ecn +=
141 (bytes_acked - CCV(ccv, t_maxseg));
142 } else
143 dctcp_data->bytes_ecn += bytes_acked;
144 dctcp_data->ece_prev = 1;
145 } else {
146 if (dctcp_data->ece_prev
147 && bytes_acked > CCV(ccv, t_maxseg))
148 dctcp_data->bytes_ecn += CCV(ccv, t_maxseg);
149 dctcp_data->ece_prev = 0;
150 }
151 dctcp_data->ece_curr = 0;
152
153 /*
154 * Update the fraction of marked bytes at the end of
155 * current window size.
156 */
157 if (!IN_FASTRECOVERY(CCV(ccv, t_flags)) &&
158 SEQ_GT(ccv->curack, dctcp_data->save_sndnxt))
159 dctcp_update_alpha(ccv);
160 } else
161 newreno_cc_algo.ack_received(ccv, type);

Callers

nothing calls this directly

Calls 2

minFunction · 0.85
dctcp_update_alphaFunction · 0.85

Tested by

no test coverage detected