* [PATCH mptcp-next v8 1/8] mptcp: drop info of userspace_pm_remove_id_zero_address
2025-01-08 1:44 [PATCH mptcp-next v8 0/8] mptcp: use GENL_REQ_ATTR_CHECK in userspace pm Geliang Tang
@ 2025-01-08 1:44 ` Geliang Tang
2025-01-08 1:44 ` [PATCH mptcp-next v8 2/8] mptcp: pm: userspace: flags: clearer msg if no remote addr Geliang Tang
` (8 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: Geliang Tang @ 2025-01-08 1:44 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang
From: Geliang Tang <tanggeliang@kylinos.cn>
The only use of 'info' parameter of userspace_pm_remove_id_zero_address()
is to set an error message into it.
Plus, this helper will only fail when it cannot find any subflows with a
local address ID 0.
This patch drops this parameter and sets the error message where this
function is called in mptcp_pm_nl_remove_doit().
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
---
net/mptcp/pm_userspace.c | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index a3d477059b11..4de38bc03ab8 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -253,8 +253,7 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info)
return err;
}
-static int mptcp_userspace_pm_remove_id_zero_address(struct mptcp_sock *msk,
- struct genl_info *info)
+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;
@@ -269,10 +268,8 @@ static int mptcp_userspace_pm_remove_id_zero_address(struct mptcp_sock *msk,
break;
}
}
- if (!has_id_0) {
- GENL_SET_ERR_MSG(info, "address with id 0 not found");
+ if (!has_id_0)
goto remove_err;
- }
list.ids[list.nr++] = 0;
@@ -330,7 +327,7 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info)
sk = (struct sock *)msk;
if (id_val == 0) {
- err = mptcp_userspace_pm_remove_id_zero_address(msk, info);
+ err = mptcp_userspace_pm_remove_id_zero_address(msk);
goto out;
}
@@ -339,7 +336,6 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info)
spin_lock_bh(&msk->pm.lock);
match = mptcp_userspace_pm_lookup_addr_by_id(msk, id_val);
if (!match) {
- GENL_SET_ERR_MSG(info, "address with specified id not found");
spin_unlock_bh(&msk->pm.lock);
release_sock(sk);
goto out;
@@ -356,6 +352,11 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info)
err = 0;
out:
+ if (err)
+ GENL_SET_ERR_MSG_FMT(info,
+ "address with id %u not found",
+ id_val);
+
sock_put(sk);
return err;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH mptcp-next v8 2/8] mptcp: pm: userspace: flags: clearer msg if no remote addr
2025-01-08 1:44 [PATCH mptcp-next v8 0/8] mptcp: use GENL_REQ_ATTR_CHECK in userspace pm Geliang Tang
2025-01-08 1:44 ` [PATCH mptcp-next v8 1/8] mptcp: drop info of userspace_pm_remove_id_zero_address Geliang Tang
@ 2025-01-08 1:44 ` Geliang Tang
2025-01-08 1:44 ` [PATCH mptcp-next v8 3/8] mptcp: pm: more precise error messages Geliang Tang
` (7 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: Geliang Tang @ 2025-01-08 1:44 UTC (permalink / raw)
To: mptcp; +Cc: Matthieu Baerts (NGI0)
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Since its introduction in commit 892f396c8e68 ("mptcp: netlink: issue
MP_PRIO signals from userspace PMs"), it was mandatory to specify the
remote address, because of the 'if (rem->addr.family == AF_UNSPEC)'
check done later one.
In theory, this attribute can be optional, but it sounds better to be
precise to avoid sending the MP_PRIO on the wrong subflow, e.g. if there
are multiple subflows attached to the same local ID. This can be relaxed
later on if there is a need to act on multiple subflows with one
command.
For the moment, the check to see if attr_rem is NULL can be removed,
because mptcp_pm_parse_entry() will do this check as well, no need to do
that differently here.
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/pm_userspace.c | 8 +++-----
1 file changed, 3 insertions(+), 5 deletions(-)
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index 4de38bc03ab8..b6cf8ea1161d 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -580,11 +580,9 @@ int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
if (ret < 0)
goto set_flags_err;
- if (attr_rem) {
- ret = mptcp_pm_parse_entry(attr_rem, info, false, &rem);
- if (ret < 0)
- goto set_flags_err;
- }
+ ret = mptcp_pm_parse_entry(attr_rem, info, false, &rem);
+ if (ret < 0)
+ goto set_flags_err;
if (loc.addr.family == AF_UNSPEC ||
rem.addr.family == AF_UNSPEC) {
--
2.45.2
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH mptcp-next v8 3/8] mptcp: pm: more precise error messages
2025-01-08 1:44 [PATCH mptcp-next v8 0/8] mptcp: use GENL_REQ_ATTR_CHECK in userspace pm Geliang Tang
2025-01-08 1:44 ` [PATCH mptcp-next v8 1/8] mptcp: drop info of userspace_pm_remove_id_zero_address Geliang Tang
2025-01-08 1:44 ` [PATCH mptcp-next v8 2/8] mptcp: pm: userspace: flags: clearer msg if no remote addr Geliang Tang
@ 2025-01-08 1:44 ` Geliang Tang
2025-01-08 1:44 ` [PATCH mptcp-next v8 4/8] mptcp: pm: improve " Geliang Tang
` (6 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: Geliang Tang @ 2025-01-08 1:44 UTC (permalink / raw)
To: mptcp; +Cc: Matthieu Baerts (NGI0)
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Some errors reported by the userspace PM were vague: "this or that is
invalid".
It is easier for the userspace to know which part is wrong, instead of
having to guess that.
By splitting some error messages, NL_SET_ERR_MSG_ATTR() can be used
instead of GENL_SET_ERR_MSG() in order to give an additional hint to the
userspace developers about which attribute is wrong.
While at it, in mptcp_userspace_pm_set_flags() move the parsing after
the check linked to the local attribute.
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/pm_userspace.c | 33 ++++++++++++++++++++++++++-------
1 file changed, 26 insertions(+), 7 deletions(-)
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index b6cf8ea1161d..2cb42091bd08 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -223,8 +223,14 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info)
goto announce_err;
}
- if (addr_val.addr.id == 0 || !(addr_val.flags & MPTCP_PM_ADDR_FLAG_SIGNAL)) {
- GENL_SET_ERR_MSG(info, "invalid addr id or flags");
+ if (addr_val.addr.id == 0) {
+ NL_SET_ERR_MSG_ATTR(info->extack, addr, "invalid addr id");
+ err = -EINVAL;
+ goto announce_err;
+ }
+
+ if (!(addr_val.flags & MPTCP_PM_ADDR_FLAG_SIGNAL)) {
+ NL_SET_ERR_MSG_ATTR(info->extack, addr, "invalid addr flags");
err = -EINVAL;
goto announce_err;
}
@@ -531,8 +537,14 @@ int mptcp_pm_nl_subflow_destroy_doit(struct sk_buff *skb, struct genl_info *info
goto destroy_err;
}
- if (!addr_l.addr.port || !addr_r.port) {
- GENL_SET_ERR_MSG(info, "missing local or remote port");
+ if (!addr_l.addr.port) {
+ NL_SET_ERR_MSG_ATTR(info->extack, laddr, "missing local port");
+ err = -EINVAL;
+ goto destroy_err;
+ }
+
+ if (!addr_r.port) {
+ NL_SET_ERR_MSG_ATTR(info->extack, raddr, "missing remote port");
err = -EINVAL;
goto destroy_err;
}
@@ -580,13 +592,20 @@ int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
if (ret < 0)
goto set_flags_err;
+ if (loc.addr.family == AF_UNSPEC) {
+ NL_SET_ERR_MSG_ATTR(info->extack, attr,
+ "invalid local address family");
+ ret = -EINVAL;
+ goto set_flags_err;
+ }
+
ret = mptcp_pm_parse_entry(attr_rem, info, false, &rem);
if (ret < 0)
goto set_flags_err;
- if (loc.addr.family == AF_UNSPEC ||
- rem.addr.family == AF_UNSPEC) {
- GENL_SET_ERR_MSG(info, "invalid address families");
+ if (rem.addr.family == AF_UNSPEC) {
+ NL_SET_ERR_MSG_ATTR(info->extack, attr_rem,
+ "invalid remote address family");
ret = -EINVAL;
goto set_flags_err;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH mptcp-next v8 4/8] mptcp: pm: improve error messages
2025-01-08 1:44 [PATCH mptcp-next v8 0/8] mptcp: use GENL_REQ_ATTR_CHECK in userspace pm Geliang Tang
` (2 preceding siblings ...)
2025-01-08 1:44 ` [PATCH mptcp-next v8 3/8] mptcp: pm: more precise error messages Geliang Tang
@ 2025-01-08 1:44 ` Geliang Tang
2025-01-09 15:23 ` Matthieu Baerts
2025-01-08 1:44 ` [PATCH mptcp-next v8 5/8] mptcp: pm: userspace: use GENL_REQ_ATTR_CHECK Geliang Tang
` (5 subsequent siblings)
9 siblings, 1 reply; 14+ messages in thread
From: Geliang Tang @ 2025-01-08 1:44 UTC (permalink / raw)
To: mptcp; +Cc: Matthieu Baerts (NGI0)
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Some error messages were:
- too generic: "missing input", "invalid request"
- not precise enough: "limit greater than maximum" but what's the max?
- missing: subflow not found, or connect error.
This can be easily improved by being more precise, or adding new error
messages.
v2: add a comment in mptcp_userspace_pm_set_flags().
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/pm_netlink.c | 6 ++++--
net/mptcp/pm_userspace.c | 10 +++++++++-
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index 98ac73938bd8..a60217faf95d 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1875,7 +1875,9 @@ static int parse_limit(struct genl_info *info, int id, unsigned int *limit)
*limit = nla_get_u32(attr);
if (*limit > MPTCP_PM_ADDR_MAX) {
- GENL_SET_ERR_MSG(info, "limit greater than maximum");
+ NL_SET_ERR_MSG_ATTR_FMT(info->extack, attr,
+ "limit greater than maximum (%u)",
+ MPTCP_PM_ADDR_MAX);
return -EINVAL;
}
return 0;
@@ -2003,7 +2005,7 @@ int mptcp_pm_nl_set_flags(struct sk_buff *skb, struct genl_info *info)
if (addr.addr.family == AF_UNSPEC) {
lookup_by_id = 1;
if (!addr.addr.id) {
- GENL_SET_ERR_MSG(info, "missing required inputs");
+ GENL_SET_ERR_MSG(info, "missing address ID");
return -EOPNOTSUPP;
}
}
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index 2cb42091bd08..f5372e0a0dd9 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -190,7 +190,7 @@ static struct mptcp_sock *mptcp_userspace_pm_get_sock(const struct genl_info *in
}
if (!mptcp_pm_is_userspace(msk)) {
- GENL_SET_ERR_MSG(info, "invalid request; userspace PM not selected");
+ GENL_SET_ERR_MSG(info, "userspace PM not selected");
sock_put((struct sock *)msk);
return NULL;
}
@@ -428,6 +428,9 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
err = __mptcp_subflow_connect(sk, &local, &addr_r);
release_sock(sk);
+ if (err)
+ GENL_SET_ERR_MSG_FMT(info, "connect error: %d", err);
+
spin_lock_bh(&msk->pm.lock);
if (err)
mptcp_userspace_pm_delete_local_addr(msk, &entry);
@@ -552,6 +555,7 @@ int mptcp_pm_nl_subflow_destroy_doit(struct sk_buff *skb, struct genl_info *info
lock_sock(sk);
ssk = mptcp_nl_find_ssk(msk, &addr_l.addr, &addr_r);
if (!ssk) {
+ GENL_SET_ERR_MSG(info, "subflow not found");
err = -ESRCH;
goto release_sock;
}
@@ -627,6 +631,10 @@ int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
ret = mptcp_pm_nl_mp_prio_send_ack(msk, &loc.addr, &rem.addr, bkup);
release_sock(sk);
+ /* mptcp_pm_nl_mp_prio_send_ack() only fails in one case */
+ if (ret < 0)
+ GENL_SET_ERR_MSG(info, "subflow not found");
+
set_flags_err:
sock_put(sk);
return ret;
--
2.45.2
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH mptcp-next v8 4/8] mptcp: pm: improve error messages
2025-01-08 1:44 ` [PATCH mptcp-next v8 4/8] mptcp: pm: improve " Geliang Tang
@ 2025-01-09 15:23 ` Matthieu Baerts
0 siblings, 0 replies; 14+ messages in thread
From: Matthieu Baerts @ 2025-01-09 15:23 UTC (permalink / raw)
To: Geliang Tang, mptcp
Hi Geliang,
On 08/01/2025 02:44, Geliang Tang wrote:
> From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
>
> Some error messages were:
>
> - too generic: "missing input", "invalid request"
>
> - not precise enough: "limit greater than maximum" but what's the max?
>
> - missing: subflow not found, or connect error.
>
> This can be easily improved by being more precise, or adding new error
> messages.
>
> v2: add a comment in mptcp_userspace_pm_set_flags().
Thank you for this in-line comment, I find it very helpful for the
reviewers compared to a global one in the cover-letter where we don't
know exactly which patch has been modified.
Just one thing: can you move this changelog comment below the last SoB,
under a line with '---'? ...
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
... so here:
---
- v2: (...)
(or you can also use 'git notes edit' and the '--notes' option with
'send-email' or 'format-patch'. If you use it for the first time, you
will need to set 'notes.rewriteRef' config not to lose notes after a
rebase, see: https://stackoverflow.com/a/14601464)
Same in patch 7/8 and 8/8.
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH mptcp-next v8 5/8] mptcp: pm: userspace: use GENL_REQ_ATTR_CHECK
2025-01-08 1:44 [PATCH mptcp-next v8 0/8] mptcp: use GENL_REQ_ATTR_CHECK in userspace pm Geliang Tang
` (3 preceding siblings ...)
2025-01-08 1:44 ` [PATCH mptcp-next v8 4/8] mptcp: pm: improve " Geliang Tang
@ 2025-01-08 1:44 ` Geliang Tang
2025-01-09 15:24 ` Matthieu Baerts
2025-01-08 1:44 ` [PATCH mptcp-next v8 6/8] mptcp: pm: remove duplicated error messages Geliang Tang
` (4 subsequent siblings)
9 siblings, 1 reply; 14+ messages in thread
From: Geliang Tang @ 2025-01-08 1:44 UTC (permalink / raw)
To: mptcp; +Cc: Geliang Tang, Jakub Kicinski, Matthieu Baerts
From: Geliang Tang <tanggeliang@kylinos.cn>
A more general way to check if MPTCP_PM_ATTR_* exists in 'info'
is to use GENL_REQ_ATTR_CHECK(info, MPTCP_PM_ATTR_*) instead of
directly reading info->attrs[MPTCP_PM_ATTR_*] and then checking
if it's NULL.
So this patch uses GENL_REQ_ATTR_CHECK() for userspace PM in
mptcp_pm_nl_announce_doit(), mptcp_pm_nl_remove_doit(),
mptcp_pm_nl_subflow_create_doit(), mptcp_pm_nl_subflow_destroy_doit()
and mptcp_userspace_pm_get_sock().
Suggested-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/pm_userspace.c | 41 +++++++++++++++++++---------------------
1 file changed, 19 insertions(+), 22 deletions(-)
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index f5372e0a0dd9..90272cd99f7b 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -175,14 +175,13 @@ bool mptcp_userspace_pm_is_backup(struct mptcp_sock *msk,
static struct mptcp_sock *mptcp_userspace_pm_get_sock(const struct genl_info *info)
{
- struct nlattr *token = info->attrs[MPTCP_PM_ATTR_TOKEN];
struct mptcp_sock *msk;
+ struct nlattr *token;
- if (!token) {
- GENL_SET_ERR_MSG(info, "missing required token");
+ if (GENL_REQ_ATTR_CHECK(info, MPTCP_PM_ATTR_TOKEN))
return NULL;
- }
+ token = info->attrs[MPTCP_PM_ATTR_TOKEN];
msk = mptcp_token_get_sock(genl_info_net(info), nla_get_u32(token));
if (!msk) {
NL_SET_ERR_MSG_ATTR(info->extack, token, "invalid token");
@@ -200,16 +199,14 @@ static struct mptcp_sock *mptcp_userspace_pm_get_sock(const struct genl_info *in
int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info)
{
- struct nlattr *addr = info->attrs[MPTCP_PM_ATTR_ADDR];
struct mptcp_pm_addr_entry addr_val;
struct mptcp_sock *msk;
+ struct nlattr *addr;
int err = -EINVAL;
struct sock *sk;
- if (!addr) {
- GENL_SET_ERR_MSG(info, "missing required address");
+ if (GENL_REQ_ATTR_CHECK(info, MPTCP_PM_ATTR_ADDR))
return err;
- }
msk = mptcp_userspace_pm_get_sock(info);
if (!msk)
@@ -217,6 +214,7 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info)
sk = (struct sock *)msk;
+ addr = info->attrs[MPTCP_PM_ATTR_ADDR];
err = mptcp_pm_parse_entry(addr, info, true, &addr_val);
if (err < 0) {
GENL_SET_ERR_MSG(info, "error parsing local address");
@@ -312,18 +310,17 @@ void mptcp_pm_remove_addr_entry(struct mptcp_sock *msk,
int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info)
{
- struct nlattr *id = info->attrs[MPTCP_PM_ATTR_LOC_ID];
struct mptcp_pm_addr_entry *match;
struct mptcp_sock *msk;
+ struct nlattr *id;
int err = -EINVAL;
struct sock *sk;
u8 id_val;
- if (!id) {
- GENL_SET_ERR_MSG(info, "missing required ID");
+ if (GENL_REQ_ATTR_CHECK(info, MPTCP_PM_ATTR_LOC_ID))
return err;
- }
+ id = info->attrs[MPTCP_PM_ATTR_LOC_ID];
id_val = nla_get_u8(id);
msk = mptcp_userspace_pm_get_sock(info);
@@ -369,19 +366,17 @@ int mptcp_pm_nl_remove_doit(struct sk_buff *skb, struct genl_info *info)
int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
{
- struct nlattr *raddr = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
- struct nlattr *laddr = info->attrs[MPTCP_PM_ATTR_ADDR];
struct mptcp_pm_addr_entry entry = { 0 };
struct mptcp_addr_info addr_r;
+ struct nlattr *raddr, *laddr;
struct mptcp_pm_local local;
struct mptcp_sock *msk;
int err = -EINVAL;
struct sock *sk;
- if (!laddr || !raddr) {
- GENL_SET_ERR_MSG(info, "missing required address(es)");
+ if (GENL_REQ_ATTR_CHECK(info, MPTCP_PM_ATTR_ADDR) ||
+ GENL_REQ_ATTR_CHECK(info, MPTCP_PM_ATTR_ADDR_REMOTE))
return err;
- }
msk = mptcp_userspace_pm_get_sock(info);
if (!msk)
@@ -389,6 +384,7 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
sk = (struct sock *)msk;
+ laddr = info->attrs[MPTCP_PM_ATTR_ADDR];
err = mptcp_pm_parse_entry(laddr, info, true, &entry);
if (err < 0) {
NL_SET_ERR_MSG_ATTR(info->extack, laddr, "error parsing local addr");
@@ -402,6 +398,7 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
}
entry.flags |= MPTCP_PM_ADDR_FLAG_SUBFLOW;
+ raddr = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
err = mptcp_pm_parse_addr(raddr, info, &addr_r);
if (err < 0) {
NL_SET_ERR_MSG_ATTR(info->extack, raddr, "error parsing remote addr");
@@ -493,18 +490,16 @@ static struct sock *mptcp_nl_find_ssk(struct mptcp_sock *msk,
int mptcp_pm_nl_subflow_destroy_doit(struct sk_buff *skb, struct genl_info *info)
{
- struct nlattr *raddr = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
- struct nlattr *laddr = info->attrs[MPTCP_PM_ATTR_ADDR];
struct mptcp_pm_addr_entry addr_l;
struct mptcp_addr_info addr_r;
+ struct nlattr *raddr, *laddr;
struct mptcp_sock *msk;
struct sock *sk, *ssk;
int err = -EINVAL;
- if (!laddr || !raddr) {
- GENL_SET_ERR_MSG(info, "missing required address(es)");
+ if (GENL_REQ_ATTR_CHECK(info, MPTCP_PM_ATTR_ADDR) ||
+ GENL_REQ_ATTR_CHECK(info, MPTCP_PM_ATTR_ADDR_REMOTE))
return err;
- }
msk = mptcp_userspace_pm_get_sock(info);
if (!msk)
@@ -512,12 +507,14 @@ int mptcp_pm_nl_subflow_destroy_doit(struct sk_buff *skb, struct genl_info *info
sk = (struct sock *)msk;
+ laddr = info->attrs[MPTCP_PM_ATTR_ADDR];
err = mptcp_pm_parse_entry(laddr, info, true, &addr_l);
if (err < 0) {
NL_SET_ERR_MSG_ATTR(info->extack, laddr, "error parsing local addr");
goto destroy_err;
}
+ raddr = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
err = mptcp_pm_parse_addr(raddr, info, &addr_r);
if (err < 0) {
NL_SET_ERR_MSG_ATTR(info->extack, raddr, "error parsing remote addr");
--
2.45.2
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH mptcp-next v8 5/8] mptcp: pm: userspace: use GENL_REQ_ATTR_CHECK
2025-01-08 1:44 ` [PATCH mptcp-next v8 5/8] mptcp: pm: userspace: use GENL_REQ_ATTR_CHECK Geliang Tang
@ 2025-01-09 15:24 ` Matthieu Baerts
0 siblings, 0 replies; 14+ messages in thread
From: Matthieu Baerts @ 2025-01-09 15:24 UTC (permalink / raw)
To: Geliang Tang, mptcp; +Cc: Geliang Tang
Hi Geliang,
-Cc Jakub
On 08/01/2025 02:44, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> A more general way to check if MPTCP_PM_ATTR_* exists in 'info'
> is to use GENL_REQ_ATTR_CHECK(info, MPTCP_PM_ATTR_*) instead of
> directly reading info->attrs[MPTCP_PM_ATTR_*] and then checking
> if it's NULL.
>
> So this patch uses GENL_REQ_ATTR_CHECK() for userspace PM in
> mptcp_pm_nl_announce_doit(), mptcp_pm_nl_remove_doit(),
> mptcp_pm_nl_subflow_create_doit(), mptcp_pm_nl_subflow_destroy_doit()
> and mptcp_userspace_pm_get_sock().
>
> Suggested-by: Jakub Kicinski <kuba@kernel.org>
Please use 'git send-email' with '--suppress-cc=misc-by' or '=all' or
equivalent not to Cc Jakub for WIP patches.
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH mptcp-next v8 6/8] mptcp: pm: remove duplicated error messages
2025-01-08 1:44 [PATCH mptcp-next v8 0/8] mptcp: use GENL_REQ_ATTR_CHECK in userspace pm Geliang Tang
` (4 preceding siblings ...)
2025-01-08 1:44 ` [PATCH mptcp-next v8 5/8] mptcp: pm: userspace: use GENL_REQ_ATTR_CHECK Geliang Tang
@ 2025-01-08 1:44 ` Geliang Tang
2025-01-08 1:44 ` [PATCH mptcp-next v8 7/8] mptcp: pm: mark missing address attributes Geliang Tang
` (3 subsequent siblings)
9 siblings, 0 replies; 14+ messages in thread
From: Geliang Tang @ 2025-01-08 1:44 UTC (permalink / raw)
To: mptcp; +Cc: Matthieu Baerts (NGI0)
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
mptcp_pm_parse_entry() and mptcp_pm_parse_addr() will already set a
error message in case of parsing issue.
Then, no need to override this error message with another less precise
one: "error parsing address".
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/pm_userspace.c | 20 +++++---------------
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index 90272cd99f7b..7c6b1241664a 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -216,10 +216,8 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info)
addr = info->attrs[MPTCP_PM_ATTR_ADDR];
err = mptcp_pm_parse_entry(addr, info, true, &addr_val);
- if (err < 0) {
- GENL_SET_ERR_MSG(info, "error parsing local address");
+ if (err < 0)
goto announce_err;
- }
if (addr_val.addr.id == 0) {
NL_SET_ERR_MSG_ATTR(info->extack, addr, "invalid addr id");
@@ -386,10 +384,8 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
laddr = info->attrs[MPTCP_PM_ATTR_ADDR];
err = mptcp_pm_parse_entry(laddr, info, true, &entry);
- if (err < 0) {
- NL_SET_ERR_MSG_ATTR(info->extack, laddr, "error parsing local addr");
+ if (err < 0)
goto create_err;
- }
if (entry.flags & MPTCP_PM_ADDR_FLAG_SIGNAL) {
GENL_SET_ERR_MSG(info, "invalid addr flags");
@@ -400,10 +396,8 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
raddr = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
err = mptcp_pm_parse_addr(raddr, info, &addr_r);
- if (err < 0) {
- NL_SET_ERR_MSG_ATTR(info->extack, raddr, "error parsing remote addr");
+ if (err < 0)
goto create_err;
- }
if (!mptcp_pm_addr_families_match(sk, &entry.addr, &addr_r)) {
GENL_SET_ERR_MSG(info, "families mismatch");
@@ -509,17 +503,13 @@ int mptcp_pm_nl_subflow_destroy_doit(struct sk_buff *skb, struct genl_info *info
laddr = info->attrs[MPTCP_PM_ATTR_ADDR];
err = mptcp_pm_parse_entry(laddr, info, true, &addr_l);
- if (err < 0) {
- NL_SET_ERR_MSG_ATTR(info->extack, laddr, "error parsing local addr");
+ if (err < 0)
goto destroy_err;
- }
raddr = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
err = mptcp_pm_parse_addr(raddr, info, &addr_r);
- if (err < 0) {
- NL_SET_ERR_MSG_ATTR(info->extack, raddr, "error parsing remote addr");
+ if (err < 0)
goto destroy_err;
- }
#if IS_ENABLED(CONFIG_MPTCP_IPV6)
if (addr_l.addr.family == AF_INET && ipv6_addr_v4mapped(&addr_r.addr6)) {
--
2.45.2
^ permalink raw reply related [flat|nested] 14+ messages in thread* [PATCH mptcp-next v8 7/8] mptcp: pm: mark missing address attributes
2025-01-08 1:44 [PATCH mptcp-next v8 0/8] mptcp: use GENL_REQ_ATTR_CHECK in userspace pm Geliang Tang
` (5 preceding siblings ...)
2025-01-08 1:44 ` [PATCH mptcp-next v8 6/8] mptcp: pm: remove duplicated error messages Geliang Tang
@ 2025-01-08 1:44 ` Geliang Tang
2025-01-09 15:24 ` Matthieu Baerts
2025-01-08 1:44 ` [PATCH mptcp-next v8 8/8] mptcp: pm: use NL_SET_ERR_MSG_ATTR when possible Geliang Tang
` (2 subsequent siblings)
9 siblings, 1 reply; 14+ messages in thread
From: Geliang Tang @ 2025-01-08 1:44 UTC (permalink / raw)
To: mptcp; +Cc: Matthieu Baerts (NGI0)
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
mptcp_pm_parse_entry() will check if the given attribute is defined. If
not, it will return a generic error: "missing address info".
It might then not be clear for the userspace developer which attribute
is missing, especially when the command takes multiple addresses.
By using GENL_REQ_ATTR_CHECK(), the userspace will get a hint about
which attribute is missing, making thing clearer. Note that this is what
was already done for most of the other MPTCP NL commands, this patch
simply adds the missing ones.
v2:
- keep "pernet = pm_nl_get_pernet(net);" at the beginning of
mptcp_pm_nl_set_flags().
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/pm_netlink.c | 24 ++++++++++++++++++++----
net/mptcp/pm_userspace.c | 15 ++++++++++++---
2 files changed, 32 insertions(+), 7 deletions(-)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index a60217faf95d..adef7f12914b 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1393,11 +1393,15 @@ static bool mptcp_pm_has_addr_attr_id(const struct nlattr *attr,
int mptcp_pm_nl_add_addr_doit(struct sk_buff *skb, 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 nlattr *attr;
int ret;
+ 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, true, &addr);
if (ret < 0)
return ret;
@@ -1587,12 +1591,16 @@ static int mptcp_nl_remove_id_zero_address(struct net *net,
int mptcp_pm_nl_del_addr_doit(struct sk_buff *skb, 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;
unsigned int addr_max;
+ struct nlattr *attr;
int ret;
+ 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);
if (ret < 0)
return ret;
@@ -1764,13 +1772,17 @@ int mptcp_nl_fill_addr(struct sk_buff *skb,
int mptcp_pm_nl_get_addr(struct sk_buff *skb, 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 sk_buff *msg;
+ struct nlattr *attr;
void *reply;
int ret;
+ 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);
if (ret < 0)
return ret;
@@ -1986,18 +1998,22 @@ static int mptcp_nl_set_flags(struct net *net,
int mptcp_pm_nl_set_flags(struct sk_buff *skb, struct genl_info *info)
{
struct mptcp_pm_addr_entry addr = { .addr = { .family = AF_UNSPEC }, };
- struct nlattr *attr = info->attrs[MPTCP_PM_ATTR_ADDR];
u8 changed, mask = MPTCP_PM_ADDR_FLAG_BACKUP |
MPTCP_PM_ADDR_FLAG_FULLMESH;
struct net *net = sock_net(skb->sk);
struct mptcp_pm_addr_entry *entry;
struct pm_nl_pernet *pernet;
+ struct nlattr *attr;
u8 lookup_by_id = 0;
u8 bkup = 0;
int ret;
pernet = pm_nl_get_pernet(net);
+ if (GENL_REQ_ATTR_CHECK(info, MPTCP_PM_ATTR_ADDR))
+ return -EINVAL;
+
+ attr = info->attrs[MPTCP_PM_ATTR_ADDR];
ret = mptcp_pm_parse_entry(attr, info, false, &addr);
if (ret < 0)
return ret;
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index 7c6b1241664a..1876b3b2cb2d 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -565,20 +565,24 @@ int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
{
struct mptcp_pm_addr_entry loc = { .addr = { .family = AF_UNSPEC }, };
struct mptcp_pm_addr_entry rem = { .addr = { .family = AF_UNSPEC }, };
- struct nlattr *attr_rem = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
- struct nlattr *attr = info->attrs[MPTCP_PM_ATTR_ADDR];
struct mptcp_pm_addr_entry *entry;
+ struct nlattr *attr, *attr_rem;
struct mptcp_sock *msk;
int ret = -EINVAL;
struct sock *sk;
u8 bkup = 0;
+ if (GENL_REQ_ATTR_CHECK(info, MPTCP_PM_ATTR_ADDR) ||
+ GENL_REQ_ATTR_CHECK(info, MPTCP_PM_ATTR_ADDR_REMOTE))
+ return ret;
+
msk = mptcp_userspace_pm_get_sock(info);
if (!msk)
return ret;
sk = (struct sock *)msk;
+ attr = info->attrs[MPTCP_PM_ATTR_ADDR];
ret = mptcp_pm_parse_entry(attr, info, false, &loc);
if (ret < 0)
goto set_flags_err;
@@ -590,6 +594,7 @@ int mptcp_userspace_pm_set_flags(struct sk_buff *skb, struct genl_info *info)
goto set_flags_err;
}
+ attr_rem = info->attrs[MPTCP_PM_ATTR_ADDR_REMOTE];
ret = mptcp_pm_parse_entry(attr_rem, info, false, &rem);
if (ret < 0)
goto set_flags_err;
@@ -679,20 +684,24 @@ int mptcp_userspace_pm_dump_addr(struct sk_buff *msg,
int mptcp_userspace_pm_get_addr(struct sk_buff *skb,
struct genl_info *info)
{
- struct nlattr *attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];
struct mptcp_pm_addr_entry addr, *entry;
struct mptcp_sock *msk;
struct sk_buff *msg;
+ struct nlattr *attr;
int ret = -EINVAL;
struct sock *sk;
void *reply;
+ if (GENL_REQ_ATTR_CHECK(info, MPTCP_PM_ENDPOINT_ADDR))
+ return ret;
+
msk = mptcp_userspace_pm_get_sock(info);
if (!msk)
return ret;
sk = (struct sock *)msk;
+ attr = info->attrs[MPTCP_PM_ENDPOINT_ADDR];
ret = mptcp_pm_parse_entry(attr, info, false, &addr);
if (ret < 0)
goto out;
--
2.45.2
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH mptcp-next v8 7/8] mptcp: pm: mark missing address attributes
2025-01-08 1:44 ` [PATCH mptcp-next v8 7/8] mptcp: pm: mark missing address attributes Geliang Tang
@ 2025-01-09 15:24 ` Matthieu Baerts
0 siblings, 0 replies; 14+ messages in thread
From: Matthieu Baerts @ 2025-01-09 15:24 UTC (permalink / raw)
To: Geliang Tang, mptcp
Hi Geliang,
On 08/01/2025 02:44, Geliang Tang wrote:
> From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
>
> mptcp_pm_parse_entry() will check if the given attribute is defined. If
> not, it will return a generic error: "missing address info".
>
> It might then not be clear for the userspace developer which attribute
> is missing, especially when the command takes multiple addresses.
>
> By using GENL_REQ_ATTR_CHECK(), the userspace will get a hint about
> which attribute is missing, making thing clearer. Note that this is what
> was already done for most of the other MPTCP NL commands, this patch
> simply adds the missing ones.
>
> v2:
> - keep "pernet = pm_nl_get_pernet(net);" at the beginning of
> mptcp_pm_nl_set_flags().
Why did you move it there? The GENL_REQ_ATTR_CHECK() are usually done
first, no? There is no need to get 'pernet' if some attributes are missing.
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 14+ messages in thread
* [PATCH mptcp-next v8 8/8] mptcp: pm: use NL_SET_ERR_MSG_ATTR when possible
2025-01-08 1:44 [PATCH mptcp-next v8 0/8] mptcp: use GENL_REQ_ATTR_CHECK in userspace pm Geliang Tang
` (6 preceding siblings ...)
2025-01-08 1:44 ` [PATCH mptcp-next v8 7/8] mptcp: pm: mark missing address attributes Geliang Tang
@ 2025-01-08 1:44 ` Geliang Tang
2025-01-08 3:25 ` [PATCH mptcp-next v8 0/8] mptcp: use GENL_REQ_ATTR_CHECK in userspace pm MPTCP CI
2025-01-09 15:23 ` Matthieu Baerts
9 siblings, 0 replies; 14+ messages in thread
From: Geliang Tang @ 2025-01-08 1:44 UTC (permalink / raw)
To: mptcp; +Cc: Matthieu Baerts (NGI0)
From: "Matthieu Baerts (NGI0)" <matttbe@kernel.org>
Instead of only returning a text message with GENL_SET_ERR_MSG(),
NL_SET_ERR_MSG_ATTR() can help the userspace developers by also
reporting which attribute is faulty.
When the error is specific to an attribute, NL_SET_ERR_MSG_ATTR() is now
used. The error messages have not been modified in this commit.
v2:
- update the code related mptcp_userspace_pm_remove_id_zero_address()
since a new patch to drop "info" parameter of this patch is added.
v3:
- not use NL_SET_ERR_MSG_ATTR in mptcp_pm_nl_set_flags(), since 'attr'
will be removed in the commit "mptcp: add local & remote parameters for
set_flags".
Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
net/mptcp/pm_netlink.c | 13 ++++++++-----
net/mptcp/pm_userspace.c | 13 ++++++++-----
2 files changed, 16 insertions(+), 10 deletions(-)
diff --git a/net/mptcp/pm_netlink.c b/net/mptcp/pm_netlink.c
index adef7f12914b..60418b8a6119 100644
--- a/net/mptcp/pm_netlink.c
+++ b/net/mptcp/pm_netlink.c
@@ -1407,18 +1407,21 @@ int mptcp_pm_nl_add_addr_doit(struct sk_buff *skb, struct genl_info *info)
return ret;
if (addr.addr.port && !address_use_port(&addr)) {
- GENL_SET_ERR_MSG(info, "flags must have signal and not subflow when using port");
+ NL_SET_ERR_MSG_ATTR(info->extack, attr,
+ "flags must have signal and not subflow when using port");
return -EINVAL;
}
if (addr.flags & MPTCP_PM_ADDR_FLAG_SIGNAL &&
addr.flags & MPTCP_PM_ADDR_FLAG_FULLMESH) {
- GENL_SET_ERR_MSG(info, "flags mustn't have both signal and fullmesh");
+ NL_SET_ERR_MSG_ATTR(info->extack, attr,
+ "flags mustn't have both signal and fullmesh");
return -EINVAL;
}
if (addr.flags & MPTCP_PM_ADDR_FLAG_IMPLICIT) {
- GENL_SET_ERR_MSG(info, "can't create IMPLICIT endpoint");
+ NL_SET_ERR_MSG_ATTR(info->extack, attr,
+ "can't create IMPLICIT endpoint");
return -EINVAL;
}
@@ -1616,7 +1619,7 @@ int mptcp_pm_nl_del_addr_doit(struct sk_buff *skb, struct genl_info *info)
spin_lock_bh(&pernet->lock);
entry = __lookup_addr_by_id(pernet, addr.addr.id);
if (!entry) {
- GENL_SET_ERR_MSG(info, "address not found");
+ NL_SET_ERR_MSG_ATTR(info->extack, attr, "address not found");
spin_unlock_bh(&pernet->lock);
return -EINVAL;
}
@@ -1802,7 +1805,7 @@ int mptcp_pm_nl_get_addr(struct sk_buff *skb, struct genl_info *info)
rcu_read_lock();
entry = __lookup_addr_by_id(pernet, addr.addr.id);
if (!entry) {
- GENL_SET_ERR_MSG(info, "address not found");
+ NL_SET_ERR_MSG_ATTR(info->extack, attr, "address not found");
ret = -EINVAL;
goto unlock_fail;
}
diff --git a/net/mptcp/pm_userspace.c b/net/mptcp/pm_userspace.c
index 1876b3b2cb2d..16337d08186b 100644
--- a/net/mptcp/pm_userspace.c
+++ b/net/mptcp/pm_userspace.c
@@ -189,7 +189,8 @@ static struct mptcp_sock *mptcp_userspace_pm_get_sock(const struct genl_info *in
}
if (!mptcp_pm_is_userspace(msk)) {
- GENL_SET_ERR_MSG(info, "userspace PM not selected");
+ NL_SET_ERR_MSG_ATTR(info->extack, token,
+ "userspace PM not selected");
sock_put((struct sock *)msk);
return NULL;
}
@@ -233,7 +234,8 @@ int mptcp_pm_nl_announce_doit(struct sk_buff *skb, struct genl_info *info)
err = mptcp_userspace_pm_append_new_local_addr(msk, &addr_val, false);
if (err < 0) {
- GENL_SET_ERR_MSG(info, "did not match address and id");
+ NL_SET_ERR_MSG_ATTR(info->extack, addr,
+ "did not match address and id");
goto announce_err;
}
@@ -388,7 +390,7 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
goto create_err;
if (entry.flags & MPTCP_PM_ADDR_FLAG_SIGNAL) {
- GENL_SET_ERR_MSG(info, "invalid addr flags");
+ NL_SET_ERR_MSG_ATTR(info->extack, laddr, "invalid addr flags");
err = -EINVAL;
goto create_err;
}
@@ -407,7 +409,8 @@ int mptcp_pm_nl_subflow_create_doit(struct sk_buff *skb, struct genl_info *info)
err = mptcp_userspace_pm_append_new_local_addr(msk, &entry, false);
if (err < 0) {
- GENL_SET_ERR_MSG(info, "did not match address and id");
+ NL_SET_ERR_MSG_ATTR(info->extack, laddr,
+ "did not match address and id");
goto create_err;
}
@@ -724,7 +727,7 @@ int mptcp_userspace_pm_get_addr(struct sk_buff *skb,
spin_lock_bh(&msk->pm.lock);
entry = mptcp_userspace_pm_lookup_addr_by_id(msk, addr.addr.id);
if (!entry) {
- GENL_SET_ERR_MSG(info, "address not found");
+ NL_SET_ERR_MSG_ATTR(info->extack, attr, "address not found");
ret = -EINVAL;
goto unlock_fail;
}
--
2.45.2
^ permalink raw reply related [flat|nested] 14+ messages in thread* Re: [PATCH mptcp-next v8 0/8] mptcp: use GENL_REQ_ATTR_CHECK in userspace pm
2025-01-08 1:44 [PATCH mptcp-next v8 0/8] mptcp: use GENL_REQ_ATTR_CHECK in userspace pm Geliang Tang
` (7 preceding siblings ...)
2025-01-08 1:44 ` [PATCH mptcp-next v8 8/8] mptcp: pm: use NL_SET_ERR_MSG_ATTR when possible Geliang Tang
@ 2025-01-08 3:25 ` MPTCP CI
2025-01-09 15:23 ` Matthieu Baerts
9 siblings, 0 replies; 14+ messages in thread
From: MPTCP CI @ 2025-01-08 3:25 UTC (permalink / raw)
To: Matthieu Baerts; +Cc: mptcp
Hi Matthieu,
Thank you for your modifications, that's great!
Our CI did some validations and here is its report:
- KVM Validation: normal: Critical: Global Timeout ❌
- KVM Validation: debug: Success! ✅
- KVM Validation: btf-normal (only bpftest_all): Success! ✅
- KVM Validation: btf-debug (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/12662643252
Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/f845d68f8495
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=923191
If there are some issues, you can reproduce them using the same environment as
the one used by the CI thanks to a docker image, e.g.:
$ cd [kernel source code]
$ docker run -v "${PWD}:${PWD}:rw" -w "${PWD}" --privileged --rm -it \
--pull always mptcp/mptcp-upstream-virtme-docker:latest \
auto-normal
For more details:
https://github.com/multipath-tcp/mptcp-upstream-virtme-docker
Please note that despite all the efforts that have been already done to have a
stable tests suite when executed on a public CI like here, it is possible some
reported issues are not due to your modifications. Still, do not hesitate to
help us improve that ;-)
Cheers,
MPTCP GH Action bot
Bot operated by Matthieu Baerts (NGI0 Core)
^ permalink raw reply [flat|nested] 14+ messages in thread* Re: [PATCH mptcp-next v8 0/8] mptcp: use GENL_REQ_ATTR_CHECK in userspace pm
2025-01-08 1:44 [PATCH mptcp-next v8 0/8] mptcp: use GENL_REQ_ATTR_CHECK in userspace pm Geliang Tang
` (8 preceding siblings ...)
2025-01-08 3:25 ` [PATCH mptcp-next v8 0/8] mptcp: use GENL_REQ_ATTR_CHECK in userspace pm MPTCP CI
@ 2025-01-09 15:23 ` Matthieu Baerts
9 siblings, 0 replies; 14+ messages in thread
From: Matthieu Baerts @ 2025-01-09 15:23 UTC (permalink / raw)
To: Geliang Tang, mptcp; +Cc: Geliang Tang
Hi Geliang,
On 08/01/2025 02:44, Geliang Tang wrote:
> From: Geliang Tang <tanggeliang@kylinos.cn>
>
> v8:
> - move the set_flags() patches out of this set.
> - differences from v6:
> - adjust the order of the patches.
> - keep "pernet = pm_nl_get_pernet(net);" at the beginning of
> mptcp_pm_nl_set_flags().
> - not use NL_SET_ERR_MSG_ATTR in mptcp_pm_nl_set_flags(), since 'attr'
> will be removed in the commit "mptcp: add local & remote parameters for
> set_flags".
Because there are still some discussions ongoing on that patch, and not
to block this series here that is almost ready, I think it might be
easier to keep these modifications in 'set_flags()' here. The other
series can be rebased on top of this one (with a "Based-on:" if needed).
With this modification (and moving the changelog to the comment section
+ maybe keeping GENL_REQ_ATTR_CHECK() at the top), I think we can merge
this series.
WDYT?
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.
^ permalink raw reply [flat|nested] 14+ messages in thread