[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AE90C24D6B3A694183C094C60CF0A2F6D8AF4B@saturn3.aculab.com>
Date: Tue, 17 Jan 2012 17:22:18 -0000
From: "David Laight" <David.Laight@...LAB.COM>
To: "David Miller" <davem@...emloft.net>, <yevgenyp@...lanox.co.il>
Cc: <netdev@...r.kernel.org>, <amirv@...lanox.co.il>
Subject: RE: [PATCH net] mlx4_en: set number of rx rings used by RSS using ethtool
> > + /* 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
David
--
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