From: Matthieu Baerts <matttbe@kernel.org>
To: Geliang Tang <geliang@kernel.org>, mptcp@lists.linux.dev
Cc: Geliang Tang <tanggeliang@kylinos.cn>
Subject: Re: [PATCH mptcp-next v2 7/8] mptcp: add mptcp_pm_addr_id_bitmap_t type
Date: Mon, 30 Dec 2024 17:30:59 +0100 [thread overview]
Message-ID: <0a9019be-238d-4b02-ae7e-b510503ff6ac@kernel.org> (raw)
In-Reply-To: <789602f25f9fc73043f85417b6e147c49d894b66.1734074788.git.tanggeliang@kylinos.cn>
Hi Geliang,
On 13/12/2024 08:35, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> Similar to defining types such as nodemask_t, dma_cap_mask_t and
> cpumask_t to simplify the use of bitmap, a new type for MPTCP
> userspace pm id bitmap, mptcp_pm_addr_id_bitmap_t is defined to
> easily modify dump_addr() interface of the path managers to accept
> an mptcp_pm_addr_id_bitmap_t type parameter. It also allows this
> parameter of dump_addr() can be modified by BPF program when
> implementing this interface of a BFP path manager. Because a
> dump_addr() interface that accepts an 'unsigned long *bitmap'
> or 'unsigned long bitmap[]' parameter is difficult to implement
> in BPF program.
>
> In addition, this also makes it easier for us to implement similar
> logic to mptcp_userspace_pm_append_new_local_addr() in BPF path
> manager, 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 <tanggeliang@kylinos.cn>
> ---
> include/net/mptcp.h | 7 +++++++
> net/mptcp/pm_userspace.c | 14 ++++++--------
> net/mptcp/protocol.h | 3 ---
> 3 files changed, 13 insertions(+), 11 deletions(-)
>
> diff --git a/include/net/mptcp.h b/include/net/mptcp.h
> index 814b5f2e3ed5..220b1f60e8c1 100644
> --- a/include/net/mptcp.h
> +++ b/include/net/mptcp.h
> @@ -120,6 +120,13 @@ struct mptcp_sched_ops {
> void (*release)(struct mptcp_sock *msk);
> } ____cacheline_aligned_in_smp;
>
> +/* max value of mptcp_addr_info.id */
> +#define MPTCP_PM_MAX_ADDR_ID U8_MAX
> +
> +typedef struct {
> + DECLARE_BITMAP(map, MPTCP_PM_MAX_ADDR_ID + 1);
> +} mptcp_pm_addr_id_bitmap_t;
Why do you need to declare it here and not in protocol.h? Is it for the
future BPF PM?
Maybe you don't really need this bitmap if it is only needed for the
dump interfaces that are probably not needed with BPF?
Then maybe there is no need to change anything here?
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
next prev parent reply other threads:[~2024-12-30 16:31 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-13 7:35 [PATCH mptcp-next v2 0/8] BPF path manager, part 2 Geliang Tang
2024-12-13 7:35 ` [PATCH mptcp-next v2 1/8] mptcp: make three pm wrappers static Geliang Tang
2024-12-13 7:35 ` [PATCH mptcp-next v2 2/8] mptcp: drop skb parameter of get_addr Geliang Tang
2024-12-13 7:35 ` [PATCH mptcp-next v2 3/8] mptcp: add id parameter for get_addr Geliang Tang
2024-12-30 16:29 ` Matthieu Baerts
2024-12-13 7:35 ` [PATCH mptcp-next v2 4/8] mptcp: reuse sending nlmsg code in get_addr Geliang Tang
2024-12-13 7:35 ` [PATCH mptcp-next v2 5/8] mptcp: change info of get_addr as const Geliang Tang
2024-12-30 16:29 ` Matthieu Baerts
2024-12-13 7:35 ` [PATCH mptcp-next v2 6/8] mptcp: add info parameter for dump_addr Geliang Tang
2024-12-13 7:35 ` [PATCH mptcp-next v2 7/8] mptcp: add mptcp_pm_addr_id_bitmap_t type Geliang Tang
2024-12-30 16:30 ` Matthieu Baerts [this message]
2025-01-09 4:15 ` Geliang Tang
2025-01-09 15:37 ` Matthieu Baerts
2024-12-13 7:35 ` [PATCH mptcp-next v2 8/8] mptcp: reuse sending nlmsg code in dump_addr Geliang Tang
2024-12-30 16:33 ` Matthieu Baerts
2024-12-30 16:27 ` [PATCH mptcp-next v2 0/8] BPF path manager, part 2 Matthieu Baerts
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=0a9019be-238d-4b02-ae7e-b510503ff6ac@kernel.org \
--to=matttbe@kernel.org \
--cc=geliang@kernel.org \
--cc=mptcp@lists.linux.dev \
--cc=tanggeliang@kylinos.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox