aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-31 23:40:37 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-08-31 23:40:37 -0400
commit6db602d447fb6c3aeb020c5dff5219de317f8bb4 (patch)
tree379cfdff0c1f6eb66edfbc6a50dfde281602ca13 /drivers/infiniband
parente89a5a43b95cdc4305b7c8e8121a380f02476636 (diff)
parent5ff70cac3e98af64f9a1eaec9e762ff4927c26d1 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband: IB/ehca: SRQ fixes to enable IPoIB CM IB/ehca: Fix Small QP regressions
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/ehca/ehca_hca.c10
-rw-r--r--drivers/infiniband/hw/ehca/ehca_irq.c48
-rw-r--r--drivers/infiniband/hw/ehca/ehca_qp.c10
-rw-r--r--drivers/infiniband/hw/ehca/ipz_pt_fn.c2
4 files changed, 45 insertions, 25 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_hca.c b/drivers/infiniband/hw/ehca/ehca_hca.c
index fc19ef9fd96..cf22472d941 100644
--- a/drivers/infiniband/hw/ehca/ehca_hca.c
+++ b/drivers/infiniband/hw/ehca/ehca_hca.c
@@ -93,9 +93,13 @@ int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props)
93 props->max_pd = min_t(int, rblock->max_pd, INT_MAX); 93 props->max_pd = min_t(int, rblock->max_pd, INT_MAX);
94 props->max_ah = min_t(int, rblock->max_ah, INT_MAX); 94 props->max_ah = min_t(int, rblock->max_ah, INT_MAX);
95 props->max_fmr = min_t(int, rblock->max_mr, INT_MAX); 95 props->max_fmr = min_t(int, rblock->max_mr, INT_MAX);
96 props->max_srq = 0; 96
97 props->max_srq_wr = 0; 97 if (EHCA_BMASK_GET(HCA_CAP_SRQ, shca->hca_cap)) {
98 props->max_srq_sge = 0; 98 props->max_srq = props->max_qp;
99 props->max_srq_wr = props->max_qp_wr;
100 props->max_srq_sge = 3;
101 }
102
99 props->max_pkeys = 16; 103 props->max_pkeys = 16;
100 props->local_ca_ack_delay 104 props->local_ca_ack_delay
101 = rblock->local_ca_ack_delay; 105 = rblock->local_ca_ack_delay;
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c
index ee06d8bd739..a925ea52443 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -175,41 +175,55 @@ error_data1:
175 175
176} 176}
177 177
178static void qp_event_callback(struct ehca_shca *shca, u64 eqe, 178static void dispatch_qp_event(struct ehca_shca *shca, struct ehca_qp *qp,
179 enum ib_event_type event_type, int fatal) 179 enum ib_event_type event_type)
180{ 180{
181 struct ib_event event; 181 struct ib_event event;
182 struct ehca_qp *qp;
183 u32 token = EHCA_BMASK_GET(EQE_QP_TOKEN, eqe);
184
185 read_lock(&ehca_qp_idr_lock);
186 qp = idr_find(&ehca_qp_idr, token);
187 read_unlock(&ehca_qp_idr_lock);
188
189
190 if (!qp)
191 return;
192
193 if (fatal)
194 ehca_error_data(shca, qp, qp->ipz_qp_handle.handle);
195 182
196 event.device = &shca->ib_device; 183 event.device = &shca->ib_device;
184 event.event = event_type;
197 185
198 if (qp->ext_type == EQPT_SRQ) { 186 if (qp->ext_type == EQPT_SRQ) {
199 if (!qp->ib_srq.event_handler) 187 if (!qp->ib_srq.event_handler)
200 return; 188 return;
201 189
202 event.event = fatal ? IB_EVENT_SRQ_ERR : event_type;
203 event.element.srq = &qp->ib_srq; 190 event.element.srq = &qp->ib_srq;
204 qp->ib_srq.event_handler(&event, qp->ib_srq.srq_context); 191 qp->ib_srq.event_handler(&event, qp->ib_srq.srq_context);
205 } else { 192 } else {
206 if (!qp->ib_qp.event_handler) 193 if (!qp->ib_qp.event_handler)
207 return; 194 return;
208 195
209 event.event = event_type;
210 event.element.qp = &qp->ib_qp; 196 event.element.qp = &qp->ib_qp;
211 qp->ib_qp.event_handler(&event, qp->ib_qp.qp_context); 197 qp->ib_qp.event_handler(&event, qp->ib_qp.qp_context);
212 } 198 }
199}
200
201static void qp_event_callback(struct ehca_shca *shca, u64 eqe,
202 enum ib_event_type event_type, int fatal)
203{
204 struct ehca_qp *qp;
205 u32 token = EHCA_BMASK_GET(EQE_QP_TOKEN, eqe);
206
207 read_lock(&ehca_qp_idr_lock);
208 qp = idr_find(&ehca_qp_idr, token);
209 read_unlock(&ehca_qp_idr_lock);
210
211 if (!qp)
212 return;
213
214 if (fatal)
215 ehca_error_data(shca, qp, qp->ipz_qp_handle.handle);
216
217 dispatch_qp_event(shca, qp, fatal && qp->ext_type == EQPT_SRQ ?
218 IB_EVENT_SRQ_ERR : event_type);
219
220 /*
221 * eHCA only processes one WQE at a time for SRQ base QPs,
222 * so the last WQE has been processed as soon as the QP enters
223 * error state.
224 */
225 if (fatal && qp->ext_type == EQPT_SRQBASE)
226 dispatch_qp_event(shca, qp, IB_EVENT_QP_LAST_WQE_REACHED);
213 227
214 return; 228 return;
215} 229}
diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c
index b178cba9634..84d435a5ee1 100644
--- a/drivers/infiniband/hw/ehca/ehca_qp.c
+++ b/drivers/infiniband/hw/ehca/ehca_qp.c
@@ -600,10 +600,12 @@ static struct ehca_qp *internal_create_qp(
600 600
601 if (EHCA_BMASK_GET(HCA_CAP_MINI_QP, shca->hca_cap) 601 if (EHCA_BMASK_GET(HCA_CAP_MINI_QP, shca->hca_cap)
602 && !(context && udata)) { /* no small QP support in userspace ATM */ 602 && !(context && udata)) { /* no small QP support in userspace ATM */
603 ehca_determine_small_queue( 603 if (HAS_SQ(my_qp))
604 &parms.squeue, max_send_sge, is_llqp); 604 ehca_determine_small_queue(
605 ehca_determine_small_queue( 605 &parms.squeue, max_send_sge, is_llqp);
606 &parms.rqueue, max_recv_sge, is_llqp); 606 if (HAS_RQ(my_qp))
607 ehca_determine_small_queue(
608 &parms.rqueue, max_recv_sge, is_llqp);
607 parms.qp_storage = 609 parms.qp_storage =
608 (parms.squeue.is_small || parms.rqueue.is_small); 610 (parms.squeue.is_small || parms.rqueue.is_small);
609 } 611 }
diff --git a/drivers/infiniband/hw/ehca/ipz_pt_fn.c b/drivers/infiniband/hw/ehca/ipz_pt_fn.c
index a090c679c39..29bd476fbd5 100644
--- a/drivers/infiniband/hw/ehca/ipz_pt_fn.c
+++ b/drivers/infiniband/hw/ehca/ipz_pt_fn.c
@@ -172,7 +172,7 @@ static void free_small_queue_page(struct ipz_queue *queue, struct ehca_pd *pd)
172 unsigned long bit; 172 unsigned long bit;
173 int free_page = 0; 173 int free_page = 0;
174 174
175 bit = ((unsigned long)queue->queue_pages[0] & PAGE_MASK) 175 bit = ((unsigned long)queue->queue_pages[0] & ~PAGE_MASK)
176 >> (order + 9); 176 >> (order + 9);
177 177
178 mutex_lock(&pd->lock); 178 mutex_lock(&pd->lock);