[openib-general] [PATCH 5 of 5] IB/mthca: give reserved MTTs a separate cache line

Michael S. Tsirkin mst at mellanox.co.il
Fri Jan 5 00:26:30 PST 2007


>  > +	/* CPU writes to non-reserved MTTs, while HCA might DMA to reserved mtts */
>  > +	mdev->limits.reserved_mtts = max(dma_get_cache_alignment() / (int)sizeof(u64),
>  > +					 mdev->limits.reserved_mtts);
> 
> I don't follow this -- first of all, what guarantee is there that the
> reserved MTTs end on a cacheline boundary just because they take up
> more than a single cacheline?  It seems this should really be using
> ALIGN() somehow.

OK, I finally see what you mean. We must also make sure that mtt_base is
cache line aligned, I forgot this might not be the case.

> Second, isn't reserved_mtts in units of 64 bytes, not sizeof(u64)?

Aha, you are right of course.  This line does it:
	mthca_cmd.c:    dev_lim->reserved_mtts = 1 << (field >> 4);
Will fix next week.

Thanks for the comments!

-- 
MST




More information about the general mailing list