Re: [RFC 7/8] IB/srp: try to use larger FMR sizes to cover our mappings

Or Gerlitz
2011-01-20T10:24:11Z

David Dillow wrote:
> Now that we can get larger SG lists, we can take advantage of HCAs that
> allow us to use larger FMR sizes. In many cases, we can use up to 512
> entries, so start there and work our way down.

I'm not clear what this patch really tries to do but before that, going
to low level details

> + for (max_pages_per_fmr = SRP_FMR_SIZE;
> + max_pages_per_fmr >= SRP_FMR_MIN_SIZE;
> + max_pages_per_fmr /= 2, srp_dev->fmr_max_size /= 2) {
> + fmr_param.pool_size = SRP_FMR_POOL_SIZE;
> + fmr_param.dirty_watermark = SRP_FMR_DIRTY_SIZE;
> + fmr_param.cache = 1;
> + fmr_param.max_pages_per_fmr = SRP_FMR_SIZE;
> + fmr_param.page_shift = fmr_page_shift;

> + srp_dev->fmr_pool = ib_create_fmr_pool(srp_dev->pd, &fmr_param);
> + if (!IS_ERR(srp_dev->fmr_pool))
> + break;
> + }

aren't stepping on srp_dev->fmr_pool on each invocation of the for loop? didn't you
want page_shift and/or max_pages_per_fmr to change throughout the loop?