[ofa-general] Re: [PATCH 1 of 2] IB/mlx4: For 64-bit systems, use large virtually contiguous queue buffers (vmap)

Jack Morgenstein jackm at dev.mellanox.co.il
Sat Feb 2 22:52:45 PST 2008


On Friday 01 February 2008 22:33, Roland Dreier wrote:
>  > --- infiniband.orig/drivers/infiniband/hw/mlx4/qp.c	2008-01-27 10:44:25.000000000 +0200
>  > +++ infiniband/drivers/infiniband/hw/mlx4/qp.c	2008-01-27 10:52:21.000000000 +0200
>  > @@ -96,7 +96,7 @@ static int is_qp0(struct mlx4_ib_dev *de
>  >  
>  >  static void *get_wqe(struct mlx4_ib_qp *qp, int offset)
>  >  {
>  > -	if (qp->buf.nbufs == 1)
>  > +	if (BITS_PER_LONG == 64 || qp->buf.nbufs == 1)
>  >  		return qp->buf.u.direct.buf + offset;
>  >  	else
>  >  		return qp->buf.u.page_list[offset >> PAGE_SHIFT].buf +
> 
> I don't see any changes to cq.c -- it seems we would want to make the
> same optimization there, right?  Or is it actually better to walk the
> two-level stuff ourselves when we can?
> 

We can certainly do the same optimization for CQs. The reason it wasn't done
was that we focused on the shrinking WQE here -- and for a work request to 
span multiple WQE basic blocks, the work queue address space must be
virtually contiguous -- so the vmap optimization was necessary.

We just didn't expand it further at the time.

- Jack 



More information about the general mailing list