[ovs-dev] [PATCH 5/6] nx-match: New function nxm_read_field().

Ethan Jackson ethan at nicira.com
Fri Aug 12 02:47:23 UTC 2011


> The return value semantics of nxm_read_field() are surprising in that
> it just masks off the bits not being read.  If I had not read the code
> for the function, I would have guessed that it also shifted the bits
> so that the least-significant bit being read was the least-significant
> bit in the return value.  If the existing behavior is actually the
> most convenient, it'd be good for the function's comment to mention
> it.

Turns out this is a bug.  I sent out another version of that patch,
plus a patch that adds test.  We may want to consider backporting it.

>
> Instead of nxm_read_field__() and nxm_read_field(), I'd be inclined to
> keep nxm_read_field()'s existing name and name the new function
> nxm_read_subfield() or nxm_read_field_bits().  It sounds more
> descriptive to me.
>
>



More information about the dev mailing list