All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH mptcp-next 0/2] MPTCP_INFO: Fix compilation errors
@ 2021-08-30 10:33 Matthieu Baerts
  2021-08-30 10:33 ` [PATCH mptcp-next 1/2] Squash to "mptcp: add MPTCP_INFO getsockopt" Matthieu Baerts
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Matthieu Baerts @ 2021-08-30 10:33 UTC (permalink / raw)
  To: mptcp; +Cc: Matthieu Baerts

Geliang and Intel's 0-DAY CI Kernel Test Service reported compilation errors.
Those are fixed in patch 1/2.

Patch 2/2 contains one modification needed after patch 1/2 but also 2 others.

Matthieu Baerts (2):
  Squash to "mptcp: add MPTCP_INFO getsockopt"
  Squash to "selftests: mptcp: add mptcp getsockopt test cases"

 include/uapi/linux/mptcp.h                    | 12 ++++--
 .../selftests/net/mptcp/mptcp_sockopt.c       | 40 +++++++++----------
 2 files changed, 29 insertions(+), 23 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH mptcp-next 1/2] Squash to "mptcp: add MPTCP_INFO getsockopt"
  2021-08-30 10:33 [PATCH mptcp-next 0/2] MPTCP_INFO: Fix compilation errors Matthieu Baerts
@ 2021-08-30 10:33 ` Matthieu Baerts
  2021-08-30 10:33 ` [PATCH mptcp-next 2/2] Squash to "selftests: mptcp: add mptcp getsockopt test cases" Matthieu Baerts
  2021-08-30 18:40 ` [PATCH mptcp-next 0/2] MPTCP_INFO: Fix compilation errors Mat Martineau
  2 siblings, 0 replies; 5+ messages in thread
From: Matthieu Baerts @ 2021-08-30 10:33 UTC (permalink / raw)
  To: mptcp; +Cc: Matthieu Baerts, Geliang Tang, kernel test robot

This fix compilation errors reported by Geliang and Intel's 0-DAY CI
Kernel Test Service:

   ./usr/include/linux/mptcp.h:207:19: error: field has incomplete type 'struct sockaddr'
                   struct sockaddr sa_local;
                                   ^
   ./usr/include/linux/mptcp.h:209:23: error: field has incomplete type 'struct sockaddr_in6'
                   struct sockaddr_in6 sin6_local;
                                       ^
   ./usr/include/linux/mptcp.h:210:27: error: field has incomplete type 'struct sockaddr_storage'
                   struct sockaddr_storage ss_local;
                                           ^
   ./usr/include/linux/mptcp.h:213:19: error: field has incomplete type 'struct sockaddr'
                   struct sockaddr sa_remote;
                                   ^
   ./usr/include/linux/mptcp.h:215:23: error: field has incomplete type 'struct sockaddr_in6'
                   struct sockaddr_in6 sin6_remote;
                                       ^
   ./usr/include/linux/mptcp.h:216:27: error: field has incomplete type 'struct sockaddr_storage'
                   struct sockaddr_storage ss_remote;
                                           ^

Please note that socket.h should not be needed because it is included by
in.h. Here we explicitly add it but it can be removed if needed.

Also it seems we need to use __kernel_sockaddr_storage in uapi.

Reported-and-tested-by: Geliang Tang <geliangtang@gmail.com>
Reported-by: kernel test robot <lkp@intel.com>
Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---
 include/uapi/linux/mptcp.h | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/include/uapi/linux/mptcp.h b/include/uapi/linux/mptcp.h
index c368c11a0ed9..c8cc46f80a16 100644
--- a/include/uapi/linux/mptcp.h
+++ b/include/uapi/linux/mptcp.h
@@ -4,7 +4,13 @@
 
 #include <linux/const.h>
 #include <linux/types.h>
-#include <linux/in.h>
+#include <linux/in.h>		/* for sockaddr_in			*/
+#include <linux/in6.h>		/* for sockaddr_in6			*/
+#include <linux/socket.h>	/* for sockaddr_storage and sa_family	*/
+
+#ifndef __KERNEL__
+#include <sys/socket.h>		/* for struct sockaddr			*/
+#endif
 
 #define MPTCP_SUBFLOW_FLAG_MCAP_REM		_BITUL(0)
 #define MPTCP_SUBFLOW_FLAG_MCAP_LOC		_BITUL(1)
@@ -207,13 +213,13 @@ struct mptcp_subflow_addrs {
 		struct sockaddr sa_local;
 		struct sockaddr_in sin_local;
 		struct sockaddr_in6 sin6_local;
-		struct sockaddr_storage ss_local;
+		struct __kernel_sockaddr_storage ss_local;
 	};
 	union {
 		struct sockaddr sa_remote;
 		struct sockaddr_in sin_remote;
 		struct sockaddr_in6 sin6_remote;
-		struct sockaddr_storage ss_remote;
+		struct __kernel_sockaddr_storage ss_remote;
 	};
 };
 
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [PATCH mptcp-next 2/2] Squash to "selftests: mptcp: add mptcp getsockopt test cases"
  2021-08-30 10:33 [PATCH mptcp-next 0/2] MPTCP_INFO: Fix compilation errors Matthieu Baerts
  2021-08-30 10:33 ` [PATCH mptcp-next 1/2] Squash to "mptcp: add MPTCP_INFO getsockopt" Matthieu Baerts
@ 2021-08-30 10:33 ` Matthieu Baerts
  2021-08-30 18:40 ` [PATCH mptcp-next 0/2] MPTCP_INFO: Fix compilation errors Mat Martineau
  2 siblings, 0 replies; 5+ messages in thread
From: Matthieu Baerts @ 2021-08-30 10:33 UTC (permalink / raw)
  To: mptcp; +Cc: Matthieu Baerts

3 modifications have been done here:

- Use '#ifndef MPTCP_INFO' instead of '#ifndef TCP_TCPINFO'. I guess it
  was a typo.

- Move 'struct mptcp_info' inside this '#ifndef' and above: same order
  as in mptcp.h.

- Use '__kernel_sockaddr_storage' as in the parent commit.

Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net>
---
 .../selftests/net/mptcp/mptcp_sockopt.c       | 40 +++++++++----------
 1 file changed, 20 insertions(+), 20 deletions(-)

diff --git a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
index 66c4cee37937..417b11cafafe 100644
--- a/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
+++ b/tools/testing/selftests/net/mptcp/mptcp_sockopt.c
@@ -33,7 +33,24 @@ static int pf = AF_INET;
 #define SOL_MPTCP 284
 #endif
 
-#ifndef TCP_TCPINFO
+#ifndef MPTCP_INFO
+struct mptcp_info {
+	__u8	mptcpi_subflows;
+	__u8	mptcpi_add_addr_signal;
+	__u8	mptcpi_add_addr_accepted;
+	__u8	mptcpi_subflows_max;
+	__u8	mptcpi_add_addr_signal_max;
+	__u8	mptcpi_add_addr_accepted_max;
+	__u32	mptcpi_flags;
+	__u32	mptcpi_token;
+	__u64	mptcpi_write_seq;
+	__u64	mptcpi_snd_una;
+	__u64	mptcpi_rcv_nxt;
+	__u8	mptcpi_local_addr_used;
+	__u8	mptcpi_local_addr_max;
+	__u8	mptcpi_csum_enabled;
+};
+
 struct mptcp_subflow_data {
 	__u32		size_subflow_data;		/* size of this structure in userspace */
 	__u32		num_subflows;			/* must be 0, set by kernel */
@@ -47,13 +64,13 @@ struct mptcp_subflow_addrs {
 		struct sockaddr sa_local;
 		struct sockaddr_in sin_local;
 		struct sockaddr_in6 sin6_local;
-		struct sockaddr_storage ss_local;
+		struct __kernel_sockaddr_storage ss_local;
 	};
 	union {
 		struct sockaddr sa_remote;
 		struct sockaddr_in sin_remote;
 		struct sockaddr_in6 sin6_remote;
-		struct sockaddr_storage ss_remote;
+		struct __kernel_sockaddr_storage ss_remote;
 	};
 };
 
@@ -62,23 +79,6 @@ struct mptcp_subflow_addrs {
 #define MPTCP_SUBFLOW_ADDRS	3
 #endif
 
-struct mptcp_info {
-	__u8	mptcpi_subflows;
-	__u8	mptcpi_add_addr_signal;
-	__u8	mptcpi_add_addr_accepted;
-	__u8	mptcpi_subflows_max;
-	__u8	mptcpi_add_addr_signal_max;
-	__u8	mptcpi_add_addr_accepted_max;
-	__u32	mptcpi_flags;
-	__u32	mptcpi_token;
-	__u64	mptcpi_write_seq;
-	__u64	mptcpi_snd_una;
-	__u64	mptcpi_rcv_nxt;
-	__u8	mptcpi_local_addr_used;
-	__u8	mptcpi_local_addr_max;
-	__u8	mptcpi_csum_enabled;
-};
-
 struct so_state {
 	struct mptcp_info mi;
 	uint64_t mptcpi_rcv_delta;
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH mptcp-next 0/2] MPTCP_INFO: Fix compilation errors
  2021-08-30 10:33 [PATCH mptcp-next 0/2] MPTCP_INFO: Fix compilation errors Matthieu Baerts
  2021-08-30 10:33 ` [PATCH mptcp-next 1/2] Squash to "mptcp: add MPTCP_INFO getsockopt" Matthieu Baerts
  2021-08-30 10:33 ` [PATCH mptcp-next 2/2] Squash to "selftests: mptcp: add mptcp getsockopt test cases" Matthieu Baerts
@ 2021-08-30 18:40 ` Mat Martineau
  2021-08-31 10:40   ` Matthieu Baerts
  2 siblings, 1 reply; 5+ messages in thread
From: Mat Martineau @ 2021-08-30 18:40 UTC (permalink / raw)
  To: Matthieu Baerts; +Cc: mptcp

On Mon, 30 Aug 2021, Matthieu Baerts wrote:

> Geliang and Intel's 0-DAY CI Kernel Test Service reported compilation errors.
> Those are fixed in patch 1/2.
>
> Patch 2/2 contains one modification needed after patch 1/2 but also 2 others.
>

These look ok to squash, one detail:

> Matthieu Baerts (2):
>  Squash to "mptcp: add MPTCP_INFO getsockopt"

The struct_subflow_addrs hunk of this one applies to "mptcp: add 
MPTCP_SUBFLOW_ADDRS getsockopt support", but I figure you can straighten 
that out when applying (no need to repost).

>  Squash to "selftests: mptcp: add mptcp getsockopt test cases"
>
> include/uapi/linux/mptcp.h                    | 12 ++++--
> .../selftests/net/mptcp/mptcp_sockopt.c       | 40 +++++++++----------
> 2 files changed, 29 insertions(+), 23 deletions(-)
>
> -- 
> 2.32.0
>
>
>

--
Mat Martineau
Intel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH mptcp-next 0/2] MPTCP_INFO: Fix compilation errors
  2021-08-30 18:40 ` [PATCH mptcp-next 0/2] MPTCP_INFO: Fix compilation errors Mat Martineau
@ 2021-08-31 10:40   ` Matthieu Baerts
  0 siblings, 0 replies; 5+ messages in thread
From: Matthieu Baerts @ 2021-08-31 10:40 UTC (permalink / raw)
  To: Mat Martineau; +Cc: mptcp

Hi Mat,

On 30/08/2021 20:40, Mat Martineau wrote:
> On Mon, 30 Aug 2021, Matthieu Baerts wrote:
> 
>> Geliang and Intel's 0-DAY CI Kernel Test Service reported compilation
>> errors.
>> Those are fixed in patch 1/2.
>>
>> Patch 2/2 contains one modification needed after patch 1/2 but also 2
>> others.
>>
> 
> These look ok to squash, one detail:

Thank you for the review!

>> Matthieu Baerts (2):
>>  Squash to "mptcp: add MPTCP_INFO getsockopt"
> 
> The struct_subflow_addrs hunk of this one applies to "mptcp: add
> MPTCP_SUBFLOW_ADDRS getsockopt support", but I figure you can straighten
> that out when applying (no need to repost).

Indeed, you are right. I only looked at when "#include <linux/in.h>" has
been added in "include/uapi/linux/mptcp.h". In fact, it should have been
in "mptcp: add MPTCP_SUBFLOW_ADDRS getsockopt support" as well so I move
it there too (Acked by Florian on IRC)!

- c90cd3fa4458: "squashed" patch 1/2 in "mptcp: add MPTCP_SUBFLOW_ADDRS
getsockopt support"
- b8a1da1b7b53: "Signed-off-by" + "Co-developed-by"
- 5a66b30f2d91: tg: move code to
t/mptcp-add-MPTCP_SUBFLOW_ADDRS-getsockopt-support
- 0b300e055aae: conflict in
t/mptcp-add-MPTCP_SUBFLOW_ADDRS-getsockopt-support
- 89aa952809f3: "squashed" patch 2/2 in "selftests: mptcp: add mptcp
getsockopt test cases"
- ca40a3192b58: "Signed-off-by" + "Co-developed-by"
- Results: 1a8852042a9f..7f1dc9bc8b7b

Builds and tests are now in progress:

https://cirrus-ci.com/github/multipath-tcp/mptcp_net-next/export/20210831T103928
https://github.com/multipath-tcp/mptcp_net-next/actions/workflows/build-validation.yml?query=branch:export/20210831T103928

Cheers,
Matt
-- 
Tessares | Belgium | Hybrid Access Solutions
www.tessares.net

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-08-31 10:40 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-30 10:33 [PATCH mptcp-next 0/2] MPTCP_INFO: Fix compilation errors Matthieu Baerts
2021-08-30 10:33 ` [PATCH mptcp-next 1/2] Squash to "mptcp: add MPTCP_INFO getsockopt" Matthieu Baerts
2021-08-30 10:33 ` [PATCH mptcp-next 2/2] Squash to "selftests: mptcp: add mptcp getsockopt test cases" Matthieu Baerts
2021-08-30 18:40 ` [PATCH mptcp-next 0/2] MPTCP_INFO: Fix compilation errors Mat Martineau
2021-08-31 10:40   ` Matthieu Baerts

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.