[ovs-dev] [megaflow bond rebase] ofproto/bond: Implement bond megaflow using recirculation

Ben Pfaff blp at nicira.com
Fri Apr 4 20:42:17 UTC 2014


On Fri, Apr 04, 2014 at 01:13:18PM -0700, Andy Zhou wrote:
> On Wed, Apr 2, 2014 at 4:28 PM, Ben Pfaff <blp at nicira.com> wrote:
> > match_has_default_recirc_id() seems to be implemented as essentially:
> >         return (a | (a & b)) == 0;
> > and I don't understand that, since it seems to be equivalent to just
> >         return a == 0;
> 
> My intention was to test recirc_id == 0 and recir_id mask is all 1.
> How about the following?
> 
> static bool
> match_has_default_recirc_id(const struct match *m)
> {
>     return ((m->flow.recirc_id | ~m->wc.masks.recirc_id) == 0);
> }

I don't think we need tricky micro-optimizations here, I would just
write:
        return m->Flow.recirc_id == 0 && m->wc.masks.recirc_id == UINT32_MAX;



More information about the dev mailing list