On May 29, 2014, at 2:09 PM, Ben Pfaff <b...@nicira.com> wrote: > On Thu, May 29, 2014 at 01:56:31PM -0700, Jarno Rajahalme wrote: >> >>> On May 29, 2014, at 1:03 PM, Ben Pfaff <b...@nicira.com> wrote: >>> >>> I think that miniflow_extract() goes a little overboard on the >>> OVS_LIKELYs. In particular these seem suspicious: >>> >>> if (OVS_LIKELY((nw_proto != IPPROTO_HOPOPTS) >>> if (OVS_LIKELY(nw_proto == IPPROTO_TCP)) { >>> } else if (OVS_LIKELY(nw_proto == IPPROTO_UDP)) { >>> } else if (OVS_LIKELY(nw_proto == IPPROTO_SCTP)) { >>> } else if (OVS_LIKELY(nw_proto == IPPROTO_ICMP)) { >>> } else if (OVS_LIKELY(nw_proto == IPPROTO_ICMPV6)) { >>> >>> I would put all of these into a single outermost OVS_LIKELY, to make >>> it easier to read: >>> if (OVS_LIKELY(arp) && OVS_LIKELY(arp->ar_hrd == htons(1)) >>> && OVS_LIKELY(arp->ar_pro == htons(ETH_TYPE_IP)) >>> && OVS_LIKELY(arp->ar_hln == ETH_ADDR_LEN) >>> && OVS_LIKELY(arp->ar_pln == 4)) { >>> >>> What do you think? >> >> You are LIKELY right, and we can always tune these if there is a >> practical difference in generated code. > > OK. > > Your patch or mine?
I don’t have one, so… also as I took it overboard, it might be better you fix it to your liking, less expected back and forth. Jarno
_______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev