* [PATCH mptcp-next v2 0/8] BPF path manager, part 2
@ 2024-12-13 7:35 Geliang Tang
2024-12-13 7:35 ` [PATCH mptcp-next v2 1/8] mptcp: make three pm wrappers static Geliang Tang
` (8 more replies)
0 siblings, 9 replies; 16+ messages in thread
From: Geliang Tang @ 2024-12-13 7:35 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <tanggeliang@kylinos.cn>
v2:
- split patch 7 of v1 into two.
- patches 1-6 have no code changes, only the commit logs have been
updated.
- more commit log to explain why mptcp_pm_addr_id_bitmap_t needs to
be defined.
- use mptcp_pm_addr_id_bitmap_t in userspace_pm_append_new_local_addr
too.
In order to implement BPF userspace path manager, it is necessary to
unify the interfaces of the path manager. This set updates get_addr()
and dump_addr() interfaces.
Geliang Tang (8):
mptcp: make three pm wrappers static
mptcp: drop skb parameter of get_addr
mptcp: add id parameter for get_addr
mptcp: reuse sending nlmsg code in get_addr
mptcp: change info of get_addr as const
mptcp: add info parameter for dump_addr
mptcp: add mptcp_pm_addr_id_bitmap_t type
mptcp: reuse sending nlmsg code in dump_addr
include/net/mptcp.h | 7 +++
net/mptcp/pm.c | 108 ++++++++++++++++++++++++++++++++++++---
net/mptcp/pm_netlink.c | 105 ++++++-------------------------------
net/mptcp/pm_userspace.c | 102 ++++++++++--------------------------
net/mptcp/protocol.h | 21 +++-----
5 files changed, 157 insertions(+), 186 deletions(-)
--
2.45.2
^ permalink raw reply [flat|nested] 16+ messages in thread
* [PATCH mptcp-next v2 1/8] mptcp: make three pm wrappers static
2024-12-13 7:35 [PATCH mptcp-next v2 0/8] BPF path manager, part 2 Geliang Tang
@ 2024-12-13 7:35 ` Geliang Tang
2024-12-13 7:35 ` [PATCH mptcp-next v2 2/8] mptcp: drop skb parameter of get_addr Geliang Tang
` (7 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: Geliang Tang @ 2024-12-13 7:35 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <tanggeliang@kylinos.cn>
Three netlink functions:
mptcp_pm_nl_get_addr_doit()
mptcp_pm_nl_get_addr_dumpit()
mptcp_pm_nl_set_flags_doit()
are generic, implemented for each PM, in-kernel PM and userspace PM. It's
clearer to move them from pm_netlink.c to pm.c.
And the linked three path manager wrappers
mptcp_pm_get_addr()
mptcp_pm_dump_addr()
mptcp_pm_set_flags()
can be changed as static functions, no need to export them in protocol.h.
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
net/mptcp/pm.c | 23 ++++++++++++++++++++---
net/mptcp/pm_netlink.c | 16 ----------------
net/mptcp/protocol.h | 3 ---
3 files changed, 20 insertions(+), 22 deletions(-)
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 16c336c51940..a29be5ff73a6 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -10,6 +10,7 @@
#include "protocol.h"
#include "mib.h"
+#include "mptcp_pm_gen.h"
/* path manager command handlers */
@@ -433,14 +434,19 @@ bool mptcp_pm_is_backup(struct mptcp_sock *msk, struct sock_common *skc)
return mptcp_pm_nl_is_backup(msk, &skc_local);
}
-int mptcp_pm_get_addr(struct sk_buff *skb, struct genl_info *info)
+static int mptcp_pm_get_addr(struct sk_buff *skb, struct genl_info *info)
{
if (info->attrs[MPTCP_PM_ATTR_TOKEN])
return mptcp_userspace_pm_get_addr(skb, info);
return mptcp_pm_nl_get_addr(skb, info);
}
-int mptcp_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb)
+int mptcp_pm_nl_get_addr_doit(struct sk_buff *skb, struct genl_info *info)
+{
+ return mptcp_pm_get_addr(skb, info);
+}
+
+static int mptcp_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb)
{
const struct genl_info *info = genl_info_dump(cb);
@@ -449,13 +455,24 @@ int mptcp_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb)
return mptcp_pm_nl_dump_addr(msg, cb);
}
-int mptcp_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
+int mptcp_pm_nl_get_addr_dumpit(struct sk_buff *msg,
+ struct netlink_callback *cb)
+{
+ return mptcp_pm_dump_addr(msg, cb);
+}
+
+static int mptcp_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
{
if (info->attrs[MPTCP_PM_ATTR_TOKEN])
return mptcp_userspace_pm_set_flags(skb, info);
return mptcp_pm_nl_set_flags(skb, info);
}
+int mptcp_pm_nl_set_flags_doit(struct sk_buff *skb, struct genl_info *info)
+{
+ return mptcp_pm_set_flags(skb, info);
+}
+
void mptcp_pm_subflow_chk_stale(const struct mptcp_sock *msk, struct sock *ssk)
{
struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(ssk);
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 98ac73938bd8..32367fcc728e 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1812,11 +1812,6 @@ int mptcp_pm_nl_get_addr(struct sk_buff *skb, struct genl_info *info)
return ret;
}
-int mptcp_pm_nl_get_addr_doit(struct sk_buff *skb, struct genl_info *info)
-{
- return mptcp_pm_get_addr(skb, info);
-}
-
int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
struct netlink_callback *cb)
{
@@ -1860,12 +1855,6 @@ int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
return msg->len;
}
-int mptcp_pm_nl_get_addr_dumpit(struct sk_buff *msg,
- struct netlink_callback *cb)
-{
- return mptcp_pm_dump_addr(msg, cb);
-}
-
static int parse_limit(struct genl_info *info, int id, unsigned int *limit)
{
struct nlattr *attr = info->attrs[id];
@@ -2035,11 +2024,6 @@ int mptcp_pm_nl_set_flags(struct sk_buff *skb, struct genl_info *info)
return 0;
}
-int mptcp_pm_nl_set_flags_doit(struct sk_buff *skb, struct genl_info *info)
-{
- return mptcp_pm_set_flags(skb, info);
-}
-
static void mptcp_nl_mcast_send(struct net *net, struct sk_buff *nlskb, gfp_t gfp)
{
genlmsg_multicast_netns(&mptcp_genl_family, net,
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 19a811220621..3bff78efd8ed 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -1035,7 +1035,6 @@ bool mptcp_lookup_subflow_by_saddr(const struct list_head *list,
const struct mptcp_addr_info *saddr);
bool mptcp_remove_anno_list_by_saddr(struct mptcp_sock *msk,
const struct mptcp_addr_info *addr);
-int mptcp_pm_set_flags(struct sk_buff *skb, struct genl_info *info);
int mptcp_pm_nl_set_flags(struct sk_buff *skb, struct genl_info *info);
int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *info);
int mptcp_pm_announce_addr(struct mptcp_sock *msk,
@@ -1128,12 +1127,10 @@ int mptcp_userspace_pm_get_local_id(struct mptcp_sock *msk, struct mptcp_addr_in
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);
-int mptcp_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb);
int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
struct netlink_callback *cb);
int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
struct netlink_callback *cb);
-int mptcp_pm_get_addr(struct sk_buff *skb, struct genl_info *info);
int mptcp_pm_nl_get_addr(struct sk_buff *skb, struct genl_info *info);
int mptcp_userspace_pm_get_addr(struct sk_buff *skb,
struct genl_info *info);
--
2.45.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH mptcp-next v2 2/8] mptcp: drop skb parameter of get_addr
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 ` Geliang Tang
2024-12-13 7:35 ` [PATCH mptcp-next v2 3/8] mptcp: add id parameter for get_addr Geliang Tang
` (6 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: Geliang Tang @ 2024-12-13 7:35 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <tanggeliang@kylinos.cn>
The first parameters 'skb' of get_addr() interfaces are now useless
since mptcp_userspace_pm_get_sock() helper is used. This patch drops
these useless parameters of them.
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
net/mptcp/pm.c | 8 ++++----
net/mptcp/pm_netlink.c | 2 +-
net/mptcp/pm_userspace.c | 3 +--
net/mptcp/protocol.h | 5 ++---
4 files changed, 8 insertions(+), 10 deletions(-)
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index a29be5ff73a6..526e5bca1fa1 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -434,16 +434,16 @@ bool mptcp_pm_is_backup(struct mptcp_sock *msk, struct sock_common *skc)
return mptcp_pm_nl_is_backup(msk, &skc_local);
}
-static int mptcp_pm_get_addr(struct sk_buff *skb, struct genl_info *info)
+static int mptcp_pm_get_addr(struct genl_info *info)
{
if (info->attrs[MPTCP_PM_ATTR_TOKEN])
- return mptcp_userspace_pm_get_addr(skb, info);
- return mptcp_pm_nl_get_addr(skb, info);
+ return mptcp_userspace_pm_get_addr(info);
+ return mptcp_pm_nl_get_addr(info);
}
int mptcp_pm_nl_get_addr_doit(struct sk_buff *skb, struct genl_info *info)
{
- return mptcp_pm_get_addr(skb, info);
+ return mptcp_pm_get_addr(info);
}
static int mptcp_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 32367fcc728e..92b4dcc310d3 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1762,7 +1762,7 @@ int mptcp_nl_fill_addr(struct sk_buff *skb,
return -EMSGSIZE;
}
-int mptcp_pm_nl_get_addr(struct sk_buff *skb, struct genl_info *info)
+int mptcp_pm_nl_get_addr(struct genl_info *info)
{
struct nlattr *attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];
struct pm_nl_pernet *pernet = genl_info_pm_nl(info);
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index 740a10d669f8..ab92efec6618 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -663,8 +663,7 @@ int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
return ret;
}
-int mptcp_userspace_pm_get_addr(struct sk_buff *skb,
- struct genl_info *info)
+int mptcp_userspace_pm_get_addr(struct genl_info *info)
{
struct nlattr *attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];
struct mptcp_pm_addr_entry addr, *entry;
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 3bff78efd8ed..dd673b41f0ce 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -1131,9 +1131,8 @@ int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
struct netlink_callback *cb);
int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
struct netlink_callback *cb);
-int mptcp_pm_nl_get_addr(struct sk_buff *skb, struct genl_info *info);
-int mptcp_userspace_pm_get_addr(struct sk_buff *skb,
- struct genl_info *info);
+int mptcp_pm_nl_get_addr(struct genl_info *info);
+int mptcp_userspace_pm_get_addr(struct genl_info *info);
static inline u8 subflow_get_local_id(const struct mptcp_subflow_context *subflow)
{
--
2.45.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH mptcp-next v2 3/8] mptcp: add id parameter for get_addr
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 ` 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
` (5 subsequent siblings)
8 siblings, 1 reply; 16+ messages in thread
From: Geliang Tang @ 2024-12-13 7:35 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <tanggeliang@kylinos.cn>
The address id is parsed both in mptcp_pm_nl_get_addr() and
mptcp_userspace_pm_get_addr(), this makes the code somewhat repetitive.
So this patch adds a new parameter 'id' for all get_addr() interfaces.
The address id is only parsed in mptcp_pm_nl_get_addr_doit(), then pass
it to both mptcp_pm_nl_get_addr() and mptcp_userspace_pm_get_addr().
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
net/mptcp/pm.c | 16 ++++++++++++----
net/mptcp/pm_netlink.c | 11 +++--------
net/mptcp/pm_userspace.c | 11 +++--------
net/mptcp/protocol.h | 4 ++--
4 files changed, 20 insertions(+), 22 deletions(-)
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 526e5bca1fa1..c7d323c7c7aa 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -434,16 +434,24 @@ bool mptcp_pm_is_backup(struct mptcp_sock *msk, struct sock_common *skc)
return mptcp_pm_nl_is_backup(msk, &skc_local);
}
-static int mptcp_pm_get_addr(struct genl_info *info)
+static int mptcp_pm_get_addr(u8 id, struct genl_info *info)
{
if (info->attrs[MPTCP_PM_ATTR_TOKEN])
- return mptcp_userspace_pm_get_addr(info);
- return mptcp_pm_nl_get_addr(info);
+ return mptcp_userspace_pm_get_addr(id, info);
+ return mptcp_pm_nl_get_addr(id, info);
}
int mptcp_pm_nl_get_addr_doit(struct sk_buff *skb, struct genl_info *info)
{
- return mptcp_pm_get_addr(info);
+ struct nlattr *attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];
+ struct mptcp_pm_addr_entry addr;
+ int ret;
+
+ ret = mptcp_pm_parse_entry(attr, info, false, &addr);
+ if (ret < 0)
+ return ret;
+
+ return mptcp_pm_get_addr(addr.addr.id, info);
}
static int mptcp_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 92b4dcc310d3..de6a8e7a4a1a 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1762,19 +1762,14 @@ int mptcp_nl_fill_addr(struct sk_buff *skb,
return -EMSGSIZE;
}
-int mptcp_pm_nl_get_addr(struct genl_info *info)
+int mptcp_pm_nl_get_addr(u8 id, struct genl_info *info)
{
- struct nlattr *attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];
struct pm_nl_pernet *pernet = genl_info_pm_nl(info);
- struct mptcp_pm_addr_entry addr, *entry;
+ struct mptcp_pm_addr_entry *entry;
struct sk_buff *msg;
void *reply;
int ret;
- ret = mptcp_pm_parse_entry(attr, info, false, &addr);
- if (ret < 0)
- return ret;
-
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (!msg)
return -ENOMEM;
@@ -1788,7 +1783,7 @@ int mptcp_pm_nl_get_addr(struct genl_info *info)
}
rcu_read_lock();
- entry = __lookup_addr_by_id(pernet, addr.addr.id);
+ entry = __lookup_addr_by_id(pernet, id);
if (!entry) {
GENL_SET_ERR_MSG(info, "address not found");
ret = -EINVAL;
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index ab92efec6618..40a018be243e 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -663,10 +663,9 @@ int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
return ret;
}
-int mptcp_userspace_pm_get_addr(struct genl_info *info)
+int mptcp_userspace_pm_get_addr(u8 id, struct genl_info *info)
{
- struct nlattr *attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];
- struct mptcp_pm_addr_entry addr, *entry;
+ struct mptcp_pm_addr_entry *entry;
struct mptcp_sock *msk;
struct sk_buff *msg;
int ret = -EINVAL;
@@ -679,10 +678,6 @@ int mptcp_userspace_pm_get_addr(struct genl_info *info)
sk = (struct sock *)msk;
- ret = mptcp_pm_parse_entry(attr, info, false, &addr);
- if (ret < 0)
- goto out;
-
msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
if (!msg) {
ret = -ENOMEM;
@@ -699,7 +694,7 @@ int mptcp_userspace_pm_get_addr(struct genl_info *info)
lock_sock(sk);
spin_lock_bh(&msk->pm.lock);
- entry = mptcp_userspace_pm_lookup_addr_by_id(msk, addr.addr.id);
+ entry = mptcp_userspace_pm_lookup_addr_by_id(msk, id);
if (!entry) {
GENL_SET_ERR_MSG(info, "address not found");
ret = -EINVAL;
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index dd673b41f0ce..76a0cfe54723 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -1131,8 +1131,8 @@ int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
struct netlink_callback *cb);
int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
struct netlink_callback *cb);
-int mptcp_pm_nl_get_addr(struct genl_info *info);
-int mptcp_userspace_pm_get_addr(struct genl_info *info);
+int mptcp_pm_nl_get_addr(u8 id, struct genl_info *info);
+int mptcp_userspace_pm_get_addr(u8 id, struct genl_info *info);
static inline u8 subflow_get_local_id(const struct mptcp_subflow_context *subflow)
{
--
2.45.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH mptcp-next v2 4/8] mptcp: reuse sending nlmsg code in get_addr
2024-12-13 7:35 [PATCH mptcp-next v2 0/8] BPF path manager, part 2 Geliang Tang
` (2 preceding siblings ...)
2024-12-13 7:35 ` [PATCH mptcp-next v2 3/8] mptcp: add id parameter for get_addr Geliang Tang
@ 2024-12-13 7:35 ` Geliang Tang
2024-12-13 7:35 ` [PATCH mptcp-next v2 5/8] mptcp: change info of get_addr as const Geliang Tang
` (4 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: Geliang Tang @ 2024-12-13 7:35 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <tanggeliang@kylinos.cn>
The netlink messages are sent both in mptcp_pm_nl_get_addr() and
mptcp_userspace_pm_get_addr(), this makes the code somewhat repetitive.
This is because the netlink PM and userspace PM use different locks to
protect the address entry that needs to be sent via the netlink message.
The former uses rcu read lock, and the latter uses msk->pm.lock.
The current get_addr() flow looks like this:
lock();
entry = get_entry();
send_nlmsg(entry);
unlock();
After holding the lock, get the entry from the list, send the entry, and
finally release the lock.
This patch changes the process by getting the entry while holding the lock,
then making a copy of the entry so that the lock can be released. Finally,
the copy of the entry is sent without locking:
lock();
entry = get_entry();
*copy = *entry;
unlock();
send_nlmsg(copy);
This way we can reuse the send_nlmsg() code in get_addr() interfaces
between the netlink PM and userspace PM. They only need to implement their
own get_addr() interfaces to hold the different locks, get the entry from
the different lists, then release the locks.
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
net/mptcp/pm.c | 39 ++++++++++++++++++++++++++++++++++----
net/mptcp/pm_netlink.c | 39 ++++++--------------------------------
net/mptcp/pm_userspace.c | 41 +++++-----------------------------------
net/mptcp/protocol.h | 6 ++++--
4 files changed, 50 insertions(+), 75 deletions(-)
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index c7d323c7c7aa..9f3d82a86746 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -434,24 +434,55 @@ bool mptcp_pm_is_backup(struct mptcp_sock *msk, struct sock_common *skc)
return mptcp_pm_nl_is_backup(msk, &skc_local);
}
-static int mptcp_pm_get_addr(u8 id, struct genl_info *info)
+static int mptcp_pm_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
+ struct genl_info *info)
{
if (info->attrs[MPTCP_PM_ATTR_TOKEN])
- return mptcp_userspace_pm_get_addr(id, info);
- return mptcp_pm_nl_get_addr(id, info);
+ return mptcp_userspace_pm_get_addr(id, addr, info);
+ return mptcp_pm_nl_get_addr(id, addr, info);
}
int mptcp_pm_nl_get_addr_doit(struct sk_buff *skb, struct genl_info *info)
{
struct nlattr *attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];
struct mptcp_pm_addr_entry addr;
+ struct sk_buff *msg;
+ void *reply;
int ret;
ret = mptcp_pm_parse_entry(attr, info, false, &addr);
if (ret < 0)
return ret;
- return mptcp_pm_get_addr(addr.addr.id, info);
+ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
+ if (!msg)
+ return -ENOMEM;
+
+ reply = genlmsg_put_reply(msg, info, &mptcp_genl_family, 0,
+ info->genlhdr->cmd);
+ if (!reply) {
+ GENL_SET_ERR_MSG(info, "not enough space in Netlink message");
+ ret = -EMSGSIZE;
+ goto fail;
+ }
+
+ ret = mptcp_pm_get_addr(addr.addr.id, &addr, info);
+ if (ret) {
+ GENL_SET_ERR_MSG(info, "address not found");
+ goto fail;
+ }
+
+ ret = mptcp_nl_fill_addr(msg, &addr);
+ if (ret)
+ goto fail;
+
+ genlmsg_end(msg, reply);
+ ret = genlmsg_reply(msg, info);
+ return ret;
+
+fail:
+ nlmsg_free(msg);
+ return ret;
}
static int mptcp_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index de6a8e7a4a1a..dce6a5b5ea4d 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1762,48 +1762,21 @@ int mptcp_nl_fill_addr(struct sk_buff *skb,
return -EMSGSIZE;
}
-int mptcp_pm_nl_get_addr(u8 id, struct genl_info *info)
+int mptcp_pm_nl_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
+ struct genl_info *info)
{
struct pm_nl_pernet *pernet = genl_info_pm_nl(info);
struct mptcp_pm_addr_entry *entry;
- struct sk_buff *msg;
- void *reply;
- int ret;
-
- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
- if (!msg)
- return -ENOMEM;
-
- reply = genlmsg_put_reply(msg, info, &mptcp_genl_family, 0,
- info->genlhdr->cmd);
- if (!reply) {
- GENL_SET_ERR_MSG(info, "not enough space in Netlink message");
- ret = -EMSGSIZE;
- goto fail;
- }
+ int ret = -EINVAL;
rcu_read_lock();
entry = __lookup_addr_by_id(pernet, id);
- if (!entry) {
- GENL_SET_ERR_MSG(info, "address not found");
- ret = -EINVAL;
- goto unlock_fail;
+ if (entry) {
+ *addr = *entry;
+ ret = 0;
}
-
- ret = mptcp_nl_fill_addr(msg, entry);
- if (ret)
- goto unlock_fail;
-
- genlmsg_end(msg, reply);
- ret = genlmsg_reply(msg, info);
- rcu_read_unlock();
- return ret;
-
-unlock_fail:
rcu_read_unlock();
-fail:
- nlmsg_free(msg);
return ret;
}
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index 40a018be243e..6dd5a3f1c0c7 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -663,14 +663,13 @@ int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
return ret;
}
-int mptcp_userspace_pm_get_addr(u8 id, struct genl_info *info)
+int mptcp_userspace_pm_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
+ struct genl_info *info)
{
struct mptcp_pm_addr_entry *entry;
struct mptcp_sock *msk;
- struct sk_buff *msg;
int ret = -EINVAL;
struct sock *sk;
- void *reply;
msk = mptcp_userspace_pm_get_sock(info);
if (!msk)
@@ -678,46 +677,16 @@ int mptcp_userspace_pm_get_addr(u8 id, struct genl_info *info)
sk = (struct sock *)msk;
- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
- if (!msg) {
- ret = -ENOMEM;
- goto out;
- }
-
- reply = genlmsg_put_reply(msg, info, &mptcp_genl_family, 0,
- info->genlhdr->cmd);
- if (!reply) {
- GENL_SET_ERR_MSG(info, "not enough space in Netlink message");
- ret = -EMSGSIZE;
- goto fail;
- }
-
lock_sock(sk);
spin_lock_bh(&msk->pm.lock);
entry = mptcp_userspace_pm_lookup_addr_by_id(msk, id);
- if (!entry) {
- GENL_SET_ERR_MSG(info, "address not found");
- ret = -EINVAL;
- goto unlock_fail;
+ if (entry) {
+ *addr = *entry;
+ ret = 0;
}
-
- ret = mptcp_nl_fill_addr(msg, entry);
- if (ret)
- goto unlock_fail;
-
- genlmsg_end(msg, reply);
- ret = genlmsg_reply(msg, info);
spin_unlock_bh(&msk->pm.lock);
release_sock(sk);
- sock_put(sk);
- return ret;
-unlock_fail:
- spin_unlock_bh(&msk->pm.lock);
- release_sock(sk);
-fail:
- nlmsg_free(msg);
-out:
sock_put(sk);
return ret;
}
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 76a0cfe54723..a80a0191e2cd 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -1131,8 +1131,10 @@ int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
struct netlink_callback *cb);
int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
struct netlink_callback *cb);
-int mptcp_pm_nl_get_addr(u8 id, struct genl_info *info);
-int mptcp_userspace_pm_get_addr(u8 id, struct genl_info *info);
+int mptcp_pm_nl_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
+ struct genl_info *info);
+int mptcp_userspace_pm_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
+ struct genl_info *info);
static inline u8 subflow_get_local_id(const struct mptcp_subflow_context *subflow)
{
--
2.45.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH mptcp-next v2 5/8] mptcp: change info of get_addr as const
2024-12-13 7:35 [PATCH mptcp-next v2 0/8] BPF path manager, part 2 Geliang Tang
` (3 preceding siblings ...)
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 ` 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
` (3 subsequent siblings)
8 siblings, 1 reply; 16+ messages in thread
From: Geliang Tang @ 2024-12-13 7:35 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <tanggeliang@kylinos.cn>
get_addr() interfaces will be invoked by dump_addr(), which using const
parameters 'info', so this patch changes 'info' parameters of get_addr()
as const too.
Some adaptations are also needed. No longer use genl_info_pm_nl() because
it doesn't accept a 'const' variable, but that's OK to get pernet via
genl_info_net().
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
net/mptcp/pm.c | 2 +-
net/mptcp/pm_netlink.c | 7 +++++--
net/mptcp/pm_userspace.c | 2 +-
net/mptcp/protocol.h | 4 ++--
4 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 9f3d82a86746..080c842e9e90 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -435,7 +435,7 @@ bool mptcp_pm_is_backup(struct mptcp_sock *msk, struct sock_common *skc)
}
static int mptcp_pm_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
- struct genl_info *info)
+ const struct genl_info *info)
{
if (info->attrs[MPTCP_PM_ATTR_TOKEN])
return mptcp_userspace_pm_get_addr(id, addr, info);
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index dce6a5b5ea4d..eb5f48e45187 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1763,12 +1763,15 @@ int mptcp_nl_fill_addr(struct sk_buff *skb,
}
int mptcp_pm_nl_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
- struct genl_info *info)
+ const struct genl_info *info)
{
- struct pm_nl_pernet *pernet = genl_info_pm_nl(info);
+ struct net *net = genl_info_net(info);
struct mptcp_pm_addr_entry *entry;
+ struct pm_nl_pernet *pernet;
int ret = -EINVAL;
+ pernet = pm_nl_get_pernet(net);
+
rcu_read_lock();
entry = __lookup_addr_by_id(pernet, id);
if (entry) {
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index 6dd5a3f1c0c7..7c5914012947 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -664,7 +664,7 @@ int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
}
int mptcp_userspace_pm_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
- struct genl_info *info)
+ const struct genl_info *info)
{
struct mptcp_pm_addr_entry *entry;
struct mptcp_sock *msk;
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index a80a0191e2cd..a9fc30f20376 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -1132,9 +1132,9 @@ int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
struct netlink_callback *cb);
int mptcp_pm_nl_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
- struct genl_info *info);
+ const struct genl_info *info);
int mptcp_userspace_pm_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
- struct genl_info *info);
+ const struct genl_info *info);
static inline u8 subflow_get_local_id(const struct mptcp_subflow_context *subflow)
{
--
2.45.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH mptcp-next v2 6/8] mptcp: add info parameter for dump_addr
2024-12-13 7:35 [PATCH mptcp-next v2 0/8] BPF path manager, part 2 Geliang Tang
` (4 preceding siblings ...)
2024-12-13 7:35 ` [PATCH mptcp-next v2 5/8] mptcp: change info of get_addr as const Geliang Tang
@ 2024-12-13 7:35 ` Geliang Tang
2024-12-13 7:35 ` [PATCH mptcp-next v2 7/8] mptcp: add mptcp_pm_addr_id_bitmap_t type Geliang Tang
` (2 subsequent siblings)
8 siblings, 0 replies; 16+ messages in thread
From: Geliang Tang @ 2024-12-13 7:35 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <tanggeliang@kylinos.cn>
The genl_info information is useful for dump_addr() interface in both
in-kernel PM and userspace PM. The former can use it to get pm_nl_pernet,
the latter can use it to get msk through mptcp_userspace_pm_get_sock().
So this patch adds an 'info' parameter to dump_addr interface, so that
'info' can be obtained in mptcp_pm_nl_get_addr_dumpit() and then passed to
mptcp_pm_nl_dump_addr() or mptcp_userspace_pm_dump_addr(), without having
to get it again in these two functions.
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
net/mptcp/pm.c | 13 +++++++------
net/mptcp/pm_netlink.c | 5 +++--
net/mptcp/pm_userspace.c | 4 ++--
net/mptcp/protocol.h | 6 ++++--
4 files changed, 16 insertions(+), 12 deletions(-)
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 080c842e9e90..0aaf16319c34 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -485,19 +485,20 @@ int mptcp_pm_nl_get_addr_doit(struct sk_buff *skb, struct genl_info *info)
return ret;
}
-static int mptcp_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb)
+static int mptcp_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb,
+ const struct genl_info *info)
{
- const struct genl_info *info = genl_info_dump(cb);
-
if (info->attrs[MPTCP_PM_ATTR_TOKEN])
- return mptcp_userspace_pm_dump_addr(msg, cb);
- return mptcp_pm_nl_dump_addr(msg, cb);
+ return mptcp_userspace_pm_dump_addr(msg, cb, info);
+ return mptcp_pm_nl_dump_addr(msg, cb, info);
}
int mptcp_pm_nl_get_addr_dumpit(struct sk_buff *msg,
struct netlink_callback *cb)
{
- return mptcp_pm_dump_addr(msg, cb);
+ const struct genl_info *info = genl_info_dump(cb);
+
+ return mptcp_pm_dump_addr(msg, cb, info);
}
static int mptcp_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index eb5f48e45187..0d826bfc4718 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1784,9 +1784,10 @@ int mptcp_pm_nl_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
}
int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
- struct netlink_callback *cb)
+ struct netlink_callback *cb,
+ const struct genl_info *info)
{
- struct net *net = sock_net(msg->sk);
+ struct net *net = genl_info_net(info);
struct mptcp_pm_addr_entry *entry;
struct pm_nl_pernet *pernet;
int id = cb->args[0];
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index 7c5914012947..7dc417255e8f 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -615,12 +615,12 @@ int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
}
int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
- struct netlink_callback *cb)
+ struct netlink_callback *cb,
+ const struct genl_info *info)
{
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_entry *entry;
struct mptcp_sock *msk;
int ret = -EINVAL;
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index a9fc30f20376..1f9c66f53865 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -1128,9 +1128,11 @@ 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);
int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
- struct netlink_callback *cb);
+ struct netlink_callback *cb,
+ const struct genl_info *info);
int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
- struct netlink_callback *cb);
+ struct netlink_callback *cb,
+ const struct genl_info *info);
int mptcp_pm_nl_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
const struct genl_info *info);
int mptcp_userspace_pm_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
--
2.45.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH mptcp-next v2 7/8] mptcp: add mptcp_pm_addr_id_bitmap_t type
2024-12-13 7:35 [PATCH mptcp-next v2 0/8] BPF path manager, part 2 Geliang Tang
` (5 preceding siblings ...)
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 ` Geliang Tang
2024-12-30 16:30 ` 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:27 ` [PATCH mptcp-next v2 0/8] BPF path manager, part 2 Matthieu Baerts
8 siblings, 1 reply; 16+ messages in thread
From: Geliang Tang @ 2024-12-13 7:35 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
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;
+
#ifdef CONFIG_MPTCP
void mptcp_init(void);
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index 7dc417255e8f..0d9bea3a04a2 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -47,15 +47,15 @@ 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_entry *match = NULL;
struct sock *sk = (struct sock *)msk;
+ mptcp_pm_addr_id_bitmap_t id_bitmap;
struct mptcp_pm_addr_entry *e;
bool addr_match = false;
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);
@@ -618,16 +618,14 @@ int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
struct netlink_callback *cb,
const struct genl_info *info)
{
- struct id_bitmap {
- DECLARE_BITMAP(map, MPTCP_PM_MAX_ADDR_ID + 1);
- } *bitmap;
+ mptcp_pm_addr_id_bitmap_t *bitmap;
struct mptcp_pm_addr_entry *entry;
struct mptcp_sock *msk;
int ret = -EINVAL;
struct sock *sk;
void *hdr;
- bitmap = (struct id_bitmap *)cb->ctx;
+ bitmap = (mptcp_pm_addr_id_bitmap_t *)cb->ctx;
msk = mptcp_userspace_pm_get_sock(info);
if (!msk)
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 1f9c66f53865..da2cf524c5da 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -208,9 +208,6 @@ enum mptcp_addr_signal_status {
MPTCP_RM_ADDR_SIGNAL,
};
-/* max value of mptcp_addr_info.id */
-#define MPTCP_PM_MAX_ADDR_ID U8_MAX
-
struct mptcp_pm_data {
struct mptcp_addr_info local;
struct mptcp_addr_info remote;
--
2.45.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* [PATCH mptcp-next v2 8/8] mptcp: reuse sending nlmsg code in dump_addr
2024-12-13 7:35 [PATCH mptcp-next v2 0/8] BPF path manager, part 2 Geliang Tang
` (6 preceding siblings ...)
2024-12-13 7:35 ` [PATCH mptcp-next v2 7/8] mptcp: add mptcp_pm_addr_id_bitmap_t type Geliang Tang
@ 2024-12-13 7:35 ` 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
8 siblings, 1 reply; 16+ messages in thread
From: Geliang Tang @ 2024-12-13 7:35 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <tanggeliang@kylinos.cn>
With the help of get_addr(), we can modify dump_addr() interfaces
to reuse send_nlmsg code between the netlink PM and userspace PM.
The current dump_addr() flow looks like this:
lock();
for_each_entry(entry)
send_nlmsg(entry);
unlock();
After holding the lock, get every entry by walking the address list,
send each one looply, and finally release the lock.
This set changes the process by copying the address list to an id
bitmap while holding the lock, then release the lock immediately.
After that, without locking, walking the copied id bitmap to get
every copy of entry by using get_addr(), and send each one looply:
lock();
for_each_entry(entry)
set_bit(bitmap);
unlock();
for_each_bit(bitmap) {
copy = get_addr();
send_nlmsg(copy);
}
With this, we can reuse the send_nlmsg() code in dump_addr() interfaces
between the netlink PM and userspace PM. They only need to implement
their own dump_addr() interfaces to hold the different locks, copy the
different address lists to an id bitmap, then release the locks.
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
net/mptcp/pm.c | 43 ++++++++++++++++++++++++++++++++++++----
net/mptcp/pm_netlink.c | 35 +++-----------------------------
net/mptcp/pm_userspace.c | 41 ++++++++++++++------------------------
net/mptcp/protocol.h | 6 ++----
4 files changed, 59 insertions(+), 66 deletions(-)
diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
index 0aaf16319c34..22c0ca77ca0d 100644
--- a/net/mptcp/pm.c
+++ b/net/mptcp/pm.c
@@ -485,20 +485,55 @@ int mptcp_pm_nl_get_addr_doit(struct sk_buff *skb, struct genl_info *info)
return ret;
}
-static int mptcp_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb,
+static int mptcp_pm_dump_addr(mptcp_pm_addr_id_bitmap_t *bitmap,
const struct genl_info *info)
{
if (info->attrs[MPTCP_PM_ATTR_TOKEN])
- return mptcp_userspace_pm_dump_addr(msg, cb, info);
- return mptcp_pm_nl_dump_addr(msg, cb, info);
+ return mptcp_userspace_pm_dump_addr(bitmap, info);
+ return mptcp_pm_nl_dump_addr(bitmap, info);
}
int mptcp_pm_nl_get_addr_dumpit(struct sk_buff *msg,
struct netlink_callback *cb)
{
const struct genl_info *info = genl_info_dump(cb);
+ mptcp_pm_addr_id_bitmap_t *bitmap;
+ struct mptcp_pm_addr_entry entry;
+ int id = cb->args[0];
+ void *hdr;
+ int i;
+
+ bitmap = (mptcp_pm_addr_id_bitmap_t *)cb->ctx;
+
+ mptcp_pm_dump_addr(bitmap, info);
+
+ for (i = id; i < MPTCP_PM_MAX_ADDR_ID + 1; i++) {
+ if (test_bit(i, bitmap->map)) {
+ if (mptcp_pm_get_addr(i, &entry, info))
+ break;
+
+ if (id && 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)
+ break;
+
+ if (mptcp_nl_fill_addr(msg, &entry) < 0) {
+ genlmsg_cancel(msg, hdr);
+ break;
+ }
+
+ id = entry.addr.id;
+ genlmsg_end(msg, hdr);
+ }
+ }
- return mptcp_pm_dump_addr(msg, cb, info);
+ cb->args[0] = id;
+ return msg->len;
}
static int mptcp_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 0d826bfc4718..831c440d6cc5 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1783,48 +1783,19 @@ int mptcp_pm_nl_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
return ret;
}
-int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
- struct netlink_callback *cb,
+int mptcp_pm_nl_dump_addr(mptcp_pm_addr_id_bitmap_t *bitmap,
const struct genl_info *info)
{
struct net *net = genl_info_net(info);
- 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);
rcu_read_lock();
- for (i = id; i < MPTCP_PM_MAX_ADDR_ID + 1; i++) {
- if (test_bit(i, pernet->id_bitmap)) {
- entry = __lookup_addr_by_id(pernet, i);
- if (!entry)
- break;
-
- 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)
- break;
-
- if (mptcp_nl_fill_addr(msg, entry) < 0) {
- genlmsg_cancel(msg, hdr);
- break;
- }
-
- id = entry->addr.id;
- genlmsg_end(msg, hdr);
- }
- }
+ bitmap_copy(bitmap->map, pernet->id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1);
rcu_read_unlock();
- cb->args[0] = id;
- return msg->len;
+ return 0;
}
static int parse_limit(struct genl_info *info, int id, unsigned int *limit)
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index 0d9bea3a04a2..0db477b703a5 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -614,18 +614,25 @@ int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
return ret;
}
-int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
- struct netlink_callback *cb,
- const struct genl_info *info)
+static int mptcp_userspace_pm_reset_bitmap(struct mptcp_sock *msk,
+ mptcp_pm_addr_id_bitmap_t *bitmap)
{
- mptcp_pm_addr_id_bitmap_t *bitmap;
struct mptcp_pm_addr_entry *entry;
+
+ bitmap_zero(bitmap->map, MPTCP_PM_MAX_ADDR_ID + 1);
+
+ mptcp_for_each_userspace_pm_addr(msk, entry)
+ __set_bit(entry->addr.id, bitmap->map);
+
+ return 0;
+}
+
+int mptcp_userspace_pm_dump_addr(mptcp_pm_addr_id_bitmap_t *bitmap,
+ const struct genl_info *info)
+{
struct mptcp_sock *msk;
int ret = -EINVAL;
struct sock *sk;
- void *hdr;
-
- bitmap = (mptcp_pm_addr_id_bitmap_t *)cb->ctx;
msk = mptcp_userspace_pm_get_sock(info);
if (!msk)
@@ -635,27 +642,9 @@ int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
lock_sock(sk);
spin_lock_bh(&msk->pm.lock);
- mptcp_for_each_userspace_pm_addr(msk, entry) {
- 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)
- 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);
- }
+ ret = mptcp_userspace_pm_reset_bitmap(msk, bitmap);
spin_unlock_bh(&msk->pm.lock);
release_sock(sk);
- ret = msg->len;
sock_put(sk);
return ret;
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index da2cf524c5da..ed629320ba56 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -1124,11 +1124,9 @@ int mptcp_userspace_pm_get_local_id(struct mptcp_sock *msk, struct mptcp_addr_in
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);
-int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
- struct netlink_callback *cb,
+int mptcp_pm_nl_dump_addr(mptcp_pm_addr_id_bitmap_t *bitmap,
const struct genl_info *info);
-int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
- struct netlink_callback *cb,
+int mptcp_userspace_pm_dump_addr(mptcp_pm_addr_id_bitmap_t *bitmap,
const struct genl_info *info);
int mptcp_pm_nl_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
const struct genl_info *info);
--
2.45.2
^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH mptcp-next v2 0/8] BPF path manager, part 2
2024-12-13 7:35 [PATCH mptcp-next v2 0/8] BPF path manager, part 2 Geliang Tang
` (7 preceding siblings ...)
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:27 ` Matthieu Baerts
8 siblings, 0 replies; 16+ messages in thread
From: Matthieu Baerts @ 2024-12-30 16:27 UTC (permalink / raw)
To: Geliang Tang, mptcp; +Cc: Geliang Tang
Hi Geliang,
On 13/12/2024 08:35, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> v2:
> - split patch 7 of v1 into two.
> - patches 1-6 have no code changes, only the commit logs have been
> updated.
> - more commit log to explain why mptcp_pm_addr_id_bitmap_t needs to
> be defined.
> - use mptcp_pm_addr_id_bitmap_t in userspace_pm_append_new_local_addr
> too.
Sorry for the delay: I was waiting for the CI to do the validation, but
somehow, it didn't even start. An issue on Patchew side apparently:
https://patchew.org/MPTCP/cover.1734074788.git.tanggeliang@kylinos.cn/
The 6 first patches look good to me (just one small thing, and a rebase
might be needed).
It is unclear to me if we need the 2 last patches. Maybe patch 7/8 is
needed for the BPF path-manager? Not even sure, please see below.
Regarding patch 8/8, it looks like it introduces new issues, and solving
them increases the complexity, and I don't think it is worth saving a
bit of duplicated code there. WDYT?
> In order to implement BPF userspace path manager, it is necessary to
> unify the interfaces of the path manager. This set updates get_addr()
> and dump_addr() interfaces.
The modifications you are proposing here makes sense. Now, regarding the
BPF path-manager, to me, they don't really need to implement get_addr()
and dump_addr() because these interfaces are only useful for the userspace:
- with the in-kernel PM, it is useful to list the different endpoints to
be able to change the configuration if needed (or to check how endpoints
got configured).
- with the userspace one, it can be useful to retrieve addresses when
the daemon got restarted, to get info about previously created connections.
- with the BPF PM, I'm not sure if there is really a need to dump
addresses to the userspace. Or do you see a case where these interfaces
can be useful? I guess BPF PMs will be configured via BPF, and if there
is a need, the addresses can also be dumped via BPF, but I don't see the
point of exporting them via Netlink.
Maybe there is no need to do much around these interfaces, and the last
two patches can be dropped? Or maybe mptcp_pm_addr_id_bitmap_t can be
defined in protocol.h instead of in include/net/mptcp.h?
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH mptcp-next v2 3/8] mptcp: add id parameter for get_addr
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
0 siblings, 0 replies; 16+ messages in thread
From: Matthieu Baerts @ 2024-12-30 16:29 UTC (permalink / raw)
To: Geliang Tang, mptcp; +Cc: Geliang Tang
Hi Geliang,
Sorry, I just noticed this will cause conflicts with the series I just sent:
https://lore.kernel.org/all/20241230-genl_req_attr_check-v6-0-3ec9103559e7@kernel.org/T/
On 13/12/2024 08:35, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> The address id is parsed both in mptcp_pm_nl_get_addr() and
> mptcp_userspace_pm_get_addr(), this makes the code somewhat repetitive.
> So this patch adds a new parameter 'id' for all get_addr() interfaces.
> The address id is only parsed in mptcp_pm_nl_get_addr_doit(), then pass
> it to both mptcp_pm_nl_get_addr() and mptcp_userspace_pm_get_addr().
>
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
> net/mptcp/pm.c | 16 ++++++++++++----
> net/mptcp/pm_netlink.c | 11 +++--------
> net/mptcp/pm_userspace.c | 11 +++--------
> net/mptcp/protocol.h | 4 ++--
> 4 files changed, 20 insertions(+), 22 deletions(-)
>
> diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
> index 526e5bca1fa1..c7d323c7c7aa 100644
> --- a/net/mptcp/pm.c
> +++ b/net/mptcp/pm.c
> @@ -434,16 +434,24 @@ bool mptcp_pm_is_backup(struct mptcp_sock *msk, struct sock_common *skc)
> return mptcp_pm_nl_is_backup(msk, &skc_local);
> }
>
> -static int mptcp_pm_get_addr(struct genl_info *info)
> +static int mptcp_pm_get_addr(u8 id, struct genl_info *info)
> {
> if (info->attrs[MPTCP_PM_ATTR_TOKEN])
> - return mptcp_userspace_pm_get_addr(info);
> - return mptcp_pm_nl_get_addr(info);
> + return mptcp_userspace_pm_get_addr(id, info);
> + return mptcp_pm_nl_get_addr(id, info);
> }
>
> int mptcp_pm_nl_get_addr_doit(struct sk_buff *skb, struct genl_info *info)
> {
> - return mptcp_pm_get_addr(info);
> + struct nlattr *attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];
> + struct mptcp_pm_addr_entry addr;
> + int ret;
> +
> + ret = mptcp_pm_parse_entry(attr, info, false, &addr);
Could you first check if the attribute is set (to report a more precise
error), before parsing it please?
if (GENL_REQ_ATTR_CHECK(info, MPTCP_PM_ENDPOINT_ADDR))
return -EINVAL;
attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];
ret = mptcp_pm_parse_entry(attr, info, false, &addr);
(...)
So similar to this:
https://lore.kernel.org/all/20241230-genl_req_attr_check-v6-7-3ec9103559e7@kernel.org/
> + if (ret < 0)
> + return ret;
> +
> + return mptcp_pm_get_addr(addr.addr.id, info);
> }
>
> static int mptcp_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb)
> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> index 92b4dcc310d3..de6a8e7a4a1a 100644
> --- a/net/mptcp/pm_netlink.c
> +++ b/net/mptcp/pm_netlink.c
> @@ -1762,19 +1762,14 @@ int mptcp_nl_fill_addr(struct sk_buff *skb,
> return -EMSGSIZE;
> }
>
> -int mptcp_pm_nl_get_addr(struct genl_info *info)
> +int mptcp_pm_nl_get_addr(u8 id, struct genl_info *info)
> {
> - struct nlattr *attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];
> struct pm_nl_pernet *pernet = genl_info_pm_nl(info);
> - struct mptcp_pm_addr_entry addr, *entry;
> + struct mptcp_pm_addr_entry *entry;
> struct sk_buff *msg;
> void *reply;
> int ret;
>
> - ret = mptcp_pm_parse_entry(attr, info, false, &addr);
> - if (ret < 0)
> - return ret;
> -
> msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
> if (!msg)
> return -ENOMEM;
> @@ -1788,7 +1783,7 @@ int mptcp_pm_nl_get_addr(struct genl_info *info)
> }
>
> rcu_read_lock();
> - entry = __lookup_addr_by_id(pernet, addr.addr.id);
> + entry = __lookup_addr_by_id(pernet, id);
> if (!entry) {
> GENL_SET_ERR_MSG(info, "address not found");
Mmh, I switched this to NL_SET_ERR_MSG_ATTR() in:
https://patchwork.kernel.org/project/mptcp/patch/20241230-genl_req_attr_check-v6-1-3ec9103559e7@kernel.org/
... which requires 'attr'. We could not do the conversion here in the
patch I sent. But because you are also moving this part to pm.c in the
next patch, I suggest to temporally pass the pointer to 'attr' here in
this patch 3, and remove it in patch 4.
WDYT?
> ret = -EINVAL;
> diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
> index ab92efec6618..40a018be243e 100644
> --- a/net/mptcp/pm_userspace.c
> +++ b/net/mptcp/pm_userspace.c
> @@ -663,10 +663,9 @@ int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
> return ret;
> }
>
> -int mptcp_userspace_pm_get_addr(struct genl_info *info)
> +int mptcp_userspace_pm_get_addr(u8 id, struct genl_info *info)
> {
> - struct nlattr *attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];
> - struct mptcp_pm_addr_entry addr, *entry;
> + struct mptcp_pm_addr_entry *entry;
> struct mptcp_sock *msk;
> struct sk_buff *msg;
> int ret = -EINVAL;
> @@ -679,10 +678,6 @@ int mptcp_userspace_pm_get_addr(struct genl_info *info)
>
> sk = (struct sock *)msk;
>
> - ret = mptcp_pm_parse_entry(attr, info, false, &addr);
> - if (ret < 0)
> - goto out;
> -
> msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL);
> if (!msg) {
> ret = -ENOMEM;
> @@ -699,7 +694,7 @@ int mptcp_userspace_pm_get_addr(struct genl_info *info)
>
> lock_sock(sk);
> spin_lock_bh(&msk->pm.lock);
> - entry = mptcp_userspace_pm_lookup_addr_by_id(msk, addr.addr.id);
> + entry = mptcp_userspace_pm_lookup_addr_by_id(msk, id);
> if (!entry) {
> GENL_SET_ERR_MSG(info, "address not found");
Same here for GENL_SET_ERR_MSG() vs NL_SET_ERR_MSG_ATTR().
> ret = -EINVAL;
> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> index dd673b41f0ce..76a0cfe54723 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h
> @@ -1131,8 +1131,8 @@ int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
> struct netlink_callback *cb);
> int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
> struct netlink_callback *cb);
> -int mptcp_pm_nl_get_addr(struct genl_info *info);
> -int mptcp_userspace_pm_get_addr(struct genl_info *info);
> +int mptcp_pm_nl_get_addr(u8 id, struct genl_info *info);
> +int mptcp_userspace_pm_get_addr(u8 id, struct genl_info *info);
>
> static inline u8 subflow_get_local_id(const struct mptcp_subflow_context *subflow)
> {
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH mptcp-next v2 5/8] mptcp: change info of get_addr as const
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
0 siblings, 0 replies; 16+ messages in thread
From: Matthieu Baerts @ 2024-12-30 16:29 UTC (permalink / raw)
To: Geliang Tang, mptcp; +Cc: Geliang Tang
Hi Geliang,
On 13/12/2024 08:35, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> get_addr() interfaces will be invoked by dump_addr(), which using const
> parameters 'info', so this patch changes 'info' parameters of get_addr()
> as const too.
>
> Some adaptations are also needed. No longer use genl_info_pm_nl() because
> it doesn't accept a 'const' variable, but that's OK to get pernet via
> genl_info_net().
(...)
> --- a/net/mptcp/pm_netlink.c
> +++ b/net/mptcp/pm_netlink.c
> @@ -1763,12 +1763,15 @@ int mptcp_nl_fill_addr(struct sk_buff *skb,
> }
>
> int mptcp_pm_nl_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
> - struct genl_info *info)
> + const struct genl_info *info)
> {
> - struct pm_nl_pernet *pernet = genl_info_pm_nl(info);
> + struct net *net = genl_info_net(info);
> struct mptcp_pm_addr_entry *entry;
> + struct pm_nl_pernet *pernet;
> int ret = -EINVAL;
>
> + pernet = pm_nl_get_pernet(net);
A small detail if you have something anything to change: maybe the 'net'
variable is not needed, and instead of 3 lines, you can have it in 1:
struct pm_nl_pernet *pernet = pm_nl_get_pernet(genl_info_net(info));
> +
> rcu_read_lock();
> entry = __lookup_addr_by_id(pernet, id);
> if (entry) {
(...)
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH mptcp-next v2 7/8] mptcp: add mptcp_pm_addr_id_bitmap_t type
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
2025-01-09 4:15 ` Geliang Tang
0 siblings, 1 reply; 16+ messages in thread
From: Matthieu Baerts @ 2024-12-30 16:30 UTC (permalink / raw)
To: Geliang Tang, mptcp; +Cc: Geliang Tang
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.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH mptcp-next v2 8/8] mptcp: reuse sending nlmsg code in dump_addr
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
0 siblings, 0 replies; 16+ messages in thread
From: Matthieu Baerts @ 2024-12-30 16:33 UTC (permalink / raw)
To: Geliang Tang, mptcp; +Cc: Geliang Tang
Hi Geliang,
It looks like the code below only works if the dump can be done in one call.
I spent quite a bit of time looking at it, and at the end, I would like
to say it doesn't look like this modification is worth it: it increases
the complexity just to save a bit of duplicated code (which is used
differently). WDYT? Or do you really need this for the BPF PM?
Here below, you can find my review, but in short, I don't think we
should try to unify the code here. WDYT?
On 13/12/2024 08:35, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> With the help of get_addr(), we can modify dump_addr() interfaces
> to reuse send_nlmsg code between the netlink PM and userspace PM.
>
> The current dump_addr() flow looks like this:
>
> lock();
> for_each_entry(entry)
> send_nlmsg(entry);
> unlock();
>
> After holding the lock, get every entry by walking the address list,
> send each one looply, and finally release the lock.
>
> This set changes the process by copying the address list to an id
> bitmap while holding the lock, then release the lock immediately.
> After that, without locking, walking the copied id bitmap to get
> every copy of entry by using get_addr(), and send each one looply:
>
> lock();
> for_each_entry(entry)
> set_bit(bitmap);
> unlock();
>
> for_each_bit(bitmap) {
> copy = get_addr();
What you are hiding here is that there will be a lock again here for
each address: so we will lock and unlock once before, and once per
address... Maybe we don't care about that here, but is it really worth it?
> send_nlmsg(copy);
> }
>
> With this, we can reuse the send_nlmsg() code in dump_addr() interfaces
> between the netlink PM and userspace PM. They only need to implement
> their own dump_addr() interfaces to hold the different locks, copy the
> different address lists to an id bitmap, then release the locks.
>
> Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
> ---
> net/mptcp/pm.c | 43 ++++++++++++++++++++++++++++++++++++----
> net/mptcp/pm_netlink.c | 35 +++-----------------------------
> net/mptcp/pm_userspace.c | 41 ++++++++++++++------------------------
> net/mptcp/protocol.h | 6 ++----
> 4 files changed, 59 insertions(+), 66 deletions(-)
>
> diff --git a/net/mptcp/pm.c b/net/mptcp/pm.c
> index 0aaf16319c34..22c0ca77ca0d 100644
> --- a/net/mptcp/pm.c
> +++ b/net/mptcp/pm.c
> @@ -485,20 +485,55 @@ int mptcp_pm_nl_get_addr_doit(struct sk_buff *skb, struct genl_info *info)
> return ret;
> }
>
> -static int mptcp_pm_dump_addr(struct sk_buff *msg, struct netlink_callback *cb,
> +static int mptcp_pm_dump_addr(mptcp_pm_addr_id_bitmap_t *bitmap,
> const struct genl_info *info)
> {
> if (info->attrs[MPTCP_PM_ATTR_TOKEN])
> - return mptcp_userspace_pm_dump_addr(msg, cb, info);
> - return mptcp_pm_nl_dump_addr(msg, cb, info);
> + return mptcp_userspace_pm_dump_addr(bitmap, info);
> + return mptcp_pm_nl_dump_addr(bitmap, info);
> }
>
> int mptcp_pm_nl_get_addr_dumpit(struct sk_buff *msg,
> struct netlink_callback *cb)
> {
> const struct genl_info *info = genl_info_dump(cb);
> + mptcp_pm_addr_id_bitmap_t *bitmap;
> + struct mptcp_pm_addr_entry entry;
> + int id = cb->args[0];
> + void *hdr;
> + int i;
> +
> + bitmap = (mptcp_pm_addr_id_bitmap_t *)cb->ctx;
Mmh, that feels wrong: you are using cb->ctx and cb->args at the same
part, but they are part of an union. This will likely only work the
first time, not if dumpit() is called in multiple chunks, no?
For it to work, I guess you should only copy the bitmap the first time
(not sure what you can look at, reserve some bits in cb->ctx for that?),
then use __test_and_clear_bit() instead of test_bit(). But again, not
sure if it is really worth it, that makes things a bit more complex.
BTW, not related to ↑, but it might be safer to add a build check to
make sure sizeof(cb->ctx) >= sizeof(mptcp_pm_addr_id_bitmap_t), just in
case we change it later.
> +
> + mptcp_pm_dump_addr(bitmap, info);
Should you not only fill the bitmap the first time? I'm not sure if I
fully understand how it is used, but from what I see, the dump can be
done in multiple calls, hence the use of cb. Here this fill the bitmap
without taking into account what was done before.
> +
> + for (i = id; i < MPTCP_PM_MAX_ADDR_ID + 1; i++) {
> + if (test_bit(i, bitmap->map)) {
> + if (mptcp_pm_get_addr(i, &entry, info))
> + break;
I don't think you should "break" here, but "continue" instead:
potentially between the two calls, the address at this ID might have
been removed.
> +
> + if (id && entry.addr.id <= id)
Why is the condition different from before in pm_netlink.c? Why do you
need to explicitly skip id 0?
If I'm not mistaken, with the in-kernel PM, we cannot have ID 0 here,
but we can with the userspace PM, no?
> + 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)
> + break;
> +
> + if (mptcp_nl_fill_addr(msg, &entry) < 0) {
> + genlmsg_cancel(msg, hdr);
> + break;
> + }
> +
> + id = entry.addr.id;
> + genlmsg_end(msg, hdr);
> + }
> + }
>
> - return mptcp_pm_dump_addr(msg, cb, info);
> + cb->args[0] = id;
> + return msg->len;
> }
>
> static int mptcp_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
> diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
> index 0d826bfc4718..831c440d6cc5 100644
> --- a/net/mptcp/pm_netlink.c
> +++ b/net/mptcp/pm_netlink.c
> @@ -1783,48 +1783,19 @@ int mptcp_pm_nl_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
> return ret;
> }
>
> -int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
> - struct netlink_callback *cb,
> +int mptcp_pm_nl_dump_addr(mptcp_pm_addr_id_bitmap_t *bitmap,
> const struct genl_info *info)
> {
> struct net *net = genl_info_net(info);
> - 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);
>
> rcu_read_lock();
> - for (i = id; i < MPTCP_PM_MAX_ADDR_ID + 1; i++) {
> - if (test_bit(i, pernet->id_bitmap)) {
> - entry = __lookup_addr_by_id(pernet, i);
> - if (!entry)
> - break;
> -
> - 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)
> - break;
> -
> - if (mptcp_nl_fill_addr(msg, entry) < 0) {
> - genlmsg_cancel(msg, hdr);
> - break;
> - }
> -
> - id = entry->addr.id;
> - genlmsg_end(msg, hdr);
> - }
> - }
> + bitmap_copy(bitmap->map, pernet->id_bitmap, MPTCP_PM_MAX_ADDR_ID + 1);
> rcu_read_unlock();
"pernet->id_bitmap" is not protected by RCU, only the endpoints are
(linked to __lookup_addr_by_id()).
In other words, rcu_read_(un)lock() are no longer needed here.
It also means that potentially, we are changing the behaviour of the
dump when endpoints are being modified but:
— MPTCP netlink commands are processed one by one, so this should not
happen if I'm not mistaken.
— Even if the endpoints were being modified during a dump (maybe it can
if the endpoints cannot all fit in the buffer?), that's OK if it reports
the previous version of just updated info.
>
> - cb->args[0] = id;
> - return msg->len;
> + return 0;
> }
This helper no longer dump addresses any more, it only copies the
bitmap. Should it be eventually renamed?
> static int parse_limit(struct genl_info *info, int id, unsigned int *limit)
> diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
> index 0d9bea3a04a2..0db477b703a5 100644
> --- a/net/mptcp/pm_userspace.c
> +++ b/net/mptcp/pm_userspace.c
> @@ -614,18 +614,25 @@ int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
> return ret;
> }
>
> -int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
> - struct netlink_callback *cb,
> - const struct genl_info *info)
> +static int mptcp_userspace_pm_reset_bitmap(struct mptcp_sock *msk,
> + mptcp_pm_addr_id_bitmap_t *bitmap)
> {
> - mptcp_pm_addr_id_bitmap_t *bitmap;
> struct mptcp_pm_addr_entry *entry;
> +
> + bitmap_zero(bitmap->map, MPTCP_PM_MAX_ADDR_ID + 1);
> +
> + mptcp_for_each_userspace_pm_addr(msk, entry)
> + __set_bit(entry->addr.id, bitmap->map);
> +
> + return 0;
> +}
> +
> +int mptcp_userspace_pm_dump_addr(mptcp_pm_addr_id_bitmap_t *bitmap,
> + const struct genl_info *info)
> +{
> struct mptcp_sock *msk;
> int ret = -EINVAL;
> struct sock *sk;
> - void *hdr;
> -
> - bitmap = (mptcp_pm_addr_id_bitmap_t *)cb->ctx;
>
> msk = mptcp_userspace_pm_get_sock(info);
> if (!msk)
> @@ -635,27 +642,9 @@ int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
>
> lock_sock(sk);
> spin_lock_bh(&msk->pm.lock);
> - mptcp_for_each_userspace_pm_addr(msk, entry) {
> - 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)
> - 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);
> - }
> + ret = mptcp_userspace_pm_reset_bitmap(msk, bitmap);
Mmh, I don't understand this. If I'm not mistaken, before, we were using
a bitmap because in case the dump had to be done in multiple parts, we
required a way to mark which IDs had already been dumped.
But here, with your modification, you fill all the bitmap like we would
be able to dump everything in one go: the bitmap is written with all
entries, and reset each time we need to "dump the rest". So at the end,
we no longer remember what was done in the previous parts, and we would
dump the same thing over and over, no?
> spin_unlock_bh(&msk->pm.lock);
> release_sock(sk);
> - ret = msg->len;
>
> sock_put(sk);
> return ret;
> diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
> index da2cf524c5da..ed629320ba56 100644
> --- a/net/mptcp/protocol.h
> +++ b/net/mptcp/protocol.h
> @@ -1124,11 +1124,9 @@ int mptcp_userspace_pm_get_local_id(struct mptcp_sock *msk, struct mptcp_addr_in
> 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);
> -int mptcp_pm_nl_dump_addr(struct sk_buff *msg,
> - struct netlink_callback *cb,
> +int mptcp_pm_nl_dump_addr(mptcp_pm_addr_id_bitmap_t *bitmap,
> const struct genl_info *info);
> -int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
> - struct netlink_callback *cb,
> +int mptcp_userspace_pm_dump_addr(mptcp_pm_addr_id_bitmap_t *bitmap,
> const struct genl_info *info);
> int mptcp_pm_nl_get_addr(u8 id, struct mptcp_pm_addr_entry *addr,
> const struct genl_info *info);
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH mptcp-next v2 7/8] mptcp: add mptcp_pm_addr_id_bitmap_t type
2024-12-30 16:30 ` Matthieu Baerts
@ 2025-01-09 4:15 ` Geliang Tang
2025-01-09 15:37 ` Matthieu Baerts
0 siblings, 1 reply; 16+ messages in thread
From: Geliang Tang @ 2025-01-09 4:15 UTC (permalink / raw)
To: Matthieu Baerts, mptcp; +Cc: Geliang Tang
Hi Matt,
On Mon, 2024-12-30 at 17:30 +0100, Matthieu Baerts wrote:
> 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
> > A. > > 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?
Yes, it's for the BPF PM. If we define a struct mptcp_pm_addr_id_bitmap
as in the previous version [1], we can indeed put it in protocol.h:
struct mptcp_pm_addr_id_bitmap {
DECLARE_BITMAP(map, MPTCP_PM_MAX_ADDR_ID + 1);
};
and just declare it in include/net/mptcp.h:
struct mptcp_pm_addr_id_bitmap;
But as your comments in [1], 'why do you need a
specific structure with only one field?'
This new version uses 'typedef' to define a new type, similar to
nodemask_t, dma_cap_mask_t and cpumask_t. I think this is a good way to
handle structures with only one field. But on the other hand, we can't
declare a 'mptcp_pm_addr_id_bitmap_t' in include/net/mptcp.h, we need
to move the entire typedef to include/net/mptcp.h, and the
corresponding MPTCP_PM_MAX_ADDR_ID also needs to be moved together.
Which one do you prefer, mptcp_pm_addr_id_bitmap_t or struct
mptcp_pm_addr_id_bitmap? I will use it in the next version.
Thanks,
-Geliang
[1]https://patchwork.kernel.org/project/mptcp/patch/344964d66ab0250ae027ffd46a0e6782d572c33d.1729588019.git.tanggeliang@kylinos.cn/
>
> 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
^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH mptcp-next v2 7/8] mptcp: add mptcp_pm_addr_id_bitmap_t type
2025-01-09 4:15 ` Geliang Tang
@ 2025-01-09 15:37 ` Matthieu Baerts
0 siblings, 0 replies; 16+ messages in thread
From: Matthieu Baerts @ 2025-01-09 15:37 UTC (permalink / raw)
To: Geliang Tang, mptcp; +Cc: Geliang Tang
Hi Geliang,
On 09/01/2025 05:15, Geliang Tang wrote:
> Hi Matt,
>
> On Mon, 2024-12-30 at 17:30 +0100, Matthieu Baerts wrote:
>> 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
>>> A. > > 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?
>
> Yes, it's for the BPF PM. If we define a struct mptcp_pm_addr_id_bitmap
> as in the previous version [1], we can indeed put it in protocol.h:
>
> struct mptcp_pm_addr_id_bitmap {
> DECLARE_BITMAP(map, MPTCP_PM_MAX_ADDR_ID + 1);
> };
>
> and just declare it in include/net/mptcp.h:
>
> struct mptcp_pm_addr_id_bitmap;
>
> But as your comments in [1], 'why do you need a
> specific structure with only one field?'
>
> This new version uses 'typedef' to define a new type, similar to
> nodemask_t, dma_cap_mask_t and cpumask_t. I think this is a good way to
> handle structures with only one field. But on the other hand, we can't
> declare a 'mptcp_pm_addr_id_bitmap_t' in include/net/mptcp.h, we need
> to move the entire typedef to include/net/mptcp.h, and the
> corresponding MPTCP_PM_MAX_ADDR_ID also needs to be moved together.
>
> Which one do you prefer, mptcp_pm_addr_id_bitmap_t or struct
> mptcp_pm_addr_id_bitmap? I will use it in the next version.
My question was more to know why BPF is not happy if the struct or
typedef is declared in net/mptcp/protocol.h instead of include/net/mptcp.h.
If really it has to be declared in 'include', then maybe better to add
the minimum (struct mptcp_pm_addr_id_bitmap;) and the typedef in protocol.h.
>> 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?
Regarding these two questions: why do you need the bitmap? If I'm not
mistaken, the BPF PM doesn't need to implement the 'dump' and 'get_addr'
interfaces: no need to expose this to userspace via netlink if the PM is
handled in kernelspace with BPF, no?
A BPF PM can expose what it wants via BPF.
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2025-01-09 15:37 UTC | newest]
Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox