Merge tag 'perf-core-for-mingo-20160922' of git://git.kernel.org/pub/scm/linux/kernel...
[cascardo/linux.git] / net / ipv4 / tcp_fastopen.c
index cffd8f9..4e777a3 100644 (file)
@@ -150,6 +150,7 @@ void tcp_fastopen_add_skb(struct sock *sk, struct sk_buff *skb)
        tp->segs_in = 0;
        tcp_segs_in(tp, skb);
        __skb_pull(skb, tcp_hdrlen(skb));
+       sk_forced_mem_schedule(sk, skb->truesize);
        skb_set_owner_r(skb, sk);
 
        TCP_SKB_CB(skb)->seq++;
@@ -226,6 +227,7 @@ static struct sock *tcp_fastopen_create_child(struct sock *sk,
        tcp_fastopen_add_skb(child, skb);
 
        tcp_rsk(req)->rcv_nxt = tp->rcv_nxt;
+       tp->rcv_wup = tp->rcv_nxt;
        /* tcp_conn_request() is sending the SYNACK,
         * and queues the child into listener accept queue.
         */
@@ -255,9 +257,9 @@ static bool tcp_fastopen_queue_check(struct sock *sk)
                spin_lock(&fastopenq->lock);
                req1 = fastopenq->rskq_rst_head;
                if (!req1 || time_after(req1->rsk_timer.expires, jiffies)) {
+                       __NET_INC_STATS(sock_net(sk),
+                                       LINUX_MIB_TCPFASTOPENLISTENOVERFLOW);
                        spin_unlock(&fastopenq->lock);
-                       NET_INC_STATS_BH(sock_net(sk),
-                                        LINUX_MIB_TCPFASTOPENLISTENOVERFLOW);
                        return false;
                }
                fastopenq->rskq_rst_head = req1->dl_next;
@@ -282,7 +284,7 @@ struct sock *tcp_try_fastopen(struct sock *sk, struct sk_buff *skb,
        struct sock *child;
 
        if (foc->len == 0) /* Client requests a cookie */
-               NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPFASTOPENCOOKIEREQD);
+               NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPFASTOPENCOOKIEREQD);
 
        if (!((sysctl_tcp_fastopen & TFO_SERVER_ENABLE) &&
              (syn_data || foc->len >= 0) &&
@@ -311,13 +313,13 @@ fastopen:
                child = tcp_fastopen_create_child(sk, skb, dst, req);
                if (child) {
                        foc->len = -1;
-                       NET_INC_STATS_BH(sock_net(sk),
-                                        LINUX_MIB_TCPFASTOPENPASSIVE);
+                       NET_INC_STATS(sock_net(sk),
+                                     LINUX_MIB_TCPFASTOPENPASSIVE);
                        return child;
                }
-               NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPFASTOPENPASSIVEFAIL);
+               NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPFASTOPENPASSIVEFAIL);
        } else if (foc->len > 0) /* Client presents an invalid cookie */
-               NET_INC_STATS_BH(sock_net(sk), LINUX_MIB_TCPFASTOPENPASSIVEFAIL);
+               NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPFASTOPENPASSIVEFAIL);
 
        valid_foc.exp = foc->exp;
        *foc = valid_foc;