Skip to content

Commit 6d56a6c

Browse files
Paolo Abenismb49
authored andcommitted
mptcp: drop the push_pending field
BugLink: https://bugs.launchpad.net/bugs/2061814 commit bdd70eb upstream. Such field is there to avoid acquiring the data lock in a few spots, but it adds complexity to the already non trivial locking schema. All the relevant call sites (mptcp-level re-injection, set socket options), are slow-path, drop such field in favor of 'cb_flags', adding the relevant locking. This patch could be seen as an improvement, instead of a fix. But it simplifies the next patch. The 'Fixes' tag has been added to help having this series backported to stable. Fixes: e9d09ba ("mptcp: avoid atomic bit manipulation when possible") Cc: [email protected] Signed-off-by: Paolo Abeni <[email protected]> Reviewed-by: Mat Martineau <[email protected]> Signed-off-by: Matthieu Baerts (NGI0) <[email protected]> Signed-off-by: David S. Miller <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Portia Stephens <[email protected]> Signed-off-by: Roxana Nicolescu <[email protected]>
1 parent 29de55f commit 6d56a6c

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

net/mptcp/protocol.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1544,8 +1544,11 @@ static void mptcp_update_post_push(struct mptcp_sock *msk,
15441544

15451545
void mptcp_check_and_set_pending(struct sock *sk)
15461546
{
1547-
if (mptcp_send_head(sk))
1548-
mptcp_sk(sk)->push_pending |= BIT(MPTCP_PUSH_PENDING);
1547+
if (mptcp_send_head(sk)) {
1548+
mptcp_data_lock(sk);
1549+
mptcp_sk(sk)->cb_flags |= BIT(MPTCP_PUSH_PENDING);
1550+
mptcp_data_unlock(sk);
1551+
}
15491552
}
15501553

15511554
void __mptcp_push_pending(struct sock *sk, unsigned int flags)
@@ -3105,7 +3108,6 @@ static int mptcp_disconnect(struct sock *sk, int flags)
31053108
msk->last_snd = NULL;
31063109
WRITE_ONCE(msk->flags, 0);
31073110
msk->cb_flags = 0;
3108-
msk->push_pending = 0;
31093111
msk->recovery = false;
31103112
msk->can_ack = false;
31113113
msk->fully_established = false;
@@ -3340,8 +3342,7 @@ static void mptcp_release_cb(struct sock *sk)
33403342
struct mptcp_sock *msk = mptcp_sk(sk);
33413343

33423344
for (;;) {
3343-
unsigned long flags = (msk->cb_flags & MPTCP_FLAGS_PROCESS_CTX_NEED) |
3344-
msk->push_pending;
3345+
unsigned long flags = (msk->cb_flags & MPTCP_FLAGS_PROCESS_CTX_NEED);
33453346
struct list_head join_list;
33463347

33473348
if (!flags)
@@ -3357,7 +3358,6 @@ static void mptcp_release_cb(struct sock *sk)
33573358
* datapath acquires the msk socket spinlock while helding
33583359
* the subflow socket lock
33593360
*/
3360-
msk->push_pending = 0;
33613361
msk->cb_flags &= ~flags;
33623362
spin_unlock_bh(&sk->sk_lock.slock);
33633363

net/mptcp/protocol.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,6 @@ struct mptcp_sock {
285285
int rmem_released;
286286
unsigned long flags;
287287
unsigned long cb_flags;
288-
unsigned long push_pending;
289288
bool recovery; /* closing subflow write queue reinjected */
290289
bool can_ack;
291290
bool fully_established;

0 commit comments

Comments
 (0)