+ cd->K = K_cubic (cd, tc->cwnd / tc->snd_mss);
+}
+
+static void
+cubic_cwnd_accumulate (tcp_connection_t * tc, u32 thresh, u32 bytes_acked)
+{
+ /* We just updated the threshold and don't know how large the previous
+ * one was. Still, optimistically increase cwnd by one segment and
+ * clear the accumulated bytes. */
+ if (tc->cwnd_acc_bytes > thresh)
+ {
+ tc->cwnd += tc->snd_mss;
+ tc->cwnd_acc_bytes = 0;
+ }
+
+ tcp_cwnd_accumulate (tc, thresh, tc->bytes_acked);