[ofa-general] Re: [PATCH] mlx4_core: enable changing default max HCA resource limits at run time -- reposting

Jack Morgenstein jackm at dev.mellanox.co.il
Mon Apr 28 23:40:37 PDT 2008


On Monday 28 April 2008 18:50, Roland Dreier wrote:
> Hmm... wouldn't it be better to follow the same interface as ib_mthca
> and have consumers pass in the numbers instead of the log sizes?  Having
> two different ways of changing the same parameters seems pretty confusing.
> 
Dotan also mentioned this.  Our preference was to change ib_mthca to use logs
as well, since this way the user knows exactly what the amounts will be (instead
of having a hidden "round up to next or equal power of 2").

I just did not get around to doing this change for ib_mthca. I'll do this
for the next release.

- Jack

P.S.
BTW, I think there is a bug in the mthca driver, which messes things
up if the profile numbers are NOT powers of 2:
(from mthca_make_profile, in file mthca_profile.c):
	for (i = 0; i < MTHCA_RES_NUM; ++i) {
		profile[i].type     = i;
		profile[i].log_num  = max(ffs(profile[i].num) - 1, 0);
		profile[i].size    *= profile[i].num;

  should be
	for (i = 0; i < MTHCA_RES_NUM; ++i) {
		profile[i].type     = i;
		profile[i].num      = roundup_pow_of_two(profile[i].num);
		profile[i].log_num  = ilog2(profile[i].num);
		profile[i].size    *= profile[i].num;

since later the procedure assumes that all sizes are powers of 2.





More information about the general mailing list