[ovs-dev] [PATCH]: Use ctz64() instead of rightmost_1bit_idx() with 64 bit arg

Kyle Upton kupton at baymicrosystems.com
Mon Sep 21 19:27:52 UTC 2015


Looks good to me.  Cleaner and more general.

Thanks,
-Kyle

On 09/18/2015 06:26 PM, Ben Pfaff wrote:
> On Wed, Sep 16, 2015 at 01:08:48PM -0400, Kyle Upton wrote:
>> Applied a patch which changed value of OFPACT_SET_QUEUE to be greater
>> than 32.  Tracked down a subsequent autotest failure to invocation of
>> rightmost_1bit_idx() with 64-bit argument 'opfacts_bitmap'.
>> rightmost_1bit_idx() only works with 32-bit integers.
>>
>> Changed this and other occurrences where rightmost_1bit_idx() is
>> invoked with a 64-bit argument to use ctz64() instead.
>>
>> Tested by running 'make check'.
>>
>> Signed-off-by: Kyle Upton <kupton at baymicrosystems.com>
>
> After looking through the OVS code, I don't think that any of the users
> of rightmost_1bit_idx() or leftmost_1bit_idx() rely on the case where
> all of the bits are zero.  That means that we can just change them to be
> alternate names for ctz64() or log_2_floor().  Arguably we could get rid
> of them entirely but personally I think the names are useful to make it
> clear how the user is thinking of the function.
>
> So, anyway, I sent an alternative patch:
>         http://openvswitch.org/pipermail/dev/2015-September/060257.html
> What do you think?
>
> Thanks,
>
> Ben.
>

This correspondence, and any attachments or files transmitted with this correspondence, contains information which may be confidential and privileged and is intended solely for the use of the addressee. Unless you are the addressee or are authorized to receive messages for the addressee, you may not use, copy, disseminate, or disclose this correspondence or any information contained in this correspondence to any third party. If you have received this correspondence in error, please notify the sender immediately and delete this correspondence and any attachments or files transmitted with this correspondence from your system, and destroy any and all copies thereof, electronic or otherwise. Your cooperation and understanding are greatly appreciated.



More information about the dev mailing list