diff mbox

gone with the spring cleanup..

Message ID 20150513104249.GB2136@nanopsycho.mtl.com
State RFC, archived
Delegated to: David Miller
Headers show

Commit Message

Jiri Pirko May 13, 2015, 10:42 a.m. UTC
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:


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Or Gerlitz May 13, 2015, 10:55 a.m. UTC | #1
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;
>   	};
>   };
>   

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Daniel Borkmann May 13, 2015, 11:26 a.m. UTC | #2
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
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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;
 	};
 };