/* @westwood_acked_count This function evaluates cumul_ack for evaluating bk in case of delayed or partial acks.  */
static u32 westwood_acked_count(struct sock *sk)
/* @westwood_acked_count This function evaluates cumul_ack for evaluating bk in case of delayed or partial acks.  */
static u32 westwood_acked_count(struct sock *sk)
{
	const struct tcp_sock *tp = tcp_sk(sk);
	struct westwood *w = inet_csk_ca(sk);
	w->cumul_ack = tp->snd_una - w->snd_una;
	if (!w->cumul_ack) {
		w->accounted += tp->mss_cache;
		w->cumul_ack = tp->mss_cache;
	}
	if (w->cumul_ack > tp->mss_cache) {
		if (w->accounted >= w->cumul_ack) {
			w->accounted -= w->cumul_ack;
			w->cumul_ack = tp->mss_cache;
		} else {
			w->cumul_ack -= w->accounted;
			w->accounted = 0;
		}
	}
	w->snd_una = tp->snd_una;
	return w->cumul_ack;
}