[MTHCA] 1361 fix added a bug: now all applications, creating QP with zero receive...
authorleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 13 Nov 2008 17:41:17 +0000 (17:41 +0000)
committerleonidk <leonidk@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Thu, 13 Nov 2008 17:41:17 +0000 (17:41 +0000)
This patch fixes that.

git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@1761 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

hw/mthca/kernel/mthca_qp.c

index 8242c62..4a95d9c 100644 (file)
@@ -1374,6 +1374,12 @@ static int mthca_set_qp_size(struct mthca_dev *dev, struct ib_qp_cap *cap,
        if (qp->transport == MLX && cap->max_recv_sge + 2 > (u32)dev->limits.max_sg)\r
                return -EINVAL;\r
 \r
+       /* Enable creating zero-sized QPs */\r
+       if (!cap->max_recv_wr)\r
+               cap->max_recv_wr = 1;\r
+       if (!cap->max_send_wr)\r
+               cap->max_send_wr = 1;\r
+       \r
        if (mthca_is_memfree(dev)) {\r
                qp->rq.max = cap->max_recv_wr ?\r
                        roundup_pow_of_two(cap->max_recv_wr) : 0;\r