netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gone with the spring cleanup..
@ 2015-05-13  9:12 Or Gerlitz
  2015-05-13 10:38 ` Jiri Pirko
  0 siblings, 1 reply; 5+ messages in thread
From: Or Gerlitz @ 2015-05-13  9:12 UTC (permalink / raw)
  To: Scott Feldman; +Cc: netdev@vger.kernel.org, Jiri Pirko

Hi Scott, Jiri

So, following the spring cleanup, my builder (which turns to have pretty 
old GCC 4.4.6) isn't functional anymore w.r.t net-next... I checked on 
different station and it works on GCC 4.9.2.

I would love us to get this fixed, please let me know if you need more 
info, below is the build verbose command line build error.

Few more pieces of info, changing -std=gnu89to -std=gnu99didn't help. 
Also the command line where it does work (4.9.2) uses -std=gnu89

Or.



gcc -Wp,-MD,net/switchdev/.switchdev.o.d  -nostdinc -isystem 
/usr/lib/gcc/x86_64-redhat-linux/4.4.6/include -I./arch/x86/include 
-Iarch/x86/include/generated/uapi -Iarch/x86/include/generated  
-Iinclude -I./arch/x86/include/uapi -Iarch/x86/include/generated/uapi 
-I./include/uapi -Iinclude/generated/uapi -include 
./include/linux/kconfig.h -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes 
-Wno-trigraphs -fno-strict-aliasing -fno-common 
-Werror-implicit-function-declaration -Wno-format-security -std=gnu89 
-m64 -mno-80387 -mno-fp-ret-in-387 -mtune=generic -mno-red-zone 
-mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args 
-DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 
-DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 
-DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -pipe -Wno-sign-compare 
-fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow 
-mno-avx -fno-delete-null-pointer-checks -Os -Wframe-larger-than=2048 
-fno-stack-protector -Wno-unused-but-set-variable 
-fno-omit-frame-pointer -fno-optimize-sibling-calls 
-fno-var-tracking-assignments -g -Wdeclaration-after-statement 
-Wno-pointer-sign -fno-strict-overflow -fconserve-stack 
-Werror=implicit-int -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO 
-D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(switchdev)" 
-D"KBUILD_MODNAME=KBUILD_STR(switchdev)" -c -o 
net/switchdev/.tmp_switchdev.o net/switchdev/switchdev.c
net/switchdev/switchdev.c: In function 'switchdev_fib_ipv4_add':
net/switchdev/switchdev.c:646: error: unknown field 'ipv4_fib' specified 
in initializer
net/switchdev/switchdev.c:646: warning: braces around scalar initializer
net/switchdev/switchdev.c:646: warning: (near initialization for 
'fib_obj.trans')
net/switchdev/switchdev.c:647: error: field name not in record or union 
initializer
net/switchdev/switchdev.c:647: error: (near initialization for 
'fib_obj.trans')
net/switchdev/switchdev.c:648: error: field name not in record or union 
initializer
net/switchdev/switchdev.c:648: error: (near initialization for 
'fib_obj.trans')
net/switchdev/switchdev.c:648: warning: excess elements in scalar 
initializer
net/switchdev/switchdev.c:648: warning: (near initialization for 
'fib_obj.trans')
net/switchdev/switchdev.c:649: error: field name not in record or union 
initializer
net/switchdev/switchdev.c:649: error: (near initialization for 
'fib_obj.trans')
net/switchdev/switchdev.c:649: warning: excess elements in scalar 
initializer
net/switchdev/switchdev.c:649: warning: (near initialization for 
'fib_obj.trans')
net/switchdev/switchdev.c:650: error: field name not in record or union 
initializer
net/switchdev/switchdev.c:650: error: (near initialization for 
'fib_obj.trans')
net/switchdev/switchdev.c:650: warning: excess elements in scalar 
initializer
net/switchdev/switchdev.c:650: warning: (near initialization for 
'fib_obj.trans')
net/switchdev/switchdev.c:651: error: field name not in record or union 
initializer
net/switchdev/switchdev.c:651: error: (near initialization for 
'fib_obj.trans')
net/switchdev/switchdev.c:651: warning: excess elements in scalar 
initializer
net/switchdev/switchdev.c:651: warning: (near initialization for 
'fib_obj.trans')
net/switchdev/switchdev.c:652: error: field name not in record or union 
initializer
net/switchdev/switchdev.c:652: error: (near initialization for 
'fib_obj.trans')
net/switchdev/switchdev.c:652: warning: excess elements in scalar 
initializer
net/switchdev/switchdev.c:652: warning: (near initialization for 
'fib_obj.trans')
net/switchdev/switchdev.c:653: error: field name not in record or union 
initializer
net/switchdev/switchdev.c:653: error: (near initialization for 
'fib_obj.trans')
net/switchdev/switchdev.c:653: warning: excess elements in scalar 
initializer
net/switchdev/switchdev.c:653: warning: (near initialization for 
'fib_obj.trans')

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

* Re: gone with the spring cleanup..
  2015-05-13  9:12 gone with the spring cleanup Or Gerlitz
@ 2015-05-13 10:38 ` Jiri Pirko
  2015-05-13 10:42   ` Jiri Pirko
  0 siblings, 1 reply; 5+ messages in thread
From: Jiri Pirko @ 2015-05-13 10:38 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: Scott Feldman, netdev@vger.kernel.org

Wed, May 13, 2015 at 11:12:45AM CEST, ogerlitz@mellanox.com wrote:
>Hi Scott, Jiri
>
>So, following the spring cleanup, my builder (which turns to have pretty old
>GCC 4.4.6) isn't functional anymore w.r.t net-next... I checked on different
>station and it works on GCC 4.9.2.
>
>I would love us to get this fixed, please let me know if you need more info,
>below is the build verbose command line build error.
>
>Few more pieces of info, changing -std=gnu89to -std=gnu99didn't help. Also
>the command line where it does work (4.9.2) uses -std=gnu89

Looks like the problem might be in named structures which suppose to be
anonymous. Would you try following patch:


diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 3b217b4..12848b3 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -53,12 +53,12 @@ struct switchdev_obj {
 	enum switchdev_obj_id id;
 	enum switchdev_trans trans;
 	union {
-		struct switchdev_obj_vlan {			/* PORT_VLAN */
+		struct{			/* PORT_VLAN */
 			u16 flags;
 			u16 vid_start;
 			u16 vid_end;
 		} vlan;
-		struct switchdev_obj_ipv4_fib {		/* IPV4_FIB */
+		struct {		/* IPV4_FIB */
 			u32 dst;
 			int dst_len;
 			struct fib_info *fi;

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

* Re: gone with the spring cleanup..
  2015-05-13 10:38 ` Jiri Pirko
@ 2015-05-13 10:42   ` Jiri Pirko
  2015-05-13 10:55     ` Or Gerlitz
  0 siblings, 1 reply; 5+ messages in thread
From: Jiri Pirko @ 2015-05-13 10:42 UTC (permalink / raw)
  To: Or Gerlitz; +Cc: Scott Feldman, netdev@vger.kernel.org

Wed, May 13, 2015 at 12:38:12PM CEST, jiri@resnulli.us wrote:
>Wed, May 13, 2015 at 11:12:45AM CEST, ogerlitz@mellanox.com wrote:
>>Hi Scott, Jiri
>>
>>So, following the spring cleanup, my builder (which turns to have pretty old
>>GCC 4.4.6) isn't functional anymore w.r.t net-next... I checked on different
>>station and it works on GCC 4.9.2.
>>
>>I would love us to get this fixed, please let me know if you need more info,
>>below is the build verbose command line build error.
>>
>>Few more pieces of info, changing -std=gnu89to -std=gnu99didn't help. Also
>>the command line where it does work (4.9.2) uses -std=gnu89
>
>Looks like the problem might be in named structures which suppose to be
>anonymous. Would you try following patch:

oh, switchdev_obj_vlan and switchdev_obj_ipv4_fib is used in rocker..
So better:


diff --git a/include/net/switchdev.h b/include/net/switchdev.h
index 3b217b4..32ce31d 100644
--- a/include/net/switchdev.h
+++ b/include/net/switchdev.h
@@ -49,24 +49,28 @@ enum switchdev_obj_id {
 	SWITCHDEV_OBJ_IPV4_FIB,
 };
 
+struct switchdev_obj_vlan {
+	u16 flags;
+	u16 vid_start;
+	u16 vid_end;
+};
+
+struct switchdev_obj_ipv4_fib {
+	u32 dst;
+	int dst_len;
+	struct fib_info *fi;
+	u8 tos;
+	u8 type;
+	u32 nlflags;
+	u32 tb_id;
+};
+
 struct switchdev_obj {
 	enum switchdev_obj_id id;
 	enum switchdev_trans trans;
 	union {
-		struct switchdev_obj_vlan {			/* PORT_VLAN */
-			u16 flags;
-			u16 vid_start;
-			u16 vid_end;
-		} vlan;
-		struct switchdev_obj_ipv4_fib {		/* IPV4_FIB */
-			u32 dst;
-			int dst_len;
-			struct fib_info *fi;
-			u8 tos;
-			u8 type;
-			u32 nlflags;
-			u32 tb_id;
-		} ipv4_fib;
+		struct switchdev_obj_vlan vlan;
+		struct switchdev_obj_ipv4_fib ipv4_fib;
 	};
 };
 

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

* Re: gone with the spring cleanup..
  2015-05-13 10:42   ` Jiri Pirko
@ 2015-05-13 10:55     ` Or Gerlitz
  2015-05-13 11:26       ` Daniel Borkmann
  0 siblings, 1 reply; 5+ messages in thread
From: Or Gerlitz @ 2015-05-13 10:55 UTC (permalink / raw)
  To: Jiri Pirko; +Cc: Scott Feldman, netdev@vger.kernel.org

On 5/13/2015 1:42 PM, Jiri Pirko wrote:
>> Looks like the problem might be in named structures which suppose to be
>> >anonymous. Would you try following patch:
> oh, switchdev_obj_vlan and switchdev_obj_ipv4_fib is used in rocker..
> So better:

nope, fails.. if I remove the union (it is struct switchdev_obj has 
strict vlan and ipv4_fib fields) it works. Seems there's some problem 
also with anonymous unions.

>
> diff --git a/include/net/switchdev.h b/include/net/switchdev.h
> index 3b217b4..32ce31d 100644
> --- a/include/net/switchdev.h
> +++ b/include/net/switchdev.h
> @@ -49,24 +49,28 @@ enum switchdev_obj_id {
>   	SWITCHDEV_OBJ_IPV4_FIB,
>   };
>   
> +struct switchdev_obj_vlan {
> +	u16 flags;
> +	u16 vid_start;
> +	u16 vid_end;
> +};
> +
> +struct switchdev_obj_ipv4_fib {
> +	u32 dst;
> +	int dst_len;
> +	struct fib_info *fi;
> +	u8 tos;
> +	u8 type;
> +	u32 nlflags;
> +	u32 tb_id;
> +};
> +
>   struct switchdev_obj {
>   	enum switchdev_obj_id id;
>   	enum switchdev_trans trans;
>   	union {
> -		struct switchdev_obj_vlan {			/* PORT_VLAN */
> -			u16 flags;
> -			u16 vid_start;
> -			u16 vid_end;
> -		} vlan;
> -		struct switchdev_obj_ipv4_fib {		/* IPV4_FIB */
> -			u32 dst;
> -			int dst_len;
> -			struct fib_info *fi;
> -			u8 tos;
> -			u8 type;
> -			u32 nlflags;
> -			u32 tb_id;
> -		} ipv4_fib;
> +		struct switchdev_obj_vlan vlan;
> +		struct switchdev_obj_ipv4_fib ipv4_fib;
>   	};
>   };
>   

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

* Re: gone with the spring cleanup..
  2015-05-13 10:55     ` Or Gerlitz
@ 2015-05-13 11:26       ` Daniel Borkmann
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Borkmann @ 2015-05-13 11:26 UTC (permalink / raw)
  To: Or Gerlitz, Jiri Pirko; +Cc: Scott Feldman, netdev@vger.kernel.org

On 05/13/2015 12:55 PM, Or Gerlitz wrote:
> On 5/13/2015 1:42 PM, Jiri Pirko wrote:
>>> Looks like the problem might be in named structures which suppose to be
>>> >anonymous. Would you try following patch:
>> oh, switchdev_obj_vlan and switchdev_obj_ipv4_fib is used in rocker..
>> So better:
>
> nope, fails.. if I remove the union (it is struct switchdev_obj has strict vlan and ipv4_fib fields) it works. Seems there's some problem also with anonymous unions.

Yes, we once had such an issue here btw:

https://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/lib/test_bpf.c?id=ece80490e2c1cefda018b2e5b96d4f39083d9096

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

end of thread, other threads:[~2015-05-13 11:26 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-13  9:12 gone with the spring cleanup Or Gerlitz
2015-05-13 10:38 ` Jiri Pirko
2015-05-13 10:42   ` Jiri Pirko
2015-05-13 10:55     ` Or Gerlitz
2015-05-13 11:26       ` Daniel Borkmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).