Thread (9 messages) flat view 9 messages, 5 authors, 2014-07-15

RE: [PATCH 1/2 net-next] vxlan: Be liberal on receive and only require the I bit to be set

From: David Laight <hidden>
Date: 2014-07-14 08:47:41

From: Stephen Hemminger
On Fri, 11 Jul 2014 18:59:49 +0200
Thomas Graf [off-list ref] wrote:
quoted
@@ -1617,7 +1646,9 @@ static int vxlan6_xmit_skb(struct vxlan_sock *vs,
 	}

 	vxh = (struct vxlanhdr *) __skb_push(skb, sizeof(*vxh));
-	vxh->vx_flags = htonl(VXLAN_FLAGS);
+	vxlan_flags(vxh) = VXLAN_FLAG_VNI;
+	vxh->vx_reserved1 = 0;
+	vxh->vx_reserved2 = 0;
 	vxh->vx_vni = vni;
Okay, but initializing bitfields generates crappy code.
Can we just alias and do one assignment.
If you write to all the bitfields gcc ought to manage to do a single write.
If it doesn't then all the bitfields should be ripped out :-)

	David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help