]> git.openfabrics.org - ~shefty/libmlx4.git/commit
max_recv_wr must be > 0 for non-SRQ QPs
authorJack Morgenstein <jackm@dev.mellanox.co.il>
Wed, 28 Nov 2007 10:44:20 +0000 (12:44 +0200)
committerRoland Dreier <rolandd@cisco.com>
Thu, 29 Nov 2007 03:46:24 +0000 (19:46 -0800)
commitaf257cd5a6a2ff7c041fccff60fd714e2d2d93a0
tree70f2f383fe7139c4d798297e279598bc9785a524
parentf5cf65dcc6dfc494c4652d323e7e104a135d29b5
max_recv_wr must be > 0 for non-SRQ QPs

max_recv_wr must also be non-zero for QPs which are not associated
with an SRQ.

Without this patch, if the userspace caller specifies max_recv_wr == 0
for a non-srq QP, the creation will be rejected in kernel space in
file infiniband/hw/mlx4/qp.c, function set_rq_size():

} else {
/* HW requires >= 1 RQ entry with >= 1 gather entry */
==> NOTE: if (is_user && (!cap->max_recv_wr || !cap->max_recv_sge))
return -EINVAL;

We make sure max_recv_sge is at least 1, but not max_recv_wr.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
src/verbs.c