diff options
-rw-r--r-- | drivers/infiniband/hw/ehca/ehca_irq.c | 42 |
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 | ||
178 | static void qp_event_callback(struct ehca_shca *shca, | 178 | static 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); |