[openib-general][RFC][PATCH] mthca: HCA initialization parameters

Leonid Arsh leonida at voltaire.com
Sun May 21 04:38:54 PDT 2006


Roland Dreier wrote:
>     Leonid> Hello, we need a capability to change the HCA parameters,
>     Leonid> in order to tune its resources.
>
>     Leonid>    There is a special structure 'mthca_profile' in the
>     Leonid> MTHA driver, used during the HCA initialization and
>     Leonid> determining different HCA initialization parameters, such
>     Leonid> as maximum number of QPs, CQs, address vectors etc.
>     Leonid> Unfortunately, the parameters can not be defined outside
>     Leonid> the driver.
>
>     Leonid>    Attached file implements a number of the module
>     Leonid> parameters allowing to define the 'mthca_profile' values.
>
> Thanks, I've held off on doing this because adding these module
> parameters doesn't handle multiple different HCAs very gracefully.
> But I'm not sure if I really have a better solution -- (ab)using
> request_firmware() maybe?
>   
Do you mean querying the firmware to determine the type of the HCA?
> Does it make sense to tune all of these values?  
I'm not sure that every one of the parameters will be used but my
feeling is that we want to let the user change the whole profile for
completeness.

> For example is anyone
> really changing the size of the user access region context?  And
> certainly making num_uar tunable doesn't make any sense -- what do we
> do if the user asks for more UARs than the PCI BAR can cover?  And
> what do we save if someone asks for fewer?
>   
You are right, we should enforce some boundaries here. I guess that
only power users will tweak the profile parameters.
> The scheme of making the module parameter take effect only if its
> non-zero seems really confusing to me.  Someone is going to look in
> sysfs and see that num_qp is 0 and get confused.
>   
We have two ideas here:
1. We can set the access permissions to 0 and that way no sysfs entries 
will be created.
2. Update the module parameters with the real values after the
initialization phase.

What do you think ?
> Also I think all of these values need to be powers of 2, so that
> should probably be enforced somehow (either by making the parameters
> be log-base-2 values, or using roundup_pow_of_two -- I'm not sure
> which is better).
>   
Sounds like the right thing to do, will update the patch.
>  - R.



More information about the general mailing list