From nobody Mon Feb 9 16:32:39 2026 Delivered-To: wpasupplicant.patchew@gmail.com Received: by 2002:a02:cbb9:0:0:0:0:0 with SMTP id v25csp398597jap; Wed, 15 Dec 2021 16:33:49 -0800 (PST) X-Google-Smtp-Source: ABdhPJzfB+uYzP5McmPt18Usc3AAduw8d/iVnnt1UN0awdKWQtHwSbPMpjjKt1DY4Bnc6Ejnrbbi X-Received: by 2002:ac8:5a90:: with SMTP id c16mr14903483qtc.199.1639614829095; Wed, 15 Dec 2021 16:33:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1639614829; cv=none; d=google.com; s=arc-20160816; b=NO1Ec28nBno/ImsKKccTie0o+U+54ZBWvIkzMnoBPXiG5mDw6sGAoBB1yQSfDJNiJv h3N5YdS4vS/Op5pSgKgUfcrXSrxg2i1y34xtRKb3q7QKcdDI8ORb/vvRlOZz9/b1SlYj aAKLDYl/lVf64jwaaV7qUglQu3Jz+X0bmHi23+Nc+YEnSwCrYtHh7S+4vuFZ7VCVZsti gQQ5ROrykFq+POt/ufN0qhCGPUJTYFr+lpbY/yQryEmczbTt45mvH3zM1VBuzCd1SEyT YZCZA0SNmCmqsX+B0xcK0XbR4xRI5cYMwlnF/XYZlFenHU/959nadKxz58iVKpm0vDzr 4HnA== 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=d/sm+7EajueLJhT3hn6yOZZG8j7xsRBlqrijYkRzodE=; b=OxGBFg120HD0JNEGSdpnxyLE9OryJLwWOAJl7tIqVDBYlETLJzI6sUFh0mzi2AfOnF 2+kev3rmAXezi6QfFhDrqMRVvauOtFmObhWA15FS8Vcc6Wsj1IFskJl0hU0XOoCS4NxE JC/qhoASRtCzbemxFelKh0+O3+7lA1+M3N9gXSmuTshHL5u9v1k6zKVHaKBncR0XX5xM XblWr5a2vL6oCI2tEN9JiRLMl06Z0+1qZPhwdleDxG0RvMFFIwwuqt28EFIPck6a6Qv/ JWO4eDoONbk+yTkRclvb1XYA9lK2QUziSBY6iPUBTza7Rhe0ruUkGqr10To0hMaXSiw9 IPwQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of mptcp+bounces-2781-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2781-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 e17si1971038qty.436.2021.12.15.16.33.49 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Dec 2021 16:33:49 -0800 (PST) Received-SPF: pass (google.com: domain of mptcp+bounces-2781-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-2781-wpasupplicant.patchew=gmail.com@lists.linux.dev designates 2604:1380:1:3600::1 as permitted sender) smtp.mailfrom="mptcp+bounces-2781-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 A951A1C0BF9 for ; Thu, 16 Dec 2021 00:33:48 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 527713FDB; Thu, 16 Dec 2021 00:33:47 +0000 (UTC) X-Original-To: mptcp@lists.linux.dev 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 960F92C9E for ; Thu, 16 Dec 2021 00:33:45 +0000 (UTC) X-IronPort-AV: E=McAfee;i="6200,9189,10199"; a="236907563" X-IronPort-AV: E=Sophos;i="5.88,209,1635231600"; d="scan'208";a="236907563" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.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="465835390" 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 2/6] mptcp: Add a member to mptcp_pm_data to track kernel vs userspace mode Date: Wed, 15 Dec 2021 16:33:20 -0800 Message-Id: <20211216003324.403195-3-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 adding support for netlink path management commands, the kernel needs to know whether paths are being controlled by the in-kernel path manager or a userspace PM. Signed-off-by: Mat Martineau --- net/mptcp/pm.c | 4 ++++ net/mptcp/protocol.h | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 49402556b4ec..e72e6010e323 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -392,6 +392,10 @@ void mptcp_pm_data_reset(struct mptcp_sock *msk) pm->subflows =3D 0; pm->rm_list_tx.nr =3D 0; pm->rm_list_rx.nr =3D 0; + WRITE_ONCE(pm->pm_type, MPTCP_PM_TYPE_KERNEL); + /* pm->work_pending must be only be set to 'true' when + * pm->pm_type is set to MPTCP_PM_TYPE_KERNEL + */ WRITE_ONCE(pm->work_pending, (!!mptcp_pm_get_local_addr_max(msk) && subflows_allowed) || !!mptcp_pm_get_add_addr_signal_max(msk)); diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index b22370878c86..2fe59769b037 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -180,6 +180,14 @@ enum mptcp_pm_status { */ }; =20 +enum mptcp_pm_type { + MPTCP_PM_TYPE_KERNEL =3D 0, + MPTCP_PM_TYPE_USERSPACE, + + __MPTCP_PM_TYPE_NR, + __MPTCP_PM_TYPE_MAX =3D __MPTCP_PM_TYPE_NR - 1, +}; + /* Status bits below MPTCP_PM_ALREADY_ESTABLISHED need pm worker actions */ #define MPTCP_PM_WORK_MASK ((1 << MPTCP_PM_ALREADY_ESTABLISHED) - 1) =20 @@ -208,6 +216,7 @@ struct mptcp_pm_data { u8 add_addr_signaled; u8 add_addr_accepted; u8 local_addr_used; + u8 pm_type; u8 subflows; u8 status; DECLARE_BITMAP(id_avail_bitmap, MPTCP_PM_MAX_ADDR_ID + 1); --=20 2.34.1