aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/qib/qib.h
diff options
context:
space:
mode:
authorMike Marciniszyn <mike.marciniszyn@intel.com>2012-07-19 09:03:56 -0400
committerRoland Dreier <roland@purestorage.com>2012-07-19 14:19:58 -0400
commit551ace124d0ef471e8a5fee3ef9e5bb7460251be (patch)
treed04b3700a959bc1d87f27ba4cc0752b6dd1725b9 /drivers/infiniband/hw/qib/qib.h
parentf3331f88a4b97530b7acd3112902524d9dc0688c (diff)
IB/qib: Reduce sdma_lock contention
Profiling has shown that sdma_lock is proving a bottleneck for performance. The situations include: - RDMA reads when krcvqs > 1 - post sends from multiple threads For RDMA read the current global qib_wq mechanism runs on all CPUs and contends for the sdma_lock when multiple RMDA read requests are fielded on differenct CPUs. For post sends, the direct call to qib_do_send() from multiple threads causes the contention. Since the sdma mechanism is per port, this fix converts the existing workqueue to a per port single thread workqueue to reduce the lock contention in the RDMA read case, and for any other case where the QP is scheduled via the workqueue mechanism from more than 1 CPU. For the post send case, This patch modifies the post send code to test for a non empty sdma engine. If the sdma is not idle the (now single thread) workqueue will be used to trigger the send engine instead of the direct call to qib_do_send(). Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/hw/qib/qib.h')
-rw-r--r--drivers/infiniband/hw/qib/qib.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/infiniband/hw/qib/qib.h b/drivers/infiniband/hw/qib/qib.h
index 7e62f4137148..cbe577151457 100644
--- a/drivers/infiniband/hw/qib/qib.h
+++ b/drivers/infiniband/hw/qib/qib.h
@@ -1,8 +1,8 @@
1#ifndef _QIB_KERNEL_H 1#ifndef _QIB_KERNEL_H
2#define _QIB_KERNEL_H 2#define _QIB_KERNEL_H
3/* 3/*
4 * Copyright (c) 2006, 2007, 2008, 2009, 2010 QLogic Corporation. 4 * Copyright (c) 2012 Intel Corporation. All rights reserved.
5 * All rights reserved. 5 * Copyright (c) 2006 - 2012 QLogic Corporation. All rights reserved.
6 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved. 6 * Copyright (c) 2003, 2004, 2005, 2006 PathScale, Inc. All rights reserved.
7 * 7 *
8 * This software is available to you under a choice of one of two 8 * This software is available to you under a choice of one of two
@@ -544,6 +544,7 @@ struct qib_pportdata {
544 544
545 /* read mostly */ 545 /* read mostly */
546 struct qib_sdma_desc *sdma_descq; 546 struct qib_sdma_desc *sdma_descq;
547 struct workqueue_struct *qib_wq;
547 struct qib_sdma_state sdma_state; 548 struct qib_sdma_state sdma_state;
548 dma_addr_t sdma_descq_phys; 549 dma_addr_t sdma_descq_phys;
549 volatile __le64 *sdma_head_dma; /* DMA'ed by chip */ 550 volatile __le64 *sdma_head_dma; /* DMA'ed by chip */
@@ -1267,6 +1268,11 @@ int qib_sdma_verbs_send(struct qib_pportdata *, struct qib_sge_state *,
1267/* ppd->sdma_lock should be locked before calling this. */ 1268/* ppd->sdma_lock should be locked before calling this. */
1268int qib_sdma_make_progress(struct qib_pportdata *dd); 1269int qib_sdma_make_progress(struct qib_pportdata *dd);
1269 1270
1271static inline int qib_sdma_empty(const struct qib_pportdata *ppd)
1272{
1273 return ppd->sdma_descq_added == ppd->sdma_descq_removed;
1274}
1275
1270/* must be called under qib_sdma_lock */ 1276/* must be called under qib_sdma_lock */
1271static inline u16 qib_sdma_descq_freecnt(const struct qib_pportdata *ppd) 1277static inline u16 qib_sdma_descq_freecnt(const struct qib_pportdata *ppd)
1272{ 1278{