|
@@ -289,6 +289,7 @@ static bool tcp_ecn_rcv_ecn_echo(const struct tcp_sock *tp, const struct tcphdr
|
|
static void tcp_sndbuf_expand(struct sock *sk)
|
|
static void tcp_sndbuf_expand(struct sock *sk)
|
|
{
|
|
{
|
|
const struct tcp_sock *tp = tcp_sk(sk);
|
|
const struct tcp_sock *tp = tcp_sk(sk);
|
|
|
|
+ const struct tcp_congestion_ops *ca_ops = inet_csk(sk)->icsk_ca_ops;
|
|
int sndmem, per_mss;
|
|
int sndmem, per_mss;
|
|
u32 nr_segs;
|
|
u32 nr_segs;
|
|
|
|
|
|
@@ -309,7 +310,8 @@ static void tcp_sndbuf_expand(struct sock *sk)
|
|
* Cubic needs 1.7 factor, rounded to 2 to include
|
|
* Cubic needs 1.7 factor, rounded to 2 to include
|
|
* extra cushion (application might react slowly to POLLOUT)
|
|
* extra cushion (application might react slowly to POLLOUT)
|
|
*/
|
|
*/
|
|
- sndmem = 2 * nr_segs * per_mss;
|
|
|
|
|
|
+ sndmem = ca_ops->sndbuf_expand ? ca_ops->sndbuf_expand(sk) : 2;
|
|
|
|
+ sndmem *= nr_segs * per_mss;
|
|
|
|
|
|
if (sk->sk_sndbuf < sndmem)
|
|
if (sk->sk_sndbuf < sndmem)
|
|
sk->sk_sndbuf = min(sndmem, sysctl_tcp_wmem[2]);
|
|
sk->sk_sndbuf = min(sndmem, sysctl_tcp_wmem[2]);
|