aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/cxgb4
diff options
context:
space:
mode:
authorVipul Pandya <vipul@chelsio.com>2013-03-14 01:09:04 -0400
committerDavid S. Miller <davem@davemloft.net>2013-03-14 11:35:59 -0400
commit9919d5bd01b9eaf4928439e804dd70de24ea9637 (patch)
treeab416919eae862b333fba267839b062b241004ee /drivers/infiniband/hw/cxgb4
parent3b174d942c927a5064c890ed7b326673c8fa1679 (diff)
RDMA/cxgb4: Fix onchip queue support for T5
T5 adapter does not support onchip queue memory. Present logic fails to allocate QP for T5 and returns an error. Also, if module parameter ocqp_support is zero then we are unable to allocate QP which should not be the case. Ideally if ocqp_support parameter is 0 or onchip queue support is disable then host QP should be allocated before returning an error. Signed-off-by: Vipul Pandya <vipul@chelsio.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/infiniband/hw/cxgb4')
-rw-r--r--drivers/infiniband/hw/cxgb4/qp.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/drivers/infiniband/hw/cxgb4/qp.c b/drivers/infiniband/hw/cxgb4/qp.c
index 90833d701631..9fe6f1e84373 100644
--- a/drivers/infiniband/hw/cxgb4/qp.c
+++ b/drivers/infiniband/hw/cxgb4/qp.c
@@ -140,7 +140,7 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq,
140 int wr_len; 140 int wr_len;
141 struct c4iw_wr_wait wr_wait; 141 struct c4iw_wr_wait wr_wait;
142 struct sk_buff *skb; 142 struct sk_buff *skb;
143 int ret; 143 int ret = 0;
144 int eqsize; 144 int eqsize;
145 145
146 wq->sq.qid = c4iw_get_qpid(rdev, uctx); 146 wq->sq.qid = c4iw_get_qpid(rdev, uctx);
@@ -180,17 +180,14 @@ static int create_qp(struct c4iw_rdev *rdev, struct t4_wq *wq,
180 } 180 }
181 181
182 if (user) { 182 if (user) {
183 ret = alloc_oc_sq(rdev, &wq->sq); 183 if (alloc_oc_sq(rdev, &wq->sq) && alloc_host_sq(rdev, &wq->sq))
184 if (ret)
185 goto free_hwaddr; 184 goto free_hwaddr;
186 185 } else {
187 ret = alloc_host_sq(rdev, &wq->sq);
188 if (ret)
189 goto free_sq;
190 } else
191 ret = alloc_host_sq(rdev, &wq->sq); 186 ret = alloc_host_sq(rdev, &wq->sq);
192 if (ret) 187 if (ret)
193 goto free_hwaddr; 188 goto free_hwaddr;
189 }
190
194 memset(wq->sq.queue, 0, wq->sq.memsize); 191 memset(wq->sq.queue, 0, wq->sq.memsize);
195 dma_unmap_addr_set(&wq->sq, mapping, wq->sq.dma_addr); 192 dma_unmap_addr_set(&wq->sq, mapping, wq->sq.dma_addr);
196 193