aboutsummaryrefslogtreecommitdiffstats
path: root/net/dccp/ccids/ccid2.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-08-09 12:57:13 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-09 12:57:13 -0400
commit6395ad8559f3a8f4299c027175db00cde67849f7 (patch)
tree13b8f507f90272650a37cc0ea05bdf879d83f76d /net/dccp/ccids/ccid2.c
parentfedb8da96355f5f64353625bf96dc69423ad1826 (diff)
parent1be52e97ed3e524f82e25d6e53f48df3c6e85282 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Pull networking fixes from David Miller: 1) The real fix for the ipv6 route metric leak Sabrina was seeing, from Cong Wang. 2) Fix syzbot triggers AF_PACKET v3 ring buffer insufficient room conditions, from Willem de Bruijn. 3) vsock can reinitialize active work struct, fix from Cong Wang. 4) RXRPC keepalive generator can wedge a cpu, fix from David Howells. 5) Fix locking in AF_SMC ioctl, from Ursula Braun. * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: dsa: slave: eee: Allow ports to use phylink net/smc: move sock lock in smc_ioctl() net/smc: allow sysctl rmem and wmem defaults for servers net/smc: no shutdown in state SMC_LISTEN net: aquantia: Fix IFF_ALLMULTI flag functionality rxrpc: Fix the keepalive generator [ver #2] net/mlx5e: Cleanup of dcbnl related fields net/mlx5e: Properly check if hairpin is possible between two functions vhost: reset metadata cache when initializing new IOTLB llc: use refcount_inc_not_zero() for llc_sap_find() dccp: fix undefined behavior with 'cwnd' shift in ccid2_cwnd_restart() tipc: fix an interrupt unsafe locking scenario vsock: split dwork to avoid reinitializations net: thunderx: check for failed allocation lmac->dmacs cxgb4: mk_act_open_req() buggers ->{local, peer}_ip on big-endian hosts packet: refine ring v3 block size test to hold one frame ip6_tunnel: use the right value for ipv4 min mtu check in ip6_tnl_xmit ipv6: fix double refcount of fib6_metrics
Diffstat (limited to 'net/dccp/ccids/ccid2.c')
-rw-r--r--net/dccp/ccids/ccid2.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index 2b75df469220..842a9c7c73a3 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -229,14 +229,16 @@ static void ccid2_cwnd_restart(struct sock *sk, const u32 now)
229 struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk); 229 struct ccid2_hc_tx_sock *hc = ccid2_hc_tx_sk(sk);
230 u32 cwnd = hc->tx_cwnd, restart_cwnd, 230 u32 cwnd = hc->tx_cwnd, restart_cwnd,
231 iwnd = rfc3390_bytes_to_packets(dccp_sk(sk)->dccps_mss_cache); 231 iwnd = rfc3390_bytes_to_packets(dccp_sk(sk)->dccps_mss_cache);
232 s32 delta = now - hc->tx_lsndtime;
232 233
233 hc->tx_ssthresh = max(hc->tx_ssthresh, (cwnd >> 1) + (cwnd >> 2)); 234 hc->tx_ssthresh = max(hc->tx_ssthresh, (cwnd >> 1) + (cwnd >> 2));
234 235
235 /* don't reduce cwnd below the initial window (IW) */ 236 /* don't reduce cwnd below the initial window (IW) */
236 restart_cwnd = min(cwnd, iwnd); 237 restart_cwnd = min(cwnd, iwnd);
237 cwnd >>= (now - hc->tx_lsndtime) / hc->tx_rto;
238 hc->tx_cwnd = max(cwnd, restart_cwnd);
239 238
239 while ((delta -= hc->tx_rto) >= 0 && cwnd > restart_cwnd)
240 cwnd >>= 1;
241 hc->tx_cwnd = max(cwnd, restart_cwnd);
240 hc->tx_cwnd_stamp = now; 242 hc->tx_cwnd_stamp = now;
241 hc->tx_cwnd_used = 0; 243 hc->tx_cwnd_used = 0;
242 244