aboutsummaryrefslogtreecommitdiffstats
path: root/include/net
diff options
context:
space:
mode:
Diffstat (limited to 'include/net')
-rw-r--r--include/net/bluetooth/hci_core.h1
-rw-r--r--include/net/tcp.h58
2 files changed, 37 insertions, 22 deletions
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index be5bd713d2c9..73aead222b32 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -457,6 +457,7 @@ int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count);
457 457
458int hci_register_sysfs(struct hci_dev *hdev); 458int hci_register_sysfs(struct hci_dev *hdev);
459void hci_unregister_sysfs(struct hci_dev *hdev); 459void hci_unregister_sysfs(struct hci_dev *hdev);
460void hci_conn_init_sysfs(struct hci_conn *conn);
460void hci_conn_add_sysfs(struct hci_conn *conn); 461void hci_conn_add_sysfs(struct hci_conn *conn);
461void hci_conn_del_sysfs(struct hci_conn *conn); 462void hci_conn_del_sysfs(struct hci_conn *conn);
462 463
diff --git a/include/net/tcp.h b/include/net/tcp.h
index b55b4891029e..19f4150f4d4d 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -41,6 +41,7 @@
41#include <net/ip.h> 41#include <net/ip.h>
42#include <net/tcp_states.h> 42#include <net/tcp_states.h>
43#include <net/inet_ecn.h> 43#include <net/inet_ecn.h>
44#include <net/dst.h>
44 45
45#include <linux/seq_file.h> 46#include <linux/seq_file.h>
46 47
@@ -543,6 +544,17 @@ static inline void tcp_fast_path_check(struct sock *sk)
543 tcp_fast_path_on(tp); 544 tcp_fast_path_on(tp);
544} 545}
545 546
547/* Compute the actual rto_min value */
548static inline u32 tcp_rto_min(struct sock *sk)
549{
550 struct dst_entry *dst = __sk_dst_get(sk);
551 u32 rto_min = TCP_RTO_MIN;
552
553 if (dst && dst_metric_locked(dst, RTAX_RTO_MIN))
554 rto_min = dst_metric_rtt(dst, RTAX_RTO_MIN);
555 return rto_min;
556}
557
546/* Compute the actual receive window we are currently advertising. 558/* Compute the actual receive window we are currently advertising.
547 * Rcv_nxt can be after the window if our peer push more data 559 * Rcv_nxt can be after the window if our peer push more data
548 * than the offered window. 560 * than the offered window.
@@ -890,30 +902,32 @@ static inline int tcp_prequeue(struct sock *sk, struct sk_buff *skb)
890{ 902{
891 struct tcp_sock *tp = tcp_sk(sk); 903 struct tcp_sock *tp = tcp_sk(sk);
892 904
893 if (!sysctl_tcp_low_latency && tp->ucopy.task) { 905 if (sysctl_tcp_low_latency || !tp->ucopy.task)
894 __skb_queue_tail(&tp->ucopy.prequeue, skb); 906 return 0;
895 tp->ucopy.memory += skb->truesize; 907
896 if (tp->ucopy.memory > sk->sk_rcvbuf) { 908 __skb_queue_tail(&tp->ucopy.prequeue, skb);
897 struct sk_buff *skb1; 909 tp->ucopy.memory += skb->truesize;
898 910 if (tp->ucopy.memory > sk->sk_rcvbuf) {
899 BUG_ON(sock_owned_by_user(sk)); 911 struct sk_buff *skb1;
900 912
901 while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) { 913 BUG_ON(sock_owned_by_user(sk));
902 sk_backlog_rcv(sk, skb1); 914
903 NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPPREQUEUEDROPPED); 915 while ((skb1 = __skb_dequeue(&tp->ucopy.prequeue)) != NULL) {
904 } 916 sk_backlog_rcv(sk, skb1);
905 917 NET_INC_STATS_BH(sock_net(sk),
906 tp->ucopy.memory = 0; 918 LINUX_MIB_TCPPREQUEUEDROPPED);
907 } else if (skb_queue_len(&tp->ucopy.prequeue) == 1) {
908 wake_up_interruptible(sk->sk_sleep);
909 if (!inet_csk_ack_scheduled(sk))
910 inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK,
911 (3 * TCP_RTO_MIN) / 4,
912 TCP_RTO_MAX);
913 } 919 }
914 return 1; 920
921 tp->ucopy.memory = 0;
922 } else if (skb_queue_len(&tp->ucopy.prequeue) == 1) {
923 wake_up_interruptible_poll(sk->sk_sleep,
924 POLLIN | POLLRDNORM | POLLRDBAND);
925 if (!inet_csk_ack_scheduled(sk))
926 inet_csk_reset_xmit_timer(sk, ICSK_TIME_DACK,
927 (3 * tcp_rto_min(sk)) / 4,
928 TCP_RTO_MAX);
915 } 929 }
916 return 0; 930 return 1;
917} 931}
918 932
919 933