[ovs-discuss] Can anyone familiar with the following code please clarify for me?

YIMIN CHEN ymchen.nbzj at gmail.com
Wed May 23 01:59:10 UTC 2012


Hi Ben,

Thank you very much for your clarification on the operation!

Yimin

On Tue, May 22, 2012 at 2:15 PM, Ben Pfaff <blp at nicira.com> wrote:
> On Tue, May 22, 2012 at 02:11:35PM +0800, YIMIN CHEN wrote:
>> I am working on ovs code based on openvswitch-1.1.0pre2, it is kinda
>> of old, I know. I ran across this code that I am having hard time
>> understanding. If anyone is familiar with this part of code, could you
>> please help me?
>>
>>
>>    if (!(field_wc & (field_wc - 1))) { <================== if field_wc
>
> The expression '!(x & (x - 1))' is true if exactly one bit in 'x' is set
> to 1 (or if x is zero).



More information about the discuss mailing list