[openib-general] [PATCH] mthca - read byte count & read request size

Grant Grundler iod00d at hp.com
Tue Mar 7 08:25:59 PST 2006


On Tue, Mar 07, 2006 at 09:28:23AM +0200, Eli Cohen wrote:
> Using an enum confines the set of valid values the user can specify to
> the range 0-3

Enum does NOT confine the user.
Enum is a compile time type checking feature, not runtime.
User can pass in *any* int to modprobe command.

> But given 
> and it is easier to filter out invalid values. If I used
> raw values for the parameters then questions like how do I interpret a
> value of 1000 would rise: As invalid value so the parameter is ignored?
> Or maybe I would configure rbc to 512? or 1024?

Round up or down, or report an error as you see fit.
Personally, I'd round up (so 500 become 512 and 1000 becomes 1024)
if given the choice. But rejecting invalid values and not
loading the module is a reasonable response too.

thanks,
grant



More information about the general mailing list