tcp: add accessors to read/set tp->snd_cwnd
[platform/kernel/linux-rpi.git] / net / ipv4 / tcp_bic.c
index f5f588b..58358bf 100644 (file)
@@ -150,7 +150,7 @@ static void bictcp_cong_avoid(struct sock *sk, u32 ack, u32 acked)
                if (!acked)
                        return;
        }
-       bictcp_update(ca, tp->snd_cwnd);
+       bictcp_update(ca, tcp_snd_cwnd(tp));
        tcp_cong_avoid_ai(tp, ca->cnt, acked);
 }
 
@@ -166,16 +166,16 @@ static u32 bictcp_recalc_ssthresh(struct sock *sk)
        ca->epoch_start = 0;    /* end of epoch */
 
        /* Wmax and fast convergence */
-       if (tp->snd_cwnd < ca->last_max_cwnd && fast_convergence)
-               ca->last_max_cwnd = (tp->snd_cwnd * (BICTCP_BETA_SCALE + beta))
+       if (tcp_snd_cwnd(tp) < ca->last_max_cwnd && fast_convergence)
+               ca->last_max_cwnd = (tcp_snd_cwnd(tp) * (BICTCP_BETA_SCALE + beta))
                        / (2 * BICTCP_BETA_SCALE);
        else
-               ca->last_max_cwnd = tp->snd_cwnd;
+               ca->last_max_cwnd = tcp_snd_cwnd(tp);
 
-       if (tp->snd_cwnd <= low_window)
-               return max(tp->snd_cwnd >> 1U, 2U);
+       if (tcp_snd_cwnd(tp) <= low_window)
+               return max(tcp_snd_cwnd(tp) >> 1U, 2U);
        else
-               return max((tp->snd_cwnd * beta) / BICTCP_BETA_SCALE, 2U);
+               return max((tcp_snd_cwnd(tp) * beta) / BICTCP_BETA_SCALE, 2U);
 }
 
 static void bictcp_state(struct sock *sk, u8 new_state)