aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHoang-Nam Nguyen <hnguyen@linux.vnet.ibm.com>2007-07-20 10:02:18 -0400
committerRoland Dreier <rolandd@cisco.com>2007-07-21 00:19:44 -0400
commit633a5aedaee1c96347b8a6c2ae7dceb47d0c910f (patch)
treef77782235201e10f743b3165b5b204b1afe7213f
parent5bb7d9290cd23a55906e4fe7a7fedecf29468c81 (diff)
IB/ehca: Generate async event when SRQ limit reached
Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com> Signed-off-by: Roland Dreier <rolandd@cisco.com>
-rw-r--r--drivers/infiniband/hw/ehca/ehca_irq.c42
1 files changed, 28 insertions, 14 deletions
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c
index 4fb01fcb63ae..71c0799b3500 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -175,9 +175,8 @@ error_data1:
175 175
176} 176}
177 177
178static void qp_event_callback(struct ehca_shca *shca, 178static void qp_event_callback(struct ehca_shca *shca, u64 eqe,
179 u64 eqe, 179 enum ib_event_type event_type, int fatal)
180 enum ib_event_type event_type)
181{ 180{
182 struct ib_event event; 181 struct ib_event event;
183 struct ehca_qp *qp; 182 struct ehca_qp *qp;
@@ -191,16 +190,26 @@ static void qp_event_callback(struct ehca_shca *shca,
191 if (!qp) 190 if (!qp)
192 return; 191 return;
193 192
194 ehca_error_data(shca, qp, qp->ipz_qp_handle.handle); 193 if (fatal)
194 ehca_error_data(shca, qp, qp->ipz_qp_handle.handle);
195 195
196 if (!qp->ib_qp.event_handler) 196 event.device = &shca->ib_device;
197 return;
198 197
199 event.device = &shca->ib_device; 198 if (qp->ext_type == EQPT_SRQ) {
200 event.event = event_type; 199 if (!qp->ib_srq.event_handler)
201 event.element.qp = &qp->ib_qp; 200 return;
202 201
203 qp->ib_qp.event_handler(&event, qp->ib_qp.qp_context); 202 event.event = fatal ? IB_EVENT_SRQ_ERR : event_type;
203 event.element.srq = &qp->ib_srq;
204 qp->ib_srq.event_handler(&event, qp->ib_srq.srq_context);
205 } else {
206 if (!qp->ib_qp.event_handler)
207 return;
208
209 event.event = event_type;
210 event.element.qp = &qp->ib_qp;
211 qp->ib_qp.event_handler(&event, qp->ib_qp.qp_context);
212 }
204 213
205 return; 214 return;
206} 215}
@@ -234,17 +243,17 @@ static void parse_identifier(struct ehca_shca *shca, u64 eqe)
234 243
235 switch (identifier) { 244 switch (identifier) {
236 case 0x02: /* path migrated */ 245 case 0x02: /* path migrated */
237 qp_event_callback(shca, eqe, IB_EVENT_PATH_MIG); 246 qp_event_callback(shca, eqe, IB_EVENT_PATH_MIG, 0);
238 break; 247 break;
239 case 0x03: /* communication established */ 248 case 0x03: /* communication established */
240 qp_event_callback(shca, eqe, IB_EVENT_COMM_EST); 249 qp_event_callback(shca, eqe, IB_EVENT_COMM_EST, 0);
241 break; 250 break;
242 case 0x04: /* send queue drained */ 251 case 0x04: /* send queue drained */
243 qp_event_callback(shca, eqe, IB_EVENT_SQ_DRAINED); 252 qp_event_callback(shca, eqe, IB_EVENT_SQ_DRAINED, 0);
244 break; 253 break;
245 case 0x05: /* QP error */ 254 case 0x05: /* QP error */
246 case 0x06: /* QP error */ 255 case 0x06: /* QP error */
247 qp_event_callback(shca, eqe, IB_EVENT_QP_FATAL); 256 qp_event_callback(shca, eqe, IB_EVENT_QP_FATAL, 1);
248 break; 257 break;
249 case 0x07: /* CQ error */ 258 case 0x07: /* CQ error */
250 case 0x08: /* CQ error */ 259 case 0x08: /* CQ error */
@@ -278,6 +287,11 @@ static void parse_identifier(struct ehca_shca *shca, u64 eqe)
278 ehca_err(&shca->ib_device, "Interface trace stopped."); 287 ehca_err(&shca->ib_device, "Interface trace stopped.");
279 break; 288 break;
280 case 0x14: /* first error capture info available */ 289 case 0x14: /* first error capture info available */
290 ehca_info(&shca->ib_device, "First error capture available");
291 break;
292 case 0x15: /* SRQ limit reached */
293 qp_event_callback(shca, eqe, IB_EVENT_SRQ_LIMIT_REACHED, 0);
294 break;
281 default: 295 default:
282 ehca_err(&shca->ib_device, "Unknown identifier: %x on %s.", 296 ehca_err(&shca->ib_device, "Unknown identifier: %x on %s.",
283 identifier, shca->ib_device.name); 297 identifier, shca->ib_device.name);