RE: [net-next 08/15] i40e/i40evf: organize and re-number feature flags

From
David Laight <hidden>
Date
2017-08-15 12:42:44
Reply to
Keller, Jacob E, 2017-08-14
From: Keller, Jacob E
Sent: 14 August 2017 23:11
quoted
From: David Miller [mailto:davem@davemloft.net]
Sent: Saturday, August 12, 2017 1:04 PM
From: Jeff Kirsher <redacted>
Date: Sat, 12 Aug 2017 04:08:41 -0700
quoted
Also ensure that the flags variable is actually a u64 to guarantee
64bits of space on all architectures.
Why?  You don't need 64-bits, you only need 27.

This will be unnecessarily expensive on 32-bit platforms.

Please don't do this.
I suppose a better method would be to switch to using a declare_bitmap instead, so that it
automatically sizes based on the number of flags we have. The reason we chose 64bits is because we
will add flags in the future, as we originally had more than 32 flags prior to this patch until we
moved some into a separate field.

But now that I think about it, using DECLARE_BITMAP makes more sense, though it's a bit more invasive
of the code.
And horribly stupid unless you really need dynamic indexes.

	David
Thread (23 messages) 23 messages, 5 authors, last reply 2017-08-15
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help