Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (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 AB5692C95 for ; Thu, 18 Nov 2021 01:30:16 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10171"; a="231577913" X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="231577913" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2021 17:30:14 -0800 X-IronPort-AV: E=Sophos;i="5.87,243,1631602800"; d="scan'208";a="568294746" Received: from mjmartin-desk2.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.251.27.251]) by fmsmga004-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2021 17:30:14 -0800 From: Mat Martineau To: mptcp@lists.linux.dev Cc: Mat Martineau Subject: [PATCH mptcp-next 3/6] mptcp: Bypass kernel PM when userspace PM is enabled Date: Wed, 17 Nov 2021 17:30:02 -0800 Message-Id: <20211118013005.263660-4-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211118013005.263660-1-mathew.j.martineau@linux.intel.com> References: <20211118013005.263660-1-mathew.j.martineau@linux.intel.com> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit When a MPTCP connection is managed by a userspace PM, bypass the kernel PM for incoming advertisements and subflow events. Netlink events are still sent to userspace. Signed-off-by: Mat Martineau --- net/mptcp/pm.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 3a3800771aca..7f96a888e2d5 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -189,7 +189,8 @@ void mptcp_pm_add_addr_received(struct mptcp_sock *msk, spin_lock_bh(&pm->lock); - if (!READ_ONCE(pm->accept_addr)) { + if (!READ_ONCE(pm->accept_addr) || + READ_ONCE(pm->pm_type) != MPTCP_PM_TYPE_KERNEL) { mptcp_pm_announce_addr(msk, addr, true); mptcp_pm_add_addr_send_ack(msk); } else if (mptcp_pm_schedule_work(msk, MPTCP_PM_ADD_ADDR_RECEIVED)) { @@ -233,6 +234,9 @@ void mptcp_pm_rm_addr_received(struct mptcp_sock *msk, for (i = 0; i < rm_list->nr; i++) mptcp_event_addr_removed(msk, rm_list->ids[i]); + if (READ_ONCE(pm->pm_type) != MPTCP_PM_TYPE_KERNEL) + return; + spin_lock_bh(&pm->lock); mptcp_pm_schedule_work(msk, MPTCP_PM_RM_ADDR_RECEIVED); pm->rm_list_rx = *rm_list; -- 2.34.0