Nithin, as Alin said the userspace expects just the payload. I saw that in daemon logs while testing the patch. Below the logs that caught my attention and motivates the change.
"... 2016-06-01T15:04:07.307Z|00040|dpif(handler14)|DBG|system@ovs-system: action upcall: recirc_id(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),eth(src=00:15:5d:79:85:06,dst=33:33:ff:00:01:84),in_port(6),eth_type(0x86dd),ipv6(src=1999::183,dst=ff02::1:ff00:184,label=0,proto=58,tclass=0,hlimit=255,frag=no),icmpv6(type=135,code=0),nd(target=::,sll=00:00:00:00:00:00,tll=00:00:00:00:00:00) icmp6,dl_vlan=900,dl_vlan_pcp=0,dl_src=00:15:5d:79:85:06,dl_dst=33:33:ff:00:01:84,ipv6_src=1999::183,ipv6_dst=ff02::1:ff00:184,ipv6_label=0x00000,nw_tos=0,nw_ecn=0,nw_ttl=255,icmp_type=135,icmp_code=0,nd_target=1999::184,nd_sll=00:15:5d:79:85:06,nd_tll=00:00:00:00:00:00 icmp6_csum:5f4d 2016-06-01T15:04:07.308Z|00041|ofproto_dpif_upcall(handler14)|WARN|action upcall cookie has unexpected size 20 2016-06-01T15:04:07.433Z|00042|netlink_socket(handler14)|DBG|nl_sock_recv__ (Success): nl(len:392, type=19(ovs_packet), flags=0, seq=0, pid=3,genl(cmd=1,version=1) 2016-06-01T15:04:07.435Z|00043|dpif(handler14)|DBG|system@ovs-system: miss upcall: recirc_id(0),ct_state(0),ct_zone(0),ct_mark(0),ct_label(0),eth(src=00:50:56:c0:00:01,dst=ff:ff:ff:ff:ff:ff),in_port(4),eth_type(0x0800),ipv4(src=192.168.159.1,dst=192.168.159.255,proto=17,tos=0,ttl=128,frag=no),udp(src=138,dst=138) udp,vlan_tci=0x0000,dl_src=00:50:56:c0:00:01,dl_dst=ff:ff:ff:ff:ff:ff,nw_src=192.168.159.1,nw_dst=192.168.159.255,nw_tos=0,nw_ecn=0,nw_ttl=128,tp_src=138,tp_dst=138 udp_csum:3c58 2016-06-01T15:04:07.437Z|00044|dpif(handler14)|DBG|system@ovs-system: get_stats success ..." As the log shows the userdata length is 20, which is 4 bytes larger then the expected size (sizeof cookie = 16). The line that generates the error is: https://github.com/openvswitch/ovs/blob/master/ofproto/ofproto-dpif-upcall.c#L956 -Sorin -----Original Message----- From: Alin Serdean Sent: Thursday, 26 May, 2016 12:20 To: Nithin Raju; Sorin Vinturis; dev@openvswitch.org Subject: RE: [ovs-dev] [PATCH] datapath-windows: Sample action support. Beside moving the new functions from Random.h to Util.h, LGTM. > >+ > >+ elem = OvsCreateQueueNlPacket(NlAttrData(userdataAttr), > >+ NlAttrGetSize(userdataAttr), > > The existing code passes ŒuserdataAttr¹ as-is and not the payload. > Basically, it passes the NL_ATTR structure and not just the payload. > Any reason to strip off the header? [Alin Gabriel Serdean: ] You get the header twice in the userspace hence the bad length we need just the payload when passing the userdata. We could leave it as is or change the way we put the attribute in OvsCreateQueueNlPacket. > > If you follow through to how OvsCreateQueueNlPacket() uses this, > you¹ll end up with NlMsgPutTailUnspec() and that needs the NL_ATTR > header to be present as part of the data. > Thanks, Alin. _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev