]> git.baikalelectronics.ru Git - kernel.git/commitdiff
mptcp: schedule work for better snd subflow selection
authorPaolo Abeni <pabeni@redhat.com>
Wed, 20 Jan 2021 14:39:13 +0000 (15:39 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 23 Jan 2021 03:21:02 +0000 (19:21 -0800)
Otherwise the packet scheduler policy will not be
enforced when pushing pending data at MPTCP-level
ack reception time.

Reviewed-by: Mat Martineau <mathew.j.martineau@linux.intel.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/mptcp/protocol.c

index e741201acc98f626b15eda332e4e79eed2be8828..8cb582eee286299780ea550615a42fbf576bd5ff 100644 (file)
@@ -2242,6 +2242,7 @@ static void mptcp_worker(struct work_struct *work)
        if (unlikely(state == TCP_CLOSE))
                goto unlock;
 
+       mptcp_push_pending(sk, 0);
        mptcp_check_data_fin_ack(sk);
        __mptcp_flush_join_list(msk);
 
@@ -2899,10 +2900,14 @@ void __mptcp_check_push(struct sock *sk, struct sock *ssk)
        if (!mptcp_send_head(sk))
                return;
 
-       if (!sock_owned_by_user(sk))
-               __mptcp_subflow_push_pending(sk, ssk);
-       else
+       if (!sock_owned_by_user(sk)) {
+               if (mptcp_subflow_get_send(mptcp_sk(sk)) == ssk)
+                       __mptcp_subflow_push_pending(sk, ssk);
+               else
+                       mptcp_schedule_work(sk);
+       } else {
                set_bit(MPTCP_PUSH_PENDING, &mptcp_sk(sk)->flags);
+       }
 }
 
 #define MPTCP_DEFERRED_ALL (TCPF_WRITE_TIMER_DEFERRED)