[ofa-general] [PATCH RFC] rds: add iwarp support

Olaf Kirch olaf.kirch at Oracle.com
Fri Jul 4 01:54:05 PDT 2008


> +int rds_iwarp_flush_mr_pool(struct rds_iwarp_mr_pool *pool, int free_all)
> +{
...
> +	spin_lock_irqsave(&pool->list_lock, flags);
> +	/* Get the list of all MRs to be dropped. Ordering matters -
> +	 * we want to put drop_list ahead of free_list. */
> +	list_splice_init(&pool->free_list, &unmap_list);
> +	list_splice_init(&pool->drop_list, &unmap_list);
> +	if (free_all)
> +		list_splice_init(&pool->clean_list, &unmap_list);
> +	spin_unlock_irqrestore(&pool->list_lock, flags);
> +
> +	free_goal = rds_iwarp_flush_goal(pool, free_all);
> +
> +	if (list_empty(&unmap_list))
> +		goto out;
> +
> +	ib_dereg_mr(ibmr->fastreg_mr);

This probably cannot work. ibmr is uninitialized at this point.
The ib_rdma code uses ib_unmap_fmr(&fmr_list) which does a batched
unmap. If iWARP doesn't have an equivalent mechanism, we might as
well destroy each iwarp MR immediately when it is released.

OTOH if we want to go for maximum code sharing, one could put the
ib_dereg_mr call into __rds_iwarp_teardown_mr, so that it gets cleaned
up in the following loop:

> +	/* Now we can destroy the DMA mapping and unpin any pages */
> +	list_for_each_entry_safe(ibmr, next, &unmap_list, list) {
> +		unpinned += ibmr->sg_len;
> +		__rds_iwarp_teardown_mr(ibmr);
> +		if (nfreed < free_goal || ibmr->remap_count >= pool->fmr_attr.max_maps) {
> +			rds_iwarp_stats_inc(s_iwarp_rdma_mr_free);
> +			list_del(&ibmr->list);
> +			kfree(ibmr);
> +			nfreed++;
> +		}
> +		ncleaned++;
> +	}

Olaf
-- 
Olaf Kirch  |  --- o --- Nous sommes du soleil we love when we play
okir at lst.de |    / | \   sol.dhoop.naytheet.ah kin.ir.samse.qurax



More information about the general mailing list