.. | .. |
---|
348 | 348 | struct pipe_inode_info *pipe, size_t len, |
---|
349 | 349 | unsigned int flags); |
---|
350 | 350 | |
---|
351 | | -void tcp_enter_quickack_mode(struct sock *sk, unsigned int max_quickacks); |
---|
352 | | -static inline void tcp_dec_quickack_mode(struct sock *sk, |
---|
353 | | - const unsigned int pkts) |
---|
| 351 | +static inline void tcp_dec_quickack_mode(struct sock *sk) |
---|
354 | 352 | { |
---|
355 | 353 | struct inet_connection_sock *icsk = inet_csk(sk); |
---|
356 | 354 | |
---|
357 | 355 | if (icsk->icsk_ack.quick) { |
---|
| 356 | + /* How many ACKs S/ACKing new data have we sent? */ |
---|
| 357 | + const unsigned int pkts = inet_csk_ack_scheduled(sk) ? 1 : 0; |
---|
| 358 | + |
---|
358 | 359 | if (pkts >= icsk->icsk_ack.quick) { |
---|
359 | 360 | icsk->icsk_ack.quick = 0; |
---|
360 | 361 | /* Leaving quickack mode we deflate ATO. */ |
---|
.. | .. |
---|
392 | 393 | void tcp_init_metrics(struct sock *sk); |
---|
393 | 394 | void tcp_metrics_init(void); |
---|
394 | 395 | bool tcp_peer_is_proven(struct request_sock *req, struct dst_entry *dst); |
---|
| 396 | +void __tcp_close(struct sock *sk, long timeout); |
---|
395 | 397 | void tcp_close(struct sock *sk, long timeout); |
---|
396 | 398 | void tcp_init_sock(struct sock *sk); |
---|
397 | 399 | void tcp_init_transfer(struct sock *sk, int bpf_op, struct sk_buff *skb); |
---|
.. | .. |
---|
1454 | 1456 | static inline int keepalive_intvl_when(const struct tcp_sock *tp) |
---|
1455 | 1457 | { |
---|
1456 | 1458 | struct net *net = sock_net((struct sock *)tp); |
---|
| 1459 | + int val; |
---|
1457 | 1460 | |
---|
1458 | | - return tp->keepalive_intvl ? : |
---|
1459 | | - READ_ONCE(net->ipv4.sysctl_tcp_keepalive_intvl); |
---|
| 1461 | + /* Paired with WRITE_ONCE() in tcp_sock_set_keepintvl() |
---|
| 1462 | + * and do_tcp_setsockopt(). |
---|
| 1463 | + */ |
---|
| 1464 | + val = READ_ONCE(tp->keepalive_intvl); |
---|
| 1465 | + |
---|
| 1466 | + return val ? : READ_ONCE(net->ipv4.sysctl_tcp_keepalive_intvl); |
---|
1460 | 1467 | } |
---|
1461 | 1468 | |
---|
1462 | 1469 | static inline int keepalive_time_when(const struct tcp_sock *tp) |
---|
1463 | 1470 | { |
---|
1464 | 1471 | struct net *net = sock_net((struct sock *)tp); |
---|
| 1472 | + int val; |
---|
1465 | 1473 | |
---|
1466 | | - return tp->keepalive_time ? : |
---|
1467 | | - READ_ONCE(net->ipv4.sysctl_tcp_keepalive_time); |
---|
| 1474 | + /* Paired with WRITE_ONCE() in tcp_sock_set_keepidle_locked() */ |
---|
| 1475 | + val = READ_ONCE(tp->keepalive_time); |
---|
| 1476 | + |
---|
| 1477 | + return val ? : READ_ONCE(net->ipv4.sysctl_tcp_keepalive_time); |
---|
1468 | 1478 | } |
---|
1469 | 1479 | |
---|
1470 | 1480 | static inline int keepalive_probes(const struct tcp_sock *tp) |
---|
1471 | 1481 | { |
---|
1472 | 1482 | struct net *net = sock_net((struct sock *)tp); |
---|
| 1483 | + int val; |
---|
1473 | 1484 | |
---|
1474 | | - return tp->keepalive_probes ? : |
---|
1475 | | - READ_ONCE(net->ipv4.sysctl_tcp_keepalive_probes); |
---|
| 1485 | + /* Paired with WRITE_ONCE() in tcp_sock_set_keepcnt() |
---|
| 1486 | + * and do_tcp_setsockopt(). |
---|
| 1487 | + */ |
---|
| 1488 | + val = READ_ONCE(tp->keepalive_probes); |
---|
| 1489 | + |
---|
| 1490 | + return val ? : READ_ONCE(net->ipv4.sysctl_tcp_keepalive_probes); |
---|
1476 | 1491 | } |
---|
1477 | 1492 | |
---|
1478 | 1493 | static inline u32 keepalive_time_elapsed(const struct tcp_sock *tp) |
---|
.. | .. |
---|
1981 | 1996 | static inline u32 tcp_notsent_lowat(const struct tcp_sock *tp) |
---|
1982 | 1997 | { |
---|
1983 | 1998 | struct net *net = sock_net((struct sock *)tp); |
---|
1984 | | - return tp->notsent_lowat ?: READ_ONCE(net->ipv4.sysctl_tcp_notsent_lowat); |
---|
| 1999 | + u32 val; |
---|
| 2000 | + |
---|
| 2001 | + val = READ_ONCE(tp->notsent_lowat); |
---|
| 2002 | + |
---|
| 2003 | + return val ?: READ_ONCE(net->ipv4.sysctl_tcp_notsent_lowat); |
---|
1985 | 2004 | } |
---|
1986 | 2005 | |
---|
1987 | 2006 | /* @wake is one when sk_stream_write_space() calls us. |
---|