[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20120117.122537.1430974467197123979.davem@davemloft.net>
Date: Tue, 17 Jan 2012 12:25:37 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: David.Laight@...LAB.COM
Cc: yevgenyp@...lanox.co.il, netdev@...r.kernel.org,
amirv@...lanox.co.il
Subject: Re: [PATCH net] mlx4_en: set number of rx rings used by RSS using
ethtool
From: "David Laight" <David.Laight@...LAB.COM>
Date: Tue, 17 Jan 2012 17:22:18 -0000
>
>> > + /* RSS table size must be an order of 2 */
>> > + if (rss_rings != (1 << order_base_2(rss_rings)))
>> > + return -EINVAL;
>>
>> This is an obscure way to make this kind of test.
>>
>> The canonical way is:
>>
>> if (is_power_of_2(rss_rings))
>
> Which is probably (x & {x-1)) == 0
What is your point? is_power_of_2() is the common helper function we
have in the kernel which makes that proper calculation.
And more importantly it has a meaningful name.
You make no contribution to this dicussion by saying how it may or
may not be implemented.
What makes it worse is that you didn't even bother to take the time to
check before making your statement. This wastes everyone's time.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists