From nobody Mon Feb 9 16:32:50 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:cbb9:0:0:0:0:0 with SMTP id v25csp398537jap; Wed, 15 Dec 2021 16:33:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3g1Pdgh2wA1Kn9qzngFeHo/VPyW3MkJbvy5w1Y61REJQmdOTGWUgtk7mCOtAIQph0oOrW X-Received: by 2002:a63:82c8:: with SMTP id w191mr8122185pgd.92.1639614824676; Wed, 15 Dec 2021 16:33:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639614824; cv=none; d=google.com; s=arc-20160816; b=q8qXY5X8BAyseUlrxdlRPMiJnQ6IhFyDumXCii+jF8sVtW3Ob5/F6SlRmR1aX8fWBk fDirzfXNv4X1GiC3xNGQxcSg6PNPHePKXyvVL6Qrn5X+ukvstXoZ6dGGuZmlcPATDPk9 BK+W2PX44brdZoKASlcQ9wYYm6Vir0RqRcj3j1RkAg7nL8kTvVdtmQZ/PfcyGpQw/ZHn J/efSxEYVmrCtcNWRz34diBtzXcPzwoRrqbUE3LGr+HSjy1AnX2OYwqqL03ekGxuBmBG O7LEilWOo89GzTkcb3jFO0L+7LLfnukLbs0KEYsbzcnDp47v0rZyRplgZLb/nAXQYMrm UVhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from; bh=6Axqo2BuxD+UNEmy8AuRQE80univObFT5QAUQ1C5sDY=; b=WZU6ijvZOeExL3deqmKqkRvOnETezr5hawSClOf2gcHu3zKn1Md29XTpTmpTtgJA05 wKE8nwbtyrnawS4W0DAAIpPeH/NoVHqY4G1kTBl0/7on3h+uCMGQd4lB5UM3ffrpcIrB /beuHvCiUKfeFHfoq19jvm29aBjhw5Oe46ta8rYt1aiJ9wa1U06YHhCH69Grl2ldK72Q c+bfnpncq6ghttumhYF2kRPYqtuFBwp2jIoNWYTMXs1YQWYWcXam1MAJGcaMTruw87xl Zcr5VOe7LhLcgmyXf76Lwu/1ZILql+EhhV5pA6JFQHqyyjFkEI5tTeF0trPPZH70Mvcb Orgg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mptcp+bounces-2777-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2777-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sjc.edge.kernel.org (sjc.edge.kernel.org. [2604:1380:1000:8100::1]) by mx.google.com with ESMTPS id mj7si7295535pjb.71.2021.12.15.16.33.44 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Dec 2021 16:33:44 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-2777-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) client-ip=2604:1380:1000:8100::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mptcp+bounces-2777-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1000:8100::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2777-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sjc.edge.kernel.org (Postfix) with ESMTPS id D1BFD3E0585 for ; Thu, 16 Dec 2021 00:33:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EC2D12CA9; Thu, 16 Dec 2021 00:33:42 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (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 69B592C9E for ; Thu, 16 Dec 2021 00:33:41 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10199"; a="302742055" X-IronPort-AV: E=Sophos;i="5.88,209,1635231600"; d="scan'208";a="302742055" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2021 16:33:30 -0800 X-IronPort-AV: E=Sophos;i="5.88,209,1635231600"; d="scan'208";a="465835391" Received: from mjmartin-desk2.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.209.72.63]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Dec 2021 16:33:28 -0800 From: Mat Martineau To: mptcp@lists.linux.dev Cc: Mat Martineau Subject: [PATCH mptcp-next v4 3/6] mptcp: Bypass kernel PM when userspace PM is enabled Date: Wed, 15 Dec 2021 16:33:21 -0800 Message-Id: <20211216003324.403195-4-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211216003324.403195-1-mathew.j.martineau@linux.intel.com> References: <20211216003324.403195-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: quoted-printable Content-Type: text/plain; charset="utf-8" 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. v2: Remove unneeded check in mptcp_pm_rm_addr_received() (Kishen Maloor) v3: Add and use helper function for PM mode (Paolo Abeni) Signed-off-by: Mat Martineau --- net/mptcp/pm.c | 2 +- net/mptcp/protocol.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index e72e6010e323..47ac9651e12c 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -208,7 +208,7 @@ void mptcp_pm_add_addr_received(struct mptcp_sock *msk, =20 spin_lock_bh(&pm->lock); =20 - if (!READ_ONCE(pm->accept_addr)) { + if (!READ_ONCE(pm->accept_addr) || mptcp_pm_is_userspace(msk)) { 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)) { diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 2fe59769b037..0c680a5177eb 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -799,6 +799,11 @@ static inline bool mptcp_pm_should_rm_signal(struct mp= tcp_sock *msk) return READ_ONCE(msk->pm.addr_signal) & BIT(MPTCP_RM_ADDR_SIGNAL); } =20 +static inline bool mptcp_pm_is_userspace(struct mptcp_sock *msk) +{ + return READ_ONCE(msk->pm.pm_type) !=3D MPTCP_PM_TYPE_KERNEL; +} + static inline unsigned int mptcp_add_addr_len(int family, bool echo, bool = port) { u8 len =3D TCPOLEN_MPTCP_ADD_ADDR_BASE; --=20 2.34.1