From patchwork Thu Jan 16 07:26:53 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13941349 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 949051946B8 for ; Thu, 16 Jan 2025 07:27:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737012428; cv=none; b=e7RoQeZ4MhmRIQcjC/ZqgsHmLtMbDDjqMD+S7yOl0eURc1OqxS0xxZEV5VeEgSsNhApJrzchnVZQi4vFu8Y6gYYnUX8dJsgbwHTxCU61Sc6+FqKzksRLiuLZxRfe+TouwVxhipUpSi6N0VIJuAPbMGIuKCCMkFLQ956xNmYxn/o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737012428; c=relaxed/simple; bh=mReufQBMfhEAFgVxSJjYHyXTepa6JXN6QhJtShKUhQ4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TNm1i9e3sKhI33Qbb59VzYeqVWZ6jGsxTh3c90tCXcGDpL907t7oD5wZV2FXbrlQ64L8MJ01sD5b8HTRuzTI4ZrYYJZtqzv86XSdbUuAElxJxZVf4rOFjYGsbaxpgl4SZFqmQ4toC7PEUe5RwhOzatLmjj6m5fsttNC9fsMkPD4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S7XqfAn5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S7XqfAn5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1AD20C4CEE6; Thu, 16 Jan 2025 07:27:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737012428; bh=mReufQBMfhEAFgVxSJjYHyXTepa6JXN6QhJtShKUhQ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S7XqfAn5jzW/64RUAc2kKE5hXT00O2cr6YH/ItcY5aag6BcQldLheAau6fjGQv7zv e1AZz07lwLlfTtf/307ly1wUS5zvOY7kGWLcq/UpnYll6eSre4TkL75OUJ/5cJHWQY /bXKrBgbd554SjiyIXJGIaCHO5Z24yVWybCsiRua6AjFdMqE9bXpvsNA9ayZjKaW4e tWZ5mcidqjVMYxZKJQI+FN0TB0gz/iyL7PbaX6HjGdKjAQAAbwtCAfevpZ6T6NK/XW wvBMBUojiXvtkj4dllABcb/iWAmviEzI0ql5mtCQu4C8BH6ekyu0doAByomQilx6i8 cNzr+ixvz/Tzw== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 1/7] mptcp: add mptcp_pm_genl_fill_addr helper Date: Thu, 16 Jan 2025 15:26:53 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Geliang Tang To save some redundant code in dump_addr() interfaces of both the netlink PM and userspace PM, the code that calls netlink message helpers (genlmsg_put/cancel/end) and mptcp_nl_fill_addr() is wrapped into a new helper mptcp_pm_genl_fill_addr(). This helper will also be used in BPF path managers. Signed-off-by: Geliang Tang --- net/mptcp/pm.c | 21 +++++++++++++++++++++ net/mptcp/pm_netlink.c | 12 +----------- net/mptcp/pm_userspace.c | 12 +----------- net/mptcp/protocol.h | 3 +++ 4 files changed, 26 insertions(+), 22 deletions(-) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index b1f36dc1a091..16cacce6c10f 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -489,6 +489,27 @@ int mptcp_pm_nl_get_addr_doit(struct sk_buff *skb, struct genl_info *info) return ret; } +int mptcp_pm_genl_fill_addr(struct sk_buff *msg, + struct netlink_callback *cb, + struct mptcp_pm_addr_entry *entry) +{ + void *hdr; + + hdr = genlmsg_put(msg, NETLINK_CB(cb->skb).portid, + cb->nlh->nlmsg_seq, &mptcp_genl_family, + NLM_F_MULTI, MPTCP_PM_CMD_GET_ADDR); + if (!hdr) + return -EINVAL; + + if (mptcp_nl_fill_addr(msg, entry) < 0) { + genlmsg_cancel(msg, hdr); + return -EINVAL; + } + + genlmsg_end(msg, hdr); + return 0; +} + static int mptcp_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb) { const struct genl_info *info = genl_info_dump(cb); diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index fef01692eaed..afd517ff260c 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -1798,7 +1798,6 @@ int mptcp_pm_nl_dump_addr(struct sk_buff *msg, struct mptcp_pm_addr_entry *entry; struct pm_nl_pernet *pernet; int id = cb->args[0]; - void *hdr; int i; pernet = pm_nl_get_pernet(net); @@ -1813,19 +1812,10 @@ int mptcp_pm_nl_dump_addr(struct sk_buff *msg, if (entry->addr.id <= id) continue; - hdr = genlmsg_put(msg, NETLINK_CB(cb->skb).portid, - cb->nlh->nlmsg_seq, &mptcp_genl_family, - NLM_F_MULTI, MPTCP_PM_CMD_GET_ADDR); - if (!hdr) + if (mptcp_pm_genl_fill_addr(msg, cb, entry)) break; - if (mptcp_nl_fill_addr(msg, entry) < 0) { - genlmsg_cancel(msg, hdr); - break; - } - id = entry->addr.id; - genlmsg_end(msg, hdr); } } rcu_read_unlock(); diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 277cf092a870..b50462b527bd 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -641,7 +641,6 @@ int mptcp_userspace_pm_dump_addr(struct sk_buff *msg, struct mptcp_sock *msk; int ret = -EINVAL; struct sock *sk; - void *hdr; bitmap = (struct id_bitmap *)cb->ctx; @@ -657,19 +656,10 @@ int mptcp_userspace_pm_dump_addr(struct sk_buff *msg, if (test_bit(entry->addr.id, bitmap->map)) continue; - hdr = genlmsg_put(msg, NETLINK_CB(cb->skb).portid, - cb->nlh->nlmsg_seq, &mptcp_genl_family, - NLM_F_MULTI, MPTCP_PM_CMD_GET_ADDR); - if (!hdr) + if (mptcp_pm_genl_fill_addr(msg, cb, entry)) break; - if (mptcp_nl_fill_addr(msg, entry) < 0) { - genlmsg_cancel(msg, hdr); - break; - } - __set_bit(entry->addr.id, bitmap->map); - genlmsg_end(msg, hdr); } spin_unlock_bh(&msk->pm.lock); release_sock(sk); diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 6fb536de9981..20941405a1ea 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -1060,6 +1060,9 @@ void mptcp_fastopen_subflow_synack_set_params(struct mptcp_subflow_context *subf struct request_sock *req); int mptcp_nl_fill_addr(struct sk_buff *skb, struct mptcp_pm_addr_entry *entry); +int mptcp_pm_genl_fill_addr(struct sk_buff *msg, + struct netlink_callback *cb, + struct mptcp_pm_addr_entry *entry); static inline bool mptcp_pm_should_add_signal(struct mptcp_sock *msk) { From patchwork Thu Jan 16 07:26:54 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13941350 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8296419E7ED for ; Thu, 16 Jan 2025 07:27:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737012430; cv=none; b=afyRwKAImJhnWmftX/+c0Ti+qOvb63uuEUmQv0j77YiKIOqdPbT71cWW0Cq79SbpNJMMhGllHlV7rfWNQR9gR3956V/2sS9akMjMNcZM9kFAuCqOUtqWyliRKIyV3NdSsOE1LrEmPaPonjk4sENldkJ8omtFHkTHq/28hVLueGc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737012430; c=relaxed/simple; bh=7eBYfjdZA97+FDSGdS1BGUpeREwkRg9R24kg+Cb0R1U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=q6Hw5DTfvX2d09GVxym0cOHhfcClv7Hvndjx3llN8LxU66joconl436tdhIRJAgkDWR2WYJpHxVDuXDBI8xaNUqVqshd2ArdiLREblxkZohBfjktSGkIXPHX9zfcIXCx8LJNN//Egrl53C4hZSTd5b0fOc8Gm/YITsDgNPSSiEU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iV3d8LlP; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iV3d8LlP" Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAE05C4CEDF; Thu, 16 Jan 2025 07:27:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737012430; bh=7eBYfjdZA97+FDSGdS1BGUpeREwkRg9R24kg+Cb0R1U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iV3d8LlPukOcCWC8RNd2wIf9EkybPXt/7VUesxx1qtA8OprdwiLYPTP3vU8cJk954 lWu3J0ZjqENJbZ2EOpMFaNYDzsWHm4uOE9BL2JlQfWGR24N1xKRNEwhzNE7y1rZ/zZ v+yHxTd3GPUsySzNMgSeoKNgPh6BPqhIEiXek3do/vqS8iqeXjoRlz4zNvL16bYO74 ixz2f2kMdmtRkaYD/7QvGk6ehjXAkt++OsnDX4PayFWsbJ7bbbWmo8TZfHWBp+6DXk yyaI8i0NXzI/OHbvXtc3yUaxCljmlh2cgih6ANAnCbfSCwKb8H5K6u5CcSdSDRTrA4 dzF4CS/19KEzA== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 2/7] mptcp: add a build check for userspace_pm_dump_addr Date: Thu, 16 Jan 2025 15:26:54 +0800 Message-ID: <477b35468fde94e852135a0c701a8631339d60b4.1737012165.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Geliang Tang This patch adds a build check for mptcp_userspace_pm_dump_addr() to make sure there is enough space in 'cb->ctx' to store an address id bitmap. Signed-off-by: Geliang Tang --- net/mptcp/pm_userspace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index b50462b527bd..540b2080f02b 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -642,6 +642,8 @@ int mptcp_userspace_pm_dump_addr(struct sk_buff *msg, int ret = -EINVAL; struct sock *sk; + BUILD_BUG_ON(sizeof(struct id_bitmap) > sizeof(cb->ctx)); + bitmap = (struct id_bitmap *)cb->ctx; msk = mptcp_userspace_pm_get_sock(info); From patchwork Thu Jan 16 07:26:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13941351 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6CA5C1946B8 for ; Thu, 16 Jan 2025 07:27:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737012432; cv=none; b=BhOvlRYk+iloE7HqdH8jncw34J/8z3kBYI0aAjpmU3jUPi95YmE5bG/1UrZItl0O0qBSK2KIA0WlgfNPzwbuuYeevbUzQDprnP+GNCLHWl+tDjb2hoko4Pj99irslBK+ev+R6JT4Wpxzq/OSxmxDaMHsXZ1/lVQXrWj1jtiyajU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737012432; c=relaxed/simple; bh=UAytOR39GwZbtz5iZ7M1WnJAsJybN3U2rWQwbAznRpI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VzI/C35dhJQnkgsJ96eTeX9k1AKV95GEBz49rGMbRbJUcCvP0k6uivCsDuJeaMFyrVzfm4m4U54XyLJ454Oajnj84EIV+7/fKVFxHEEnDHk8QFyyPbfaNz4ZQbzvRziK+rCKWgK/OnRG3KwJMoBgpOKWk/mVyyvtgaV4UBGoLmw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=AvHFnKiB; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="AvHFnKiB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4869C4CEDF; Thu, 16 Jan 2025 07:27:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737012431; bh=UAytOR39GwZbtz5iZ7M1WnJAsJybN3U2rWQwbAznRpI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AvHFnKiBodyR49NxHN/VZ4oidbBdCL+nXwWuoM0NyiC3lSFJeJiAA1jpjqruoiZG8 btIu/mzWr7uYxHR0EuOmUe8fJoDN/UjVoCMh+fhv/IM1e4kkNVvZ4cEJeELy+YOaqR hb5qkxmoPwEAVaKgJLLA2r1f/39VqsUy4s8KGXag4A7Ij+mky9v7EVVtYQgQFFx3wA LZm64sRLa8HblGQkHwN+jdraiITsIv+dGd1SdF03e6+vGryYcRzdYh1TkIRx8OOIoD VR/mxnXm8CF0p+4c+21htkV7i9GVIQVrwIbgjpK+8NwE4PsTzlXQ2gMCO9w/SsYeU8 e/l/FaBQ7WwpA== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 3/7] mptcp: add struct mptcp_pm_addr_id_bitmap Date: Thu, 16 Jan 2025 15:26:55 +0800 Message-ID: <30d07c758cfb06aeb312fe37238ce60fc120da13.1737012165.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Geliang Tang To simplify the use of bitmap in BPF, a new type for MPTCP userspace pm id bitmap, struct mptcp_pm_addr_id_bitmap is defined. Because there's no way to use DECLARE_BITMAP macro in BPF program, and it's not easy to reimplement it in BPF. Signed-off-by: Geliang Tang --- net/mptcp/pm_userspace.c | 17 ++++++++--------- net/mptcp/protocol.h | 4 ++++ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 540b2080f02b..5c7a8817595c 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -47,7 +47,7 @@ static int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk, struct mptcp_pm_addr_entry *entry, bool needs_id) { - DECLARE_BITMAP(id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1); + struct mptcp_pm_addr_id_bitmap id_bitmap; struct mptcp_pm_addr_entry *match = NULL; struct sock *sk = (struct sock *)msk; struct mptcp_pm_addr_entry *e; @@ -55,7 +55,7 @@ static int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk, bool id_match = false; int ret = -EINVAL; - bitmap_zero(id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1); + bitmap_zero(id_bitmap.map, MPTCP_PM_MAX_ADDR_ID + 1); spin_lock_bh(&msk->pm.lock); mptcp_for_each_userspace_pm_addr(msk, e) { @@ -69,7 +69,7 @@ static int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk, } else if (addr_match || id_match) { break; } - __set_bit(e->addr.id, id_bitmap); + __set_bit(e->addr.id, id_bitmap.map); } if (!match && !addr_match && !id_match) { @@ -84,7 +84,7 @@ static int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk, *e = *entry; if (!e->addr.id && needs_id) - e->addr.id = find_next_zero_bit(id_bitmap, + e->addr.id = find_next_zero_bit(id_bitmap.map, MPTCP_PM_MAX_ADDR_ID + 1, 1); list_add_tail_rcu(&e->list, &msk->pm.userspace_pm_local_addr_list); @@ -633,18 +633,17 @@ int mptcp_userspace_pm_set_flags(struct mptcp_pm_addr_entry *local, int mptcp_userspace_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb) { - struct id_bitmap { - DECLARE_BITMAP(map, MPTCP_PM_MAX_ADDR_ID + 1); - } *bitmap; const struct genl_info *info = genl_info_dump(cb); + struct mptcp_pm_addr_id_bitmap *bitmap; struct mptcp_pm_addr_entry *entry; struct mptcp_sock *msk; int ret = -EINVAL; struct sock *sk; - BUILD_BUG_ON(sizeof(struct id_bitmap) > sizeof(cb->ctx)); + BUILD_BUG_ON(sizeof(struct mptcp_pm_addr_id_bitmap) > + sizeof(cb->ctx)); - bitmap = (struct id_bitmap *)cb->ctx; + bitmap = (struct mptcp_pm_addr_id_bitmap *)cb->ctx; msk = mptcp_userspace_pm_get_sock(info); if (!msk) diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index 20941405a1ea..aca3de2baf81 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -212,6 +212,10 @@ enum mptcp_addr_signal_status { /* max value of mptcp_addr_info.id */ #define MPTCP_PM_MAX_ADDR_ID U8_MAX +struct mptcp_pm_addr_id_bitmap { + DECLARE_BITMAP(map, MPTCP_PM_MAX_ADDR_ID + 1); +}; + struct mptcp_pm_data { struct mptcp_addr_info local; struct mptcp_addr_info remote; From patchwork Thu Jan 16 07:26:56 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13941352 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2C467198A38 for ; Thu, 16 Jan 2025 07:27:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737012434; cv=none; b=B1uttiaMsBmenzUoFxOq4G8cvgB+du/ObyvKHoYSQxJnn0RfqnipY9jkluuKEG4jqIBZWUwV9em8EQNG1+s3/c2pudgJX37Pdz+Tf84ualGR6rWuw8Kdu2b2dhX4X1UOznUbeaPPV2pxQIIVL4ngV69wU9/9bJZEsCBZTCHeqYA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737012434; c=relaxed/simple; bh=y1t7q0vwe49t0ogiFRo2CbHZBYgeLugpFFHooOnQWkw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hdykJ6lfOIiLlcZfOFk76pmbyFRc9sWNVK5/kVntGw8Ag+cjWt0jsfRUUKKg8wvexYrPKXdhJRBqJakwY323aZtyZQyjb9/d2IqRsTM7yjPlFyQyF1oyc97V05LG4PzGsc4tIIUSb3cJG1GH23QKa/AEF8dyFh+UeaUcYKdxEDY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=EtNHP1PO; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="EtNHP1PO" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E496C4CEE3; Thu, 16 Jan 2025 07:27:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737012433; bh=y1t7q0vwe49t0ogiFRo2CbHZBYgeLugpFFHooOnQWkw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EtNHP1POTcc2TLTcbQ+Eeftdiyjxxvkm7keM0ufEgMdW0YCUuetep+AIkuuB+AQv/ t9Lxa+6UEXiUcj7ta5RsL1PS/YzHWWlGhmkniUKiL/zqG4yxf77a/BzoUlZBAWU0V9 3tNj7JzJJLyf3LTTp+y7n812EYqaUCxY+lRGvp5EJswa4e5WIQRnItOpdL8HZ4OMiq Z8p8Y6eC9bZDZPXogDZD0CEDQokZ4WFdICJ5DyUIWh3ePjU92NNctTqCn0ZHPDVfWf 49zeQuGVD9SXfZYKDmQaNbp7e4xRG3ta2KfOl7FUbDQd+liOxmEQ9E5/RB/+QpAi6c foOaUM/6QdXAg== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 4/7] mptcp: drop inet6_sk in mptcp_nl_find_ssk Date: Thu, 16 Jan 2025 15:26:56 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Geliang Tang In mptcp_nl_find_ssk(), 'issk' has already been got through inet_sk(). No need to use inet6_sk() to get 'pinfo' again, just use issk->pinet6 instead. This patch also drops this 'pinfo' variable. Signed-off-by: Geliang Tang --- net/mptcp/pm_userspace.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 5c7a8817595c..bd09a637049d 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -465,9 +465,8 @@ static struct sock *mptcp_nl_find_ssk(struct mptcp_sock *msk, break; #if IS_ENABLED(CONFIG_MPTCP_IPV6) case AF_INET6: { - const struct ipv6_pinfo *pinfo = inet6_sk(ssk); - - if (!ipv6_addr_equal(&local->addr6, &pinfo->saddr) || + if (!ipv6_addr_equal(&local->addr6, + &issk->pinet6->saddr) || !ipv6_addr_equal(&remote->addr6, &ssk->sk_v6_daddr)) continue; break; From patchwork Thu Jan 16 07:26:57 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13941353 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 5FFA51990B7 for ; Thu, 16 Jan 2025 07:27:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737012435; cv=none; b=Wc9eJsWgNFEmDVp+fKozKa1qN+Ajtg0I5Iw/IehzHcciIbxKYOKd4aluRgI3LGdy7HuJyKEon6mtrZ9FMHFtobuSXj33UHfHuXie+hGduZwuRKT/D6NbNnHISSbiNLskEZEsgLAdUKaE2PyvwXt5+Aeic/hzVLc8X/DuhIOTI5c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737012435; c=relaxed/simple; bh=DaI7SQT8GY/NiSZNUbwTbINnuZ4DangVC/mvANmBa2w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Q2ONaDkZsBDC6AhISSJw1c3axuy4T8JYfYweMUbJiwLLb92x6xRl3BCfvJR6zPegxOD+hz4gHobBXW2i0+vxvNSGD+QdgtrR6D4w4MxQGPtlY/rPz18q+z+uVmQGo3aItTwc8Nf+xvmU4/8uQ7XsWhHTECTb8W/hFppEkCBZNEQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oqS29tfx; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oqS29tfx" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4F223C4CEE3; Thu, 16 Jan 2025 07:27:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737012435; bh=DaI7SQT8GY/NiSZNUbwTbINnuZ4DangVC/mvANmBa2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oqS29tfxRtxbIHuzXsEaDLv38xYErOIVGnXSZGgk290iM7ZiZEMlQknJCyn3b6QbD 2GDngZyc60CuO22/i+9j6WS6zd1D3uBBZnsjq48LdxA+rApuYOFLSONbvx69uVTOax J+B4eV6B56B5JlZy3El5rgj0B8gRqIkrcMxTd9pLp/SNP3pkgYwkeaP/+P0n205Xiw GrZpX0qdZ9jcTRj1EOLPWuDJ3HbG9opofkslXj53IOtDO3vr5FCGSU0KD4Ti9qPcU3 00uiJql36fMGlvRDXU/8LGEcTk6C6mVudtWosNNMLqBrod8htOqXdopO+bK2wr8dcv 7eZuqJUhZJ7wQ== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 5/7] mptcp: drop match in userspace_pm_append_new_local_addr Date: Thu, 16 Jan 2025 15:26:57 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Geliang Tang The variable 'match' in mptcp_userspace_pm_append_new_local_addr() is a redundant one, and this patch drops it. No need to define 'match' as 'struct mptcp_pm_addr_entry *' type. In this function, it's only used to check whether it's NULL. It can be defined as a Boolean one. Also other variables 'addr_match' and 'id_match' make 'match' a redundant one, which can be replaced by directly checking 'addr_match && id_match'. Signed-off-by: Geliang Tang --- net/mptcp/pm_userspace.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index bd09a637049d..8a0202d8bfa4 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -48,7 +48,6 @@ static int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk, bool needs_id) { struct mptcp_pm_addr_id_bitmap id_bitmap; - struct mptcp_pm_addr_entry *match = NULL; struct sock *sk = (struct sock *)msk; struct mptcp_pm_addr_entry *e; bool addr_match = false; @@ -63,16 +62,12 @@ static int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk, if (addr_match && entry->addr.id == 0 && needs_id) entry->addr.id = e->addr.id; id_match = (e->addr.id == entry->addr.id); - if (addr_match && id_match) { - match = e; + if (addr_match || id_match) break; - } else if (addr_match || id_match) { - break; - } __set_bit(e->addr.id, id_bitmap.map); } - if (!match && !addr_match && !id_match) { + if (!addr_match && !id_match) { /* Memory for the entry is allocated from the * sock option buffer. */ @@ -90,7 +85,7 @@ static int mptcp_userspace_pm_append_new_local_addr(struct mptcp_sock *msk, list_add_tail_rcu(&e->list, &msk->pm.userspace_pm_local_addr_list); msk->pm.local_addr_used++; ret = e->addr.id; - } else if (match) { + } else if (addr_match && id_match) { ret = entry->addr.id; } From patchwork Thu Jan 16 07:26:58 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13941354 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 ED30B1D86F1 for ; Thu, 16 Jan 2025 07:27:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737012437; cv=none; b=oa5m1ZqDH7au3ljoB0Icc2xGZeT5PAuqIMQzzR5LEL5Ju0wIoKFE9uUpUAPkd5GZdOHU0pvE/yn+cBrmxz+r6IkcgQui+6bDb2fDuiVyYExgnQngCGbt6uD3LAjCpMyvVyzmFQ8C+9W0JH6L4NF65piSMir818uVNp8qzESTW9k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737012437; c=relaxed/simple; bh=uSlZGjqlztPKPok6+ltWM2uKaOzY7i30VS7HCyC+g64=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=u/KAYYc/Uf2o7dPx6wUFjecznhWc8XENlSqnW+vw+mvTlfJ+vzvzdR1ytOiajksbxdGbW4rY1E726iBpz5YrEVpZaTml93D1GMWOQ7f9FSIuhaaLTdSRvZ/84ADXI5jH1PoCKxdPT9iyFX3dNJBlGIRQSJ9GCr6OVuyxROetQOY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Jx4LQqvV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Jx4LQqvV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4325C4CEE5; Thu, 16 Jan 2025 07:27:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737012436; bh=uSlZGjqlztPKPok6+ltWM2uKaOzY7i30VS7HCyC+g64=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Jx4LQqvVHIXY0YWPYVyXa+HhUYmYmSgxshCRAwzj4jEz6nTK5VSXOXlmzM4K3WHpp QBs6zGfY89VCv/25s0iEVMQIH8N4iTKl5gLxQfTkV23mR7/PRuJUpE0q6wwzNbqyy9 lwCIBpWynRum7gl9uKg+59xZiVvqsiMmeml7bS0/juBS7phx+DFU98xoF1n3MSXsHp 6o4eQ3bgm6nJjD6UbjbNuEgDHysirWkNabbVNkxlGVVFS0/DK9zKwgkfeCSOhLgTzf +z+s5bxcc7iZBgF/MhDmxESuej56RQWo33i+ImujE6UtIs/QemU/W+e8Yin8PhzCU5 hNkbPrcryaflg== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 6/7] mptcp: hold msk lock before removing id 0 address Date: Thu, 16 Jan 2025 15:26:58 +0800 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Geliang Tang In mptcp_pm_nl_remove_doit(), move 'lock_sock(sk)' before invoking the function mptcp_userspace_pm_remove_id_zero_address(). Then no need to hold and release this lock in this function. And 'sk' and 'err' variables and 'remove_err' label in it can be dropped. Signed-off-by: Geliang Tang --- net/mptcp/pm_userspace.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 8a0202d8bfa4..9a6c17948d7e 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -256,11 +256,8 @@ static int mptcp_userspace_pm_remove_id_zero_address(struct mptcp_sock *msk) { struct mptcp_rm_list list = { .nr = 0 }; struct mptcp_subflow_context *subflow; - struct sock *sk = (struct sock *)msk; bool has_id_0 = false; - int err = -EINVAL; - lock_sock(sk); mptcp_for_each_subflow(msk, subflow) { if (READ_ONCE(subflow->local_id) == 0) { has_id_0 = true; @@ -268,7 +265,7 @@ static int mptcp_userspace_pm_remove_id_zero_address(struct mptcp_sock *msk) } } if (!has_id_0) - goto remove_err; + return -EINVAL; list.ids[list.nr++] = 0; @@ -276,11 +273,7 @@ static int mptcp_userspace_pm_remove_id_zero_address(struct mptcp_sock *msk) mptcp_pm_remove_addr(msk, &list); spin_unlock_bh(&msk->pm.lock); - err = 0; - -remove_err: - release_sock(sk); - return err; + return 0; } void mptcp_pm_remove_addr_entry(struct mptcp_sock *msk, @@ -324,13 +317,14 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info) sk = (struct sock *)msk; + lock_sock(sk); + if (id_val == 0) { err = mptcp_userspace_pm_remove_id_zero_address(msk); + release_sock(sk); goto out; } - lock_sock(sk); - spin_lock_bh(&msk->pm.lock); match = mptcp_userspace_pm_lookup_addr_by_id(msk, id_val); if (!match) { From patchwork Thu Jan 16 07:26:59 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geliang Tang X-Patchwork-Id: 13941355 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 8A20B19F471 for ; Thu, 16 Jan 2025 07:27:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737012439; cv=none; b=C039Jcoyi+V5XV2nxrdmyPZG/RHeQBAUWtEz8Zy8p6CuLmf1ML1tFMCJjHSWmJPS6PUGhOY+X4tpew5hxfljJFewxZG9jezl/KDYf9DqyeNgthNSmMxtjTzN0nx0Ioqlozxoe6bInjyJ4Vk9OznOxhxWf5GmtMQKwM4mDgZfKHU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737012439; c=relaxed/simple; bh=vH5wAZiDpfELiOZgfd+b/WPpWpt3F4Ql620iO7GMNl0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kXlf/Zs78S9UFIkEOVKMiWWJtlPOhdUqxVEB9qJV0jEEcrL5no1RWAsvdzn0DsHEklgL+DaYo04s+OY6wJa+dQRKce+dP+bX6hFi+RNRrsbsk60pXhQl5E3wNIVXrz9znQLFpi8AYO32gLDkVJuJKGgXtWftBbiyLu4iokr16MU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=CkPvQrNy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="CkPvQrNy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AD33C4CEE2; Thu, 16 Jan 2025 07:27:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1737012438; bh=vH5wAZiDpfELiOZgfd+b/WPpWpt3F4Ql620iO7GMNl0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CkPvQrNywYkAlNQzloUnhHFDdsSjqzW9zjPu/DY+0NcahuoWWRMknBCSOnD2gyvNO F91QEemBQlMlCeX0Ertvu4OtDMCOngO+OOg5bq5c9U+tWDeQ4Vemx76dHHKLSdZv5x czJPOBjcCous8L04eQluyJ1c4oB0jzpgIfTZHOLNE8etK0nNCGkA0c7f7n2dFaL8nq Y/RiBlPjAVjO0Ol8zdtJhrmptDeZJnQDprKBWClBOHtEABLMi99fLLJg6Jd1HbZvjC m5WkKiCW1wwcdORK86JaoxkzPNahEh51DOhdzOP3Ymrh90Nn4M0MTsm7XS5qFjRYOe mW5lP2n2xKSsA== From: Geliang Tang To: mptcp@lists.linux.dev Cc: Geliang Tang Subject: [PATCH mptcp-next v4 7/7] mptcp: change is_backup interfaces as get_flags Date: Thu, 16 Jan 2025 15:26:59 +0800 Message-ID: <75f5ab33f0a11d32eeaa9af698df6e64bb1da951.1737012165.git.tanggeliang@kylinos.cn> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 From: Geliang Tang is_backup() interface of the path managers is not very common. A more common approach is to add a get_flags() interface to obtain the flags value of a given address. Then is_backup() can be implemented through get_flags() by test whether backup flag is set in the flags value. Signed-off-by: Geliang Tang --- net/mptcp/pm.c | 7 +++++-- net/mptcp/pm_netlink.c | 8 ++++---- net/mptcp/pm_userspace.c | 10 +++++----- net/mptcp/protocol.h | 4 ++-- 4 files changed, 16 insertions(+), 13 deletions(-) diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c index 16cacce6c10f..e275be73b963 100644 --- a/net/mptcp/pm.c +++ b/net/mptcp/pm.c @@ -425,13 +425,16 @@ int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc) bool mptcp_pm_is_backup(struct mptcp_sock *msk, struct sock_common *skc) { struct mptcp_addr_info skc_local; + u8 flags; mptcp_local_address((struct sock_common *)skc, &skc_local); if (mptcp_pm_is_userspace(msk)) - return mptcp_userspace_pm_is_backup(msk, &skc_local); + flags = mptcp_userspace_pm_get_flags(msk, &skc_local); + else + flags = mptcp_pm_nl_get_flags(msk, &skc_local); - return mptcp_pm_nl_is_backup(msk, &skc_local); + return !!(flags & MPTCP_PM_ADDR_FLAG_BACKUP); } static int mptcp_pm_get_addr(u8 id, struct mptcp_pm_addr_entry *addr, diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c index afd517ff260c..c0971b09c5f6 100644 --- a/net/mptcp/pm_netlink.c +++ b/net/mptcp/pm_netlink.c @@ -1172,18 +1172,18 @@ int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, struct mptcp_addr_info *skc return ret; } -bool mptcp_pm_nl_is_backup(struct mptcp_sock *msk, struct mptcp_addr_info *skc) +u8 mptcp_pm_nl_get_flags(struct mptcp_sock *msk, struct mptcp_addr_info *skc) { struct pm_nl_pernet *pernet = pm_nl_get_pernet_from_msk(msk); struct mptcp_pm_addr_entry *entry; - bool backup; + u8 flags; rcu_read_lock(); entry = __lookup_addr(pernet, skc); - backup = entry && !!(entry->flags & MPTCP_PM_ADDR_FLAG_BACKUP); + flags = entry ? entry->flags : 0; rcu_read_unlock(); - return backup; + return flags; } #define MPTCP_PM_CMD_GRP_OFFSET 0 diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c index 9a6c17948d7e..5e9b95270942 100644 --- a/net/mptcp/pm_userspace.c +++ b/net/mptcp/pm_userspace.c @@ -154,18 +154,18 @@ int mptcp_userspace_pm_get_local_id(struct mptcp_sock *msk, return mptcp_userspace_pm_append_new_local_addr(msk, &new_entry, true); } -bool mptcp_userspace_pm_is_backup(struct mptcp_sock *msk, - struct mptcp_addr_info *skc) +u8 mptcp_userspace_pm_get_flags(struct mptcp_sock *msk, + struct mptcp_addr_info *skc) { struct mptcp_pm_addr_entry *entry; - bool backup; + u8 flags; spin_lock_bh(&msk->pm.lock); entry = mptcp_userspace_pm_lookup_addr(msk, skc); - backup = entry && !!(entry->flags & MPTCP_PM_ADDR_FLAG_BACKUP); + flags = entry ? entry->flags : 0; spin_unlock_bh(&msk->pm.lock); - return backup; + return flags; } static struct mptcp_sock *mptcp_userspace_pm_get_sock(const struct genl_info *info) diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h index aca3de2baf81..821d9d51e27c 100644 --- a/net/mptcp/protocol.h +++ b/net/mptcp/protocol.h @@ -1132,8 +1132,8 @@ int mptcp_pm_get_local_id(struct mptcp_sock *msk, struct sock_common *skc); int mptcp_pm_nl_get_local_id(struct mptcp_sock *msk, struct mptcp_addr_info *skc); int mptcp_userspace_pm_get_local_id(struct mptcp_sock *msk, struct mptcp_addr_info *skc); bool mptcp_pm_is_backup(struct mptcp_sock *msk, struct sock_common *skc); -bool mptcp_pm_nl_is_backup(struct mptcp_sock *msk, struct mptcp_addr_info *skc); -bool mptcp_userspace_pm_is_backup(struct mptcp_sock *msk, struct mptcp_addr_info *skc); +u8 mptcp_pm_nl_get_flags(struct mptcp_sock *msk, struct mptcp_addr_info *skc); +u8 mptcp_userspace_pm_get_flags(struct mptcp_sock *msk, struct mptcp_addr_info *skc); int mptcp_pm_nl_dump_addr(struct sk_buff *msg, struct netlink_callback *cb); int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,