aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/cxgb4/provider.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-05-21 20:54:55 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-05-21 20:54:55 -0400
commitc23ddf7857bdb2e8001b0a058603497c765a580d (patch)
treef1d826612114a17d6ab543b7095adf04b5ba614a /drivers/infiniband/hw/cxgb4/provider.c
parentda4f58ffa08a7b7012fab9c205fa0f6ba40fec42 (diff)
parentcc169165c82e14ea43e313f937a0a475ca97e588 (diff)
Merge tag 'rdma-for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
Pull InfiniBand/RDMA changes from Roland Dreier: - Add ocrdma hardware driver for Emulex IB-over-Ethernet adapters - Add generic and mlx4 support for "raw" QPs: allow suitably privileged applications to send and receive arbitrary packets directly to/from the hardware - Add "doorbell drop" handling to the cxgb4 driver - A fairly large batch of qib hardware driver changes - A few fixes for lockdep-detected issues - A few other miscellaneous fixes and cleanups Fix up trivial conflict in drivers/net/ethernet/emulex/benet/be.h. * tag 'rdma-for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: (53 commits) RDMA/cxgb4: Include vmalloc.h for vmalloc and vfree IB/mlx4: Fix mlx4_ib_add() error flow IB/core: Fix IB_SA_COMP_MASK macro IB/iser: Fix error flow in iser ep connection establishment IB/mlx4: Increase the number of vectors (EQs) available for ULPs RDMA/cxgb4: Add query_qp support RDMA/cxgb4: Remove kfifo usage RDMA/cxgb4: Use vmalloc() for debugfs QP dump RDMA/cxgb4: DB Drop Recovery for RDMA and LLD queues RDMA/cxgb4: Disable interrupts in c4iw_ev_dispatch() RDMA/cxgb4: Add DB Overflow Avoidance RDMA/cxgb4: Add debugfs RDMA memory stats cxgb4: DB Drop Recovery for RDMA and LLD queues cxgb4: Common platform specific changes for DB Drop Recovery cxgb4: Detect DB FULL events and notify RDMA ULD RDMA/cxgb4: Drop peer_abort when no endpoint found RDMA/cxgb4: Always wake up waiters in c4iw_peer_abort_intr() mlx4_core: Change bitmap allocator to work in round-robin fashion RDMA/nes: Don't call event handler if pointer is NULL RDMA/nes: Fix for the ORD value of the connecting peer ...
Diffstat (limited to 'drivers/infiniband/hw/cxgb4/provider.c')
-rw-r--r--drivers/infiniband/hw/cxgb4/provider.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c
index be1c18f44400..e084fdc6da7f 100644
--- a/drivers/infiniband/hw/cxgb4/provider.c
+++ b/drivers/infiniband/hw/cxgb4/provider.c
@@ -188,8 +188,10 @@ static int c4iw_deallocate_pd(struct ib_pd *pd)
188 php = to_c4iw_pd(pd); 188 php = to_c4iw_pd(pd);
189 rhp = php->rhp; 189 rhp = php->rhp;
190 PDBG("%s ibpd %p pdid 0x%x\n", __func__, pd, php->pdid); 190 PDBG("%s ibpd %p pdid 0x%x\n", __func__, pd, php->pdid);
191 c4iw_put_resource(&rhp->rdev.resource.pdid_fifo, php->pdid, 191 c4iw_put_resource(&rhp->rdev.resource.pdid_table, php->pdid);
192 &rhp->rdev.resource.pdid_fifo_lock); 192 mutex_lock(&rhp->rdev.stats.lock);
193 rhp->rdev.stats.pd.cur--;
194 mutex_unlock(&rhp->rdev.stats.lock);
193 kfree(php); 195 kfree(php);
194 return 0; 196 return 0;
195} 197}
@@ -204,14 +206,12 @@ static struct ib_pd *c4iw_allocate_pd(struct ib_device *ibdev,
204 206
205 PDBG("%s ibdev %p\n", __func__, ibdev); 207 PDBG("%s ibdev %p\n", __func__, ibdev);
206 rhp = (struct c4iw_dev *) ibdev; 208 rhp = (struct c4iw_dev *) ibdev;
207 pdid = c4iw_get_resource(&rhp->rdev.resource.pdid_fifo, 209 pdid = c4iw_get_resource(&rhp->rdev.resource.pdid_table);
208 &rhp->rdev.resource.pdid_fifo_lock);
209 if (!pdid) 210 if (!pdid)
210 return ERR_PTR(-EINVAL); 211 return ERR_PTR(-EINVAL);
211 php = kzalloc(sizeof(*php), GFP_KERNEL); 212 php = kzalloc(sizeof(*php), GFP_KERNEL);
212 if (!php) { 213 if (!php) {
213 c4iw_put_resource(&rhp->rdev.resource.pdid_fifo, pdid, 214 c4iw_put_resource(&rhp->rdev.resource.pdid_table, pdid);
214 &rhp->rdev.resource.pdid_fifo_lock);
215 return ERR_PTR(-ENOMEM); 215 return ERR_PTR(-ENOMEM);
216 } 216 }
217 php->pdid = pdid; 217 php->pdid = pdid;
@@ -222,6 +222,11 @@ static struct ib_pd *c4iw_allocate_pd(struct ib_device *ibdev,
222 return ERR_PTR(-EFAULT); 222 return ERR_PTR(-EFAULT);
223 } 223 }
224 } 224 }
225 mutex_lock(&rhp->rdev.stats.lock);
226 rhp->rdev.stats.pd.cur++;
227 if (rhp->rdev.stats.pd.cur > rhp->rdev.stats.pd.max)
228 rhp->rdev.stats.pd.max = rhp->rdev.stats.pd.cur;
229 mutex_unlock(&rhp->rdev.stats.lock);
225 PDBG("%s pdid 0x%0x ptr 0x%p\n", __func__, pdid, php); 230 PDBG("%s pdid 0x%0x ptr 0x%p\n", __func__, pdid, php);
226 return &php->ibpd; 231 return &php->ibpd;
227} 232}
@@ -438,6 +443,7 @@ int c4iw_register_device(struct c4iw_dev *dev)
438 (1ull << IB_USER_VERBS_CMD_REQ_NOTIFY_CQ) | 443 (1ull << IB_USER_VERBS_CMD_REQ_NOTIFY_CQ) |
439 (1ull << IB_USER_VERBS_CMD_CREATE_QP) | 444 (1ull << IB_USER_VERBS_CMD_CREATE_QP) |
440 (1ull << IB_USER_VERBS_CMD_MODIFY_QP) | 445 (1ull << IB_USER_VERBS_CMD_MODIFY_QP) |
446 (1ull << IB_USER_VERBS_CMD_QUERY_QP) |
441 (1ull << IB_USER_VERBS_CMD_POLL_CQ) | 447 (1ull << IB_USER_VERBS_CMD_POLL_CQ) |
442 (1ull << IB_USER_VERBS_CMD_DESTROY_QP) | 448 (1ull << IB_USER_VERBS_CMD_DESTROY_QP) |
443 (1ull << IB_USER_VERBS_CMD_POST_SEND) | 449 (1ull << IB_USER_VERBS_CMD_POST_SEND) |
@@ -460,6 +466,7 @@ int c4iw_register_device(struct c4iw_dev *dev)
460 dev->ibdev.destroy_ah = c4iw_ah_destroy; 466 dev->ibdev.destroy_ah = c4iw_ah_destroy;
461 dev->ibdev.create_qp = c4iw_create_qp; 467 dev->ibdev.create_qp = c4iw_create_qp;
462 dev->ibdev.modify_qp = c4iw_ib_modify_qp; 468 dev->ibdev.modify_qp = c4iw_ib_modify_qp;
469 dev->ibdev.query_qp = c4iw_ib_query_qp;
463 dev->ibdev.destroy_qp = c4iw_destroy_qp; 470 dev->ibdev.destroy_qp = c4iw_destroy_qp;
464 dev->ibdev.create_cq = c4iw_create_cq; 471 dev->ibdev.create_cq = c4iw_create_cq;
465 dev->ibdev.destroy_cq = c4iw_destroy_cq; 472 dev->ibdev.destroy_cq = c4iw_destroy_cq;