[PATCH mptcp-next] selftests: mptcp: pm_nl_ctl: remove re-definition

Matthieu Baerts (NGI0) posted 1 patch 3 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/multipath-tcp/mptcp_net-next tags/patchew/20240819-mptcp-pm-events-v1-1-c31d472471be@kernel.org
tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 10 ++--------
1 file changed, 2 insertions(+), 8 deletions(-)
[PATCH mptcp-next] selftests: mptcp: pm_nl_ctl: remove re-definition
Posted by Matthieu Baerts (NGI0) 3 months ago
'MPTCP_PM_NAME' is defined in 'linux/mptcp.h', no need to re-define it.

'MPTCP_PM_EVENTS' is not defined in 'linux/mptcp.h', but
'MPTCP_PM_EV_GRP_NAME' is, with the same value. We can then use the
latter, and drop the other one.

Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
---
 tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
index 7ad5a59adff2..994a556f46c1 100644
--- a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
+++ b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
@@ -19,12 +19,6 @@
 
 #include "linux/mptcp.h"
 
-#ifndef MPTCP_PM_NAME
-#define MPTCP_PM_NAME		"mptcp_pm"
-#endif
-#ifndef MPTCP_PM_EVENTS
-#define MPTCP_PM_EVENTS		"mptcp_pm_events"
-#endif
 #ifndef IPPROTO_MPTCP
 #define IPPROTO_MPTCP 262
 #endif
@@ -116,7 +110,7 @@ static int capture_events(int fd, int event_group)
 
 	if (setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP,
 		       &event_group, sizeof(event_group)) < 0)
-		error(1, errno, "could not join the " MPTCP_PM_EVENTS " mcast group");
+		error(1, errno, "could not join the " MPTCP_PM_EV_GRP_NAME " mcast group");
 
 	do {
 		FD_ZERO(&rfds);
@@ -288,7 +282,7 @@ static int genl_parse_getfamily(struct nlmsghdr *nlh, int *pm_family,
 					if (grp->rta_type == CTRL_ATTR_MCAST_GRP_ID)
 						*events_mcast_grp = *(__u32 *)RTA_DATA(grp);
 					else if (grp->rta_type == CTRL_ATTR_MCAST_GRP_NAME &&
-						 !strcmp(RTA_DATA(grp), MPTCP_PM_EVENTS))
+						 !strcmp(RTA_DATA(grp), MPTCP_PM_EV_GRP_NAME))
 						got_events_grp = 1;
 
 					grp = RTA_NEXT(grp, grp_len);

---
base-commit: a3cc6d5a9b3f3ccf7a368b21fb739163771cdfc7
change-id: 20240819-mptcp-pm-events-f9abf8c594cb

Best regards,
-- 
Matthieu Baerts (NGI0) <matttbe@kernel.org>
Re: [PATCH mptcp-next] selftests: mptcp: pm_nl_ctl: remove re-definition
Posted by Geliang Tang 3 months ago
Hi Matt,

Good catch!

On Mon, 2024-08-19 at 15:15 +0200, Matthieu Baerts (NGI0) wrote:
> 'MPTCP_PM_NAME' is defined in 'linux/mptcp.h', no need to re-define
> it.

nit: It's defined in "linux/mptcp_pm.h".

> 
> 'MPTCP_PM_EVENTS' is not defined in 'linux/mptcp.h', but
> 'MPTCP_PM_EV_GRP_NAME' is, with the same value. We can then use the
> latter, and drop the other one.
> 
> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>

Except for the nit in commit log, LGTM.

Reviewed-by: Geliang Tang <geliang@kernel.org>

Regards,
-Geliang

> ---
>  tools/testing/selftests/net/mptcp/pm_nl_ctl.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
> 
> diff --git a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
> b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
> index 7ad5a59adff2..994a556f46c1 100644
> --- a/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
> +++ b/tools/testing/selftests/net/mptcp/pm_nl_ctl.c
> @@ -19,12 +19,6 @@
>  
>  #include "linux/mptcp.h"
>  
> -#ifndef MPTCP_PM_NAME
> -#define MPTCP_PM_NAME		"mptcp_pm"
> -#endif
> -#ifndef MPTCP_PM_EVENTS
> -#define MPTCP_PM_EVENTS		"mptcp_pm_events"
> -#endif
>  #ifndef IPPROTO_MPTCP
>  #define IPPROTO_MPTCP 262
>  #endif
> @@ -116,7 +110,7 @@ static int capture_events(int fd, int
> event_group)
>  
>  	if (setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP,
>  		       &event_group, sizeof(event_group)) < 0)
> -		error(1, errno, "could not join the "
> MPTCP_PM_EVENTS " mcast group");
> +		error(1, errno, "could not join the "
> MPTCP_PM_EV_GRP_NAME " mcast group");
>  
>  	do {
>  		FD_ZERO(&rfds);
> @@ -288,7 +282,7 @@ static int genl_parse_getfamily(struct nlmsghdr
> *nlh, int *pm_family,
>  					if (grp->rta_type ==
> CTRL_ATTR_MCAST_GRP_ID)
>  						*events_mcast_grp =
> *(__u32 *)RTA_DATA(grp);
>  					else if (grp->rta_type ==
> CTRL_ATTR_MCAST_GRP_NAME &&
> -						
> !strcmp(RTA_DATA(grp), MPTCP_PM_EVENTS))
> +						
> !strcmp(RTA_DATA(grp), MPTCP_PM_EV_GRP_NAME))
>  						got_events_grp = 1;
>  
>  					grp = RTA_NEXT(grp,
> grp_len);
> 
> ---
> base-commit: a3cc6d5a9b3f3ccf7a368b21fb739163771cdfc7
> change-id: 20240819-mptcp-pm-events-f9abf8c594cb
> 
> Best regards,

Re: [PATCH mptcp-next] selftests: mptcp: pm_nl_ctl: remove re-definition
Posted by Matthieu Baerts 3 months ago
Hi Geliang,

On 21/08/2024 10:13, Geliang Tang wrote:
> Hi Matt,
> 
> Good catch!
> 
> On Mon, 2024-08-19 at 15:15 +0200, Matthieu Baerts (NGI0) wrote:
>> 'MPTCP_PM_NAME' is defined in 'linux/mptcp.h', no need to re-define
>> it.
> 
> nit: It's defined in "linux/mptcp_pm.h".

Indeed, it is not directly defined in mptcp.h any more. I updated the
commit message to say:

  'MPTCP_PM_NAME' is defined in 'linux/mptcp_pm.h', included in
  'linux/mptcp.h', no need to re-define it.

>> 'MPTCP_PM_EVENTS' is not defined in 'linux/mptcp.h', but
>> 'MPTCP_PM_EV_GRP_NAME' is, with the same value. We can then use the
>> latter, and drop the other one.
>>
>> Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
> 
> Except for the nit in commit log, LGTM.
> 
> Reviewed-by: Geliang Tang <geliang@kernel.org>

Thanks! Now in our tree:

New patches for t/upstream:
- 189988891094: selftests: mptcp: pm_nl_ctl: remove re-definition
- Results: 7aa192fc76f8..a6b7b898cddd (export)

Tests are now in progress:

- export:
https://github.com/multipath-tcp/mptcp_net-next/commit/c790cd57b4dc5ef7425f61df72d0638d604c6f57/checks

Cheers,
Matt
-- 
Sponsored by the NGI0 Core fund.
Re: [PATCH mptcp-next] selftests: mptcp: pm_nl_ctl: remove re-definition
Posted by MPTCP CI 3 months ago
Hi Matthieu,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Success! ✅
- KVM Validation: btf (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/10454345821

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/d1fc17f8aaea
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=880916


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)
Re: [PATCH mptcp-next] selftests: mptcp: pm_nl_ctl: remove re-definition
Posted by MPTCP CI 3 months ago
Hi Matthieu,

Thank you for your modifications, that's great!

Our CI did some validations and here is its report:

- KVM Validation: normal: Success! ✅
- KVM Validation: debug: Critical: Global Timeout ❌
- KVM Validation: btf (only bpftest_all): Success! ✅
- Task: https://github.com/multipath-tcp/mptcp_net-next/actions/runs/10454345821

Initiator: Patchew Applier
Commits: https://github.com/multipath-tcp/mptcp_net-next/commits/d1fc17f8aaea
Patchwork: https://patchwork.kernel.org/project/mptcp/list/?series=880916


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)