From nobody Mon Feb 9 18:43:14 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:cbb9:0:0:0:0:0 with SMTP id v25csp6436871jap; Mon, 13 Dec 2021 17:47:24 -0800 (PST) X-Google-Smtp-Source: ABdhPJyoOW93OCbe1i5MWbbaxwAR6g/vMdTdm5UIal14oCYgELDO9H0WHkCM1uIhsOxlB2+NB7z4 X-Received: by 2002:a05:622a:202:: with SMTP id b2mr2698501qtx.34.1639446444656; Mon, 13 Dec 2021 17:47:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639446444; cv=none; d=google.com; s=arc-20160816; b=w54dGHCIiZrGGKJqCe8mjylu2Kdu49NrmssmXaYtJ4aPBeUYXElKNzXQBtsImmOB5c +olRZIRJYJCn3hbQe1kpXC//jg97M9SjU8Wl4cqNKFMbJT5aciOEvtXBbmT/aupXi37n JQZm33eEdQ3q4K+hXCaaF6Amh+51rOrX9JXKefYuhSyIf249evcVenWFCPy2pgMngrQs nz6MHRBae7XSdqo2Rkhxgo5AuxUKdDK/yXDlBnCSqaRQqcjxtsd2x4eXLVQo4kHSpm36 XEDt7MRruIMQ6tsDElDhivCotUYO40d4Fsava+It/adCYDUvpeZg9YhBg+6qbGXlocio REsA== 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=iRFD4mN8XgZbO6ousZ/VcTxGFziu3T4tt+KgVuKrW7k=; b=y/cte7vG+8wJ9ej+1ipkPOz1gda4VGlh9Bj+4Rl8dLXoooVoWab7NyuvyB4dPzIQZ6 lSpbtcfmnzitw6kemtZzUXVw8axnCoukjAelcM74XMGnu2BgaCfQcK22i7N45+FcwAEw bc/oYFSveEnHvIznyaYoXOkcXEnnB5VgJxzj2EtB0mo/Hcw8fFX3cr7GAEVtsYlcwcuc Fqvmg7M9Jt140UTdnJTgQbrSPTIGzcZOjO8bJcdM0o9vVejorYQyGdx6QU5vCMlsk4O7 BtDuLmZ9jG3ltgv6PmrQJb9dewfPIFdROiciYf6LhUIAxmuokrWjRxc8h+WdNym75Jkt 5qOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mptcp+bounces-2736-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2736-wpasupplicant.patchew=gmail.com@lists.linux.dev"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ewr.edge.kernel.org (ewr.edge.kernel.org. [2604:1380:1:3600::1]) by mx.google.com with ESMTPS id c20si13434886qtd.203.2021.12.13.17.47.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Dec 2021 17:47:24 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-2736-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) client-ip=2604:1380:1:3600::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of mptcp+bounces-2736-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2736-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 ewr.edge.kernel.org (Postfix) with ESMTPS id 67F711C0BED for ; Tue, 14 Dec 2021 01:47:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6603F3FD3; Tue, 14 Dec 2021 01:47:21 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) (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 7EC2168 for ; Tue, 14 Dec 2021 01:47:20 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10197"; a="237609790" X-IronPort-AV: E=Sophos;i="5.88,204,1635231600"; d="scan'208";a="237609790" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2021 17:47:17 -0800 X-IronPort-AV: E=Sophos;i="5.88,204,1635231600"; d="scan'208";a="463602364" Received: from mjmartin-desk2.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.251.17.231]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Dec 2021 17:47:16 -0800 From: Mat Martineau To: mptcp@lists.linux.dev Cc: Mat Martineau Subject: [PATCH mptcp-next v3 3/6] mptcp: Bypass kernel PM when userspace PM is enabled Date: Mon, 13 Dec 2021 17:46:44 -0800 Message-Id: <20211214014647.136505-4-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20211214014647.136505-1-mathew.j.martineau@linux.intel.com> References: <20211214014647.136505-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 053afb058440..cff0d9585ab4 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -189,7 +189,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 478abe18b9e9..9e84a46f3d87 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -798,6 +798,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