Skip to content

Commit 95bcf82

Browse files
matttbeintel-lab-lkp
authored andcommitted
mptcp: pm: exit early with ADD_ADDR echo if possible
When the userspace PM is used, or when the in-kernel limits are reached, there will be no need to schedule the PM worker to signal new addresses. That corresponds to pm->work_pending set to 0. In this case, an early exit can be done in mptcp_pm_add_addr_echoed() not to hold the PM lock, and iterate over the announced addresses list, not to schedule the worker anyway in this case. This is similar to what is done when a connection or a subflow has been established. Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
1 parent 1238896 commit 95bcf82

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/mptcp/pm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,9 @@ void mptcp_pm_add_addr_echoed(struct mptcp_sock *msk,
251251

252252
pr_debug("msk=%p\n", msk);
253253

254+
if (!READ_ONCE(pm->work_pending))
255+
return;
256+
254257
spin_lock_bh(&pm->lock);
255258

256259
if (mptcp_lookup_anno_list_by_saddr(msk, addr) && READ_ONCE(pm->work_pending))

0 commit comments

Comments
 (0)