[ofa-general] Re: [PATCH] libmlx4: WQE shift calculation
Roland Dreier
rdreier at cisco.com
Tue May 15 07:26:49 PDT 2007
> the code that calculates WQ size is quite different between kernel and
> user. I think that writing the code in a way that will allow to copy it
> as is between kernel and user is in place. Would like me to send such a
> patch?
Actually I've been thinking that perhaps we should let libmlx4 tell
mlx4 in the kernel what WQE sizes it wants to use. Otherwise it will
probably be a pain if we want to use a small BB for SQs, etc.
> case IBV_QPT_RC:
> - size += sizeof (struct mlx4_wqe_raddr_seg);
> + size += sizeof (struct mlx4_wqe_raddr_seg) +
> + sizeof (struct mlx4_wqe_atomic_seg);
> /*
> * An atomic op will require an atomic segment, a
> * remote address segment and one scatter entry.
This looks wrong. Why do we have to allow for an atomic segment for
normal operations? The code that starts with the context above:
/*
* An atomic op will require an atomic segment, a
* remote address segment and one scatter entry.
*/
if (size < (sizeof (struct mlx4_wqe_atomic_seg) +
sizeof (struct mlx4_wqe_raddr_seg) +
sizeof (struct mlx4_wqe_data_seg)))
size = (sizeof (struct mlx4_wqe_atomic_seg) +
sizeof (struct mlx4_wqe_raddr_seg) +
sizeof (struct mlx4_wqe_data_seg));
seems to take into account leaving space for atomic operations.
- R.
More information about the general
mailing list