aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/tcp.h
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2015-11-23 03:04:05 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-11-23 03:04:05 -0500
commit92907cbbef8625bb3998d1eb385fc88f23c97a3f (patch)
tree15626ff9287e37c3cb81c7286d6db5a7fd77c854 /include/net/tcp.h
parent15fbfccfe92c62ae8d1ecc647c44157ed01ac02e (diff)
parent1ec218373b8ebda821aec00bb156a9c94fad9cd4 (diff)
Merge tag 'v4.4-rc2' into drm-intel-next-queued
Linux 4.4-rc2 Backmerge to get at commit 1b0e3a049efe471c399674fd954500ce97438d30 Author: Imre Deak <imre.deak@intel.com> Date: Thu Nov 5 23:04:11 2015 +0200 drm/i915/skl: disable display side power well support for now so that we can proplery re-eanble skl power wells in -next. Conflicts are just adjacent lines changed, except for intel_fbdev.c where we need to interleave the changs. Nothing nefarious. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r--include/net/tcp.h94
1 files changed, 59 insertions, 35 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 0cab28cd43a9..f80e74c5ad18 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -279,6 +279,7 @@ extern int sysctl_tcp_limit_output_bytes;
279extern int sysctl_tcp_challenge_ack_limit; 279extern int sysctl_tcp_challenge_ack_limit;
280extern unsigned int sysctl_tcp_notsent_lowat; 280extern unsigned int sysctl_tcp_notsent_lowat;
281extern int sysctl_tcp_min_tso_segs; 281extern int sysctl_tcp_min_tso_segs;
282extern int sysctl_tcp_min_rtt_wlen;
282extern int sysctl_tcp_autocorking; 283extern int sysctl_tcp_autocorking;
283extern int sysctl_tcp_invalid_ratelimit; 284extern int sysctl_tcp_invalid_ratelimit;
284extern int sysctl_tcp_pacing_ss_ratio; 285extern int sysctl_tcp_pacing_ss_ratio;
@@ -365,8 +366,7 @@ void tcp_wfree(struct sk_buff *skb);
365void tcp_write_timer_handler(struct sock *sk); 366void tcp_write_timer_handler(struct sock *sk);
366void tcp_delack_timer_handler(struct sock *sk); 367void tcp_delack_timer_handler(struct sock *sk);
367int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); 368int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg);
368int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, 369int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb);
369 const struct tcphdr *th, unsigned int len);
370void tcp_rcv_established(struct sock *sk, struct sk_buff *skb, 370void tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
371 const struct tcphdr *th, unsigned int len); 371 const struct tcphdr *th, unsigned int len);
372void tcp_rcv_space_adjust(struct sock *sk); 372void tcp_rcv_space_adjust(struct sock *sk);
@@ -451,19 +451,22 @@ void tcp_v4_send_check(struct sock *sk, struct sk_buff *skb);
451void tcp_v4_mtu_reduced(struct sock *sk); 451void tcp_v4_mtu_reduced(struct sock *sk);
452void tcp_req_err(struct sock *sk, u32 seq); 452void tcp_req_err(struct sock *sk, u32 seq);
453int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb); 453int tcp_v4_conn_request(struct sock *sk, struct sk_buff *skb);
454struct sock *tcp_create_openreq_child(struct sock *sk, 454struct sock *tcp_create_openreq_child(const struct sock *sk,
455 struct request_sock *req, 455 struct request_sock *req,
456 struct sk_buff *skb); 456 struct sk_buff *skb);
457void tcp_ca_openreq_child(struct sock *sk, const struct dst_entry *dst); 457void tcp_ca_openreq_child(struct sock *sk, const struct dst_entry *dst);
458struct sock *tcp_v4_syn_recv_sock(struct sock *sk, struct sk_buff *skb, 458struct sock *tcp_v4_syn_recv_sock(const struct sock *sk, struct sk_buff *skb,
459 struct request_sock *req, 459 struct request_sock *req,
460 struct dst_entry *dst); 460 struct dst_entry *dst,
461 struct request_sock *req_unhash,
462 bool *own_req);
461int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb); 463int tcp_v4_do_rcv(struct sock *sk, struct sk_buff *skb);
462int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len); 464int tcp_v4_connect(struct sock *sk, struct sockaddr *uaddr, int addr_len);
463int tcp_connect(struct sock *sk); 465int tcp_connect(struct sock *sk);
464struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, 466struct sk_buff *tcp_make_synack(const struct sock *sk, struct dst_entry *dst,
465 struct request_sock *req, 467 struct request_sock *req,
466 struct tcp_fastopen_cookie *foc); 468 struct tcp_fastopen_cookie *foc,
469 bool attach_req);
467int tcp_disconnect(struct sock *sk, int flags); 470int tcp_disconnect(struct sock *sk, int flags);
468 471
469void tcp_finish_connect(struct sock *sk, struct sk_buff *skb); 472void tcp_finish_connect(struct sock *sk, struct sk_buff *skb);
@@ -492,8 +495,9 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb);
492 495
493/* syncookies: remember time of last synqueue overflow 496/* syncookies: remember time of last synqueue overflow
494 * But do not dirty this field too often (once per second is enough) 497 * But do not dirty this field too often (once per second is enough)
498 * It is racy as we do not hold a lock, but race is very minor.
495 */ 499 */
496static inline void tcp_synq_overflow(struct sock *sk) 500static inline void tcp_synq_overflow(const struct sock *sk)
497{ 501{
498 unsigned long last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp; 502 unsigned long last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp;
499 unsigned long now = jiffies; 503 unsigned long now = jiffies;
@@ -520,8 +524,7 @@ static inline u32 tcp_cookie_time(void)
520 524
521u32 __cookie_v4_init_sequence(const struct iphdr *iph, const struct tcphdr *th, 525u32 __cookie_v4_init_sequence(const struct iphdr *iph, const struct tcphdr *th,
522 u16 *mssp); 526 u16 *mssp);
523__u32 cookie_v4_init_sequence(struct sock *sk, const struct sk_buff *skb, 527__u32 cookie_v4_init_sequence(const struct sk_buff *skb, __u16 *mss);
524 __u16 *mss);
525__u32 cookie_init_timestamp(struct request_sock *req); 528__u32 cookie_init_timestamp(struct request_sock *req);
526bool cookie_timestamp_decode(struct tcp_options_received *opt); 529bool cookie_timestamp_decode(struct tcp_options_received *opt);
527bool cookie_ecn_ok(const struct tcp_options_received *opt, 530bool cookie_ecn_ok(const struct tcp_options_received *opt,
@@ -534,8 +537,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);
534 537
535u32 __cookie_v6_init_sequence(const struct ipv6hdr *iph, 538u32 __cookie_v6_init_sequence(const struct ipv6hdr *iph,
536 const struct tcphdr *th, u16 *mssp); 539 const struct tcphdr *th, u16 *mssp);
537__u32 cookie_v6_init_sequence(struct sock *sk, const struct sk_buff *skb, 540__u32 cookie_v6_init_sequence(const struct sk_buff *skb, __u16 *mss);
538 __u16 *mss);
539#endif 541#endif
540/* tcp_output.c */ 542/* tcp_output.c */
541 543
@@ -565,7 +567,9 @@ bool tcp_schedule_loss_probe(struct sock *sk);
565/* tcp_input.c */ 567/* tcp_input.c */
566void tcp_resume_early_retransmit(struct sock *sk); 568void tcp_resume_early_retransmit(struct sock *sk);
567void tcp_rearm_rto(struct sock *sk); 569void tcp_rearm_rto(struct sock *sk);
570void tcp_synack_rtt_meas(struct sock *sk, struct request_sock *req);
568void tcp_reset(struct sock *sk); 571void tcp_reset(struct sock *sk);
572void tcp_skb_mark_lost_uncond_verify(struct tcp_sock *tp, struct sk_buff *skb);
569 573
570/* tcp_timer.c */ 574/* tcp_timer.c */
571void tcp_init_xmit_timers(struct sock *); 575void tcp_init_xmit_timers(struct sock *);
@@ -671,6 +675,12 @@ static inline bool tcp_ca_dst_locked(const struct dst_entry *dst)
671 return dst_metric_locked(dst, RTAX_CC_ALGO); 675 return dst_metric_locked(dst, RTAX_CC_ALGO);
672} 676}
673 677
678/* Minimum RTT in usec. ~0 means not available. */
679static inline u32 tcp_min_rtt(const struct tcp_sock *tp)
680{
681 return tp->rtt_min[0].rtt;
682}
683
674/* Compute the actual receive window we are currently advertising. 684/* Compute the actual receive window we are currently advertising.
675 * Rcv_nxt can be after the window if our peer push more data 685 * Rcv_nxt can be after the window if our peer push more data
676 * than the offered window. 686 * than the offered window.
@@ -1206,7 +1216,8 @@ static inline int tcp_full_space(const struct sock *sk)
1206} 1216}
1207 1217
1208extern void tcp_openreq_init_rwin(struct request_sock *req, 1218extern void tcp_openreq_init_rwin(struct request_sock *req,
1209 struct sock *sk, struct dst_entry *dst); 1219 const struct sock *sk_listener,
1220 const struct dst_entry *dst);
1210 1221
1211void tcp_enter_memory_pressure(struct sock *sk); 1222void tcp_enter_memory_pressure(struct sock *sk);
1212 1223
@@ -1370,16 +1381,16 @@ int tcp_md5_do_add(struct sock *sk, const union tcp_md5_addr *addr,
1370 int family, const u8 *newkey, u8 newkeylen, gfp_t gfp); 1381 int family, const u8 *newkey, u8 newkeylen, gfp_t gfp);
1371int tcp_md5_do_del(struct sock *sk, const union tcp_md5_addr *addr, 1382int tcp_md5_do_del(struct sock *sk, const union tcp_md5_addr *addr,
1372 int family); 1383 int family);
1373struct tcp_md5sig_key *tcp_v4_md5_lookup(struct sock *sk, 1384struct tcp_md5sig_key *tcp_v4_md5_lookup(const struct sock *sk,
1374 const struct sock *addr_sk); 1385 const struct sock *addr_sk);
1375 1386
1376#ifdef CONFIG_TCP_MD5SIG 1387#ifdef CONFIG_TCP_MD5SIG
1377struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk, 1388struct tcp_md5sig_key *tcp_md5_do_lookup(const struct sock *sk,
1378 const union tcp_md5_addr *addr, 1389 const union tcp_md5_addr *addr,
1379 int family); 1390 int family);
1380#define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_key) 1391#define tcp_twsk_md5_key(twsk) ((twsk)->tw_md5_key)
1381#else 1392#else
1382static inline struct tcp_md5sig_key *tcp_md5_do_lookup(struct sock *sk, 1393static inline struct tcp_md5sig_key *tcp_md5_do_lookup(const struct sock *sk,
1383 const union tcp_md5_addr *addr, 1394 const union tcp_md5_addr *addr,
1384 int family) 1395 int family)
1385{ 1396{
@@ -1420,10 +1431,10 @@ void tcp_free_fastopen_req(struct tcp_sock *tp);
1420 1431
1421extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx; 1432extern struct tcp_fastopen_context __rcu *tcp_fastopen_ctx;
1422int tcp_fastopen_reset_cipher(void *key, unsigned int len); 1433int tcp_fastopen_reset_cipher(void *key, unsigned int len);
1423bool tcp_try_fastopen(struct sock *sk, struct sk_buff *skb, 1434struct sock *tcp_try_fastopen(struct sock *sk, struct sk_buff *skb,
1424 struct request_sock *req, 1435 struct request_sock *req,
1425 struct tcp_fastopen_cookie *foc, 1436 struct tcp_fastopen_cookie *foc,
1426 struct dst_entry *dst); 1437 struct dst_entry *dst);
1427void tcp_fastopen_init_key_once(bool publish); 1438void tcp_fastopen_init_key_once(bool publish);
1428#define TCP_FASTOPEN_KEY_LENGTH 16 1439#define TCP_FASTOPEN_KEY_LENGTH 16
1429 1440
@@ -1618,7 +1629,6 @@ static inline bool tcp_stream_is_thin(struct tcp_sock *tp)
1618/* /proc */ 1629/* /proc */
1619enum tcp_seq_states { 1630enum tcp_seq_states {
1620 TCP_SEQ_STATE_LISTENING, 1631 TCP_SEQ_STATE_LISTENING,
1621 TCP_SEQ_STATE_OPENREQ,
1622 TCP_SEQ_STATE_ESTABLISHED, 1632 TCP_SEQ_STATE_ESTABLISHED,
1623}; 1633};
1624 1634
@@ -1637,7 +1647,6 @@ struct tcp_iter_state {
1637 enum tcp_seq_states state; 1647 enum tcp_seq_states state;
1638 struct sock *syn_wait_sk; 1648 struct sock *syn_wait_sk;
1639 int bucket, offset, sbucket, num; 1649 int bucket, offset, sbucket, num;
1640 kuid_t uid;
1641 loff_t last_pos; 1650 loff_t last_pos;
1642}; 1651};
1643 1652
@@ -1674,7 +1683,7 @@ int tcp4_proc_init(void);
1674void tcp4_proc_exit(void); 1683void tcp4_proc_exit(void);
1675#endif 1684#endif
1676 1685
1677int tcp_rtx_synack(struct sock *sk, struct request_sock *req); 1686int tcp_rtx_synack(const struct sock *sk, struct request_sock *req);
1678int tcp_conn_request(struct request_sock_ops *rsk_ops, 1687int tcp_conn_request(struct request_sock_ops *rsk_ops,
1679 const struct tcp_request_sock_ops *af_ops, 1688 const struct tcp_request_sock_ops *af_ops,
1680 struct sock *sk, struct sk_buff *skb); 1689 struct sock *sk, struct sk_buff *skb);
@@ -1682,7 +1691,7 @@ int tcp_conn_request(struct request_sock_ops *rsk_ops,
1682/* TCP af-specific functions */ 1691/* TCP af-specific functions */
1683struct tcp_sock_af_ops { 1692struct tcp_sock_af_ops {
1684#ifdef CONFIG_TCP_MD5SIG 1693#ifdef CONFIG_TCP_MD5SIG
1685 struct tcp_md5sig_key *(*md5_lookup) (struct sock *sk, 1694 struct tcp_md5sig_key *(*md5_lookup) (const struct sock *sk,
1686 const struct sock *addr_sk); 1695 const struct sock *addr_sk);
1687 int (*calc_md5_hash)(char *location, 1696 int (*calc_md5_hash)(char *location,
1688 const struct tcp_md5sig_key *md5, 1697 const struct tcp_md5sig_key *md5,
@@ -1697,40 +1706,42 @@ struct tcp_sock_af_ops {
1697struct tcp_request_sock_ops { 1706struct tcp_request_sock_ops {
1698 u16 mss_clamp; 1707 u16 mss_clamp;
1699#ifdef CONFIG_TCP_MD5SIG 1708#ifdef CONFIG_TCP_MD5SIG
1700 struct tcp_md5sig_key *(*req_md5_lookup)(struct sock *sk, 1709 struct tcp_md5sig_key *(*req_md5_lookup)(const struct sock *sk,
1701 const struct sock *addr_sk); 1710 const struct sock *addr_sk);
1702 int (*calc_md5_hash) (char *location, 1711 int (*calc_md5_hash) (char *location,
1703 const struct tcp_md5sig_key *md5, 1712 const struct tcp_md5sig_key *md5,
1704 const struct sock *sk, 1713 const struct sock *sk,
1705 const struct sk_buff *skb); 1714 const struct sk_buff *skb);
1706#endif 1715#endif
1707 void (*init_req)(struct request_sock *req, struct sock *sk, 1716 void (*init_req)(struct request_sock *req,
1717 const struct sock *sk_listener,
1708 struct sk_buff *skb); 1718 struct sk_buff *skb);
1709#ifdef CONFIG_SYN_COOKIES 1719#ifdef CONFIG_SYN_COOKIES
1710 __u32 (*cookie_init_seq)(struct sock *sk, const struct sk_buff *skb, 1720 __u32 (*cookie_init_seq)(const struct sk_buff *skb,
1711 __u16 *mss); 1721 __u16 *mss);
1712#endif 1722#endif
1713 struct dst_entry *(*route_req)(struct sock *sk, struct flowi *fl, 1723 struct dst_entry *(*route_req)(const struct sock *sk, struct flowi *fl,
1714 const struct request_sock *req, 1724 const struct request_sock *req,
1715 bool *strict); 1725 bool *strict);
1716 __u32 (*init_seq)(const struct sk_buff *skb); 1726 __u32 (*init_seq)(const struct sk_buff *skb);
1717 int (*send_synack)(struct sock *sk, struct dst_entry *dst, 1727 int (*send_synack)(const struct sock *sk, struct dst_entry *dst,
1718 struct flowi *fl, struct request_sock *req, 1728 struct flowi *fl, struct request_sock *req,
1719 u16 queue_mapping, struct tcp_fastopen_cookie *foc); 1729 struct tcp_fastopen_cookie *foc,
1720 void (*queue_hash_add)(struct sock *sk, struct request_sock *req, 1730 bool attach_req);
1721 const unsigned long timeout);
1722}; 1731};
1723 1732
1724#ifdef CONFIG_SYN_COOKIES 1733#ifdef CONFIG_SYN_COOKIES
1725static inline __u32 cookie_init_sequence(const struct tcp_request_sock_ops *ops, 1734static inline __u32 cookie_init_sequence(const struct tcp_request_sock_ops *ops,
1726 struct sock *sk, struct sk_buff *skb, 1735 const struct sock *sk, struct sk_buff *skb,
1727 __u16 *mss) 1736 __u16 *mss)
1728{ 1737{
1729 return ops->cookie_init_seq(sk, skb, mss); 1738 tcp_synq_overflow(sk);
1739 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_SYNCOOKIESSENT);
1740 return ops->cookie_init_seq(skb, mss);
1730} 1741}
1731#else 1742#else
1732static inline __u32 cookie_init_sequence(const struct tcp_request_sock_ops *ops, 1743static inline __u32 cookie_init_sequence(const struct tcp_request_sock_ops *ops,
1733 struct sock *sk, struct sk_buff *skb, 1744 const struct sock *sk, struct sk_buff *skb,
1734 __u16 *mss) 1745 __u16 *mss)
1735{ 1746{
1736 return 0; 1747 return 0;
@@ -1742,6 +1753,19 @@ int tcpv4_offload_init(void);
1742void tcp_v4_init(void); 1753void tcp_v4_init(void);
1743void tcp_init(void); 1754void tcp_init(void);
1744 1755
1756/* tcp_recovery.c */
1757
1758/* Flags to enable various loss recovery features. See below */
1759extern int sysctl_tcp_recovery;
1760
1761/* Use TCP RACK to detect (some) tail and retransmit losses */
1762#define TCP_RACK_LOST_RETRANS 0x1
1763
1764extern int tcp_rack_mark_lost(struct sock *sk);
1765
1766extern void tcp_rack_advance(struct tcp_sock *tp,
1767 const struct skb_mstamp *xmit_time, u8 sacked);
1768
1745/* 1769/*
1746 * Save and compile IPv4 options, return a pointer to it 1770 * Save and compile IPv4 options, return a pointer to it
1747 */ 1771 */