From nobody Sat Dec 21 12:31:13 2024 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 93C1318AE5; Mon, 21 Aug 2023 22:25:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EAAF2C433CC; Mon, 21 Aug 2023 22:25:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692656723; bh=EtjkMo5Utfqyb2HvZTJ81wkGvDCfsqeXl+lqQcBmj0I=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=vK/16cRIZTOf1gUU0TMhI0AXu3D9oHzRBO3GIJkMsbmoA7pNJ8S02nvP4j0Q6mJEZ YSdrnUrkJYvWlMSSONZ0osbaSgI7zOgwSohZdJiMkOGg3gBB6baNzED9dBRwyBROjJ WZOYIk0DaPQJuI1QuFuJtMMU/UdCUJnqe01kIANieTA6Dj2WvXbzF2BreJFu+hf/SP X2oXKDbknliN3GaZLEhLh3MHEYx+cvvv0W1mxD45dnrvcRvYm8L8hlkRkKKsfs76f1 BLABacmaKBxw+u/DrUbQExVhuH75QuF1A7HuxJ7xoC0GdQd+TuEx8yZ/ew61H4spKe KPhkrkukT21gQ== From: Mat Martineau Date: Mon, 21 Aug 2023 15:25:13 -0700 Subject: [PATCH net-next 02/10] mptcp: drop last_snd and MPTCP_RESET_SCHEDULER Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20230821-upstream-net-next-20230818-v1-2-0c860fb256a8@kernel.org> References: <20230821-upstream-net-next-20230818-v1-0-0c860fb256a8@kernel.org> In-Reply-To: <20230821-upstream-net-next-20230818-v1-0-0c860fb256a8@kernel.org> To: Matthieu Baerts , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, mptcp@lists.linux.dev, Geliang Tang , Mat Martineau X-Mailer: b4 0.12.3 From: Geliang Tang Since the burst check conditions have moved out of the function mptcp_subflow_get_send(), it makes all msk->last_snd useless. This patch drops them as well as the macro MPTCP_RESET_SCHEDULER. Reviewed-by: Mat Martineau Signed-off-by: Geliang Tang Signed-off-by: Mat Martineau --- net/mptcp/pm.c | 9 +-------- net/mptcp/pm_netlink.c | 3 --- net/mptcp/protocol.c | 11 +---------- net/mptcp/protocol.h | 2 -- 4 files changed, 2 insertions(+), 23 deletions(-) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 7dbbad1e4f55..d8da5374d9e1 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -299,15 +299,8 @@ void mptcp_pm_mp_prio_received(struct sock *ssk, u8 bk= up) =20 pr_debug("subflow->backup=3D%d, bkup=3D%d\n", subflow->backup, bkup); msk =3D mptcp_sk(sk); - if (subflow->backup !=3D bkup) { + if (subflow->backup !=3D bkup) subflow->backup =3D bkup; - mptcp_data_lock(sk); - if (!sock_owned_by_user(sk)) - msk->last_snd =3D NULL; - else - __set_bit(MPTCP_RESET_SCHEDULER, &msk->cb_flags); - mptcp_data_unlock(sk); - } =20 mptcp_event(MPTCP_EVENT_SUB_PRIORITY, msk, ssk, GFP_ATOMIC); } diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index c75d9d88a053..9661f3812682 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -472,9 +472,6 @@ static void __mptcp_pm_send_ack(struct mptcp_sock *msk,= struct mptcp_subflow_con =20 slow =3D lock_sock_fast(ssk); if (prio) { - if (subflow->backup !=3D backup) - msk->last_snd =3D NULL; - subflow->send_mp_prio =3D 1; subflow->backup =3D backup; subflow->request_bkup =3D backup; diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 29c662ffcd05..f15ff80be30f 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -1438,16 +1438,13 @@ static struct sock *mptcp_subflow_get_send(struct m= ptcp_sock *msk) =20 burst =3D min_t(int, MPTCP_SEND_BURST_SIZE, mptcp_wnd_end(msk) - msk->snd= _nxt); wmem =3D READ_ONCE(ssk->sk_wmem_queued); - if (!burst) { - msk->last_snd =3D NULL; + if (!burst) return ssk; - } =20 subflow =3D mptcp_subflow_ctx(ssk); subflow->avg_pacing_rate =3D div_u64((u64)subflow->avg_pacing_rate * wmem= + READ_ONCE(ssk->sk_pacing_rate) * burst, burst + wmem); - msk->last_snd =3D ssk; msk->snd_burst =3D burst; return ssk; } @@ -2379,9 +2376,6 @@ static void __mptcp_close_ssk(struct sock *sk, struct= sock *ssk, WRITE_ONCE(msk->first, NULL); =20 out: - if (ssk =3D=3D msk->last_snd) - msk->last_snd =3D NULL; - if (need_push) __mptcp_push_pending(sk, 0); } @@ -3046,7 +3040,6 @@ static int mptcp_disconnect(struct sock *sk, int flag= s) * subflow */ mptcp_destroy_common(msk, MPTCP_CF_FASTCLOSE); - msk->last_snd =3D NULL; WRITE_ONCE(msk->flags, 0); msk->cb_flags =3D 0; msk->push_pending =3D 0; @@ -3316,8 +3309,6 @@ static void mptcp_release_cb(struct sock *sk) __mptcp_set_connected(sk); if (__test_and_clear_bit(MPTCP_ERROR_REPORT, &msk->cb_flags)) __mptcp_error_report(sk); - if (__test_and_clear_bit(MPTCP_RESET_SCHEDULER, &msk->cb_flags)) - msk->last_snd =3D NULL; } =20 __mptcp_update_rmem(sk); diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 38c7ea013361..cbf9a9e176b2 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -123,7 +123,6 @@ #define MPTCP_RETRANSMIT 4 #define MPTCP_FLUSH_JOIN_LIST 5 #define MPTCP_CONNECTED 6 -#define MPTCP_RESET_SCHEDULER 7 =20 struct mptcp_skb_cb { u64 map_seq; @@ -269,7 +268,6 @@ struct mptcp_sock { u64 rcv_data_fin_seq; u64 bytes_retrans; int rmem_fwd_alloc; - struct sock *last_snd; int snd_burst; int old_wspace; u64 recovery_snd_nxt; /* in recovery mode accept up to this seq; --=20 2.41.0