linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2/5] ehca: Generate event when SRQ limit reached
@ 2007-07-20 14:02 Hoang-Nam Nguyen
  2007-07-21  4:12 ` Roland Dreier
  0 siblings, 1 reply; 3+ messages in thread
From: Hoang-Nam Nguyen @ 2007-07-20 14:02 UTC (permalink / raw)
  To: Roland Dreier, linux-kernel, linuxppc-dev, openib-general
  Cc: fenkes, raisch, stefan.roscher

From: Joachim Fenkes <fenkes@de.ibm.com>
Date: Thu, 19 Jul 2007 20:51:43 +0200
Subject: [PATCH 2/5] IB/ehca: Generate event when SRQ limit reached

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
---
 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 4fb01fc..71c0799 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -175,9 +175,8 @@ error_data1:
 
 }
 
-static void qp_event_callback(struct ehca_shca *shca,
-			      u64 eqe,
-			      enum ib_event_type event_type)
+static void qp_event_callback(struct ehca_shca *shca, u64 eqe,
+			      enum ib_event_type event_type, int fatal)
 {
 	struct ib_event event;
 	struct ehca_qp *qp;
@@ -191,16 +190,26 @@ static void qp_event_callback(struct ehca_shca *shca,
 	if (!qp)
 		return;
 
-	ehca_error_data(shca, qp, qp->ipz_qp_handle.handle);
+	if (fatal)
+		ehca_error_data(shca, qp, qp->ipz_qp_handle.handle);
 
-	if (!qp->ib_qp.event_handler)
-		return;
+	event.device = &shca->ib_device;
 
-	event.device     = &shca->ib_device;
-	event.event      = event_type;
-	event.element.qp = &qp->ib_qp;
+	if (qp->ext_type == EQPT_SRQ) {
+		if (!qp->ib_srq.event_handler)
+			return;
 
-	qp->ib_qp.event_handler(&event, qp->ib_qp.qp_context);
+		event.event = fatal ? IB_EVENT_SRQ_ERR : event_type;
+		event.element.srq = &qp->ib_srq;
+		qp->ib_srq.event_handler(&event, qp->ib_srq.srq_context);
+	} else {
+		if (!qp->ib_qp.event_handler)
+			return;
+
+		event.event = event_type;
+		event.element.qp = &qp->ib_qp;
+		qp->ib_qp.event_handler(&event, qp->ib_qp.qp_context);
+	}
 
 	return;
 }
@@ -234,17 +243,17 @@ static void parse_identifier(struct ehca_shca *shca, u64 eqe)
 
 	switch (identifier) {
 	case 0x02: /* path migrated */
-		qp_event_callback(shca, eqe, IB_EVENT_PATH_MIG);
+		qp_event_callback(shca, eqe, IB_EVENT_PATH_MIG, 0);
 		break;
 	case 0x03: /* communication established */
-		qp_event_callback(shca, eqe, IB_EVENT_COMM_EST);
+		qp_event_callback(shca, eqe, IB_EVENT_COMM_EST, 0);
 		break;
 	case 0x04: /* send queue drained */
-		qp_event_callback(shca, eqe, IB_EVENT_SQ_DRAINED);
+		qp_event_callback(shca, eqe, IB_EVENT_SQ_DRAINED, 0);
 		break;
 	case 0x05: /* QP error */
 	case 0x06: /* QP error */
-		qp_event_callback(shca, eqe, IB_EVENT_QP_FATAL);
+		qp_event_callback(shca, eqe, IB_EVENT_QP_FATAL, 1);
 		break;
 	case 0x07: /* CQ error */
 	case 0x08: /* CQ error */
@@ -278,6 +287,11 @@ static void parse_identifier(struct ehca_shca *shca, u64 eqe)
 		ehca_err(&shca->ib_device, "Interface trace stopped.");
 		break;
 	case 0x14: /* first error capture info available */
+		ehca_info(&shca->ib_device, "First error capture available");
+		break;
+	case 0x15: /* SRQ limit reached */
+		qp_event_callback(shca, eqe, IB_EVENT_SRQ_LIMIT_REACHED, 0);
+		break;
 	default:
 		ehca_err(&shca->ib_device, "Unknown identifier: %x on %s.",
 			 identifier, shca->ib_device.name);
-- 
1.5.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/5] ehca: Generate event when SRQ limit reached
  2007-07-20 14:02 [PATCH 2/5] ehca: Generate event when SRQ limit reached Hoang-Nam Nguyen
@ 2007-07-21  4:12 ` Roland Dreier
  2007-07-30 15:02   ` Hoang-Nam Nguyen
  0 siblings, 1 reply; 3+ messages in thread
From: Roland Dreier @ 2007-07-21  4:12 UTC (permalink / raw)
  To: Hoang-Nam Nguyen
  Cc: fenkes, linux-kernel, openib-general, linuxppc-dev, raisch,
	stefan.roscher

thanks, applied.

BTW, does your SRQ-capable hardware support generating the "last WQE
reached" event?  There's not any reliable way to avoid problems when
destroying QPs attached to an SRQ without it, and the IB spec requires
CAs that support SRQs to generate it (o11-5.2.5 in chapter 11 of vol 1).

I don't see any code in ehca to generate the event, and IPoIB CM at
least will be very unhappy when using SRQs if the event is not
generated.

 - R.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH 2/5] ehca: Generate event when SRQ limit reached
  2007-07-21  4:12 ` Roland Dreier
@ 2007-07-30 15:02   ` Hoang-Nam Nguyen
  0 siblings, 0 replies; 3+ messages in thread
From: Hoang-Nam Nguyen @ 2007-07-30 15:02 UTC (permalink / raw)
  To: Roland Dreier
  Cc: fenkes, linux-kernel, openib-general, linuxppc-dev, raisch,
	stefan.roscher

Hi,
> BTW, does your SRQ-capable hardware support generating the "last WQE
> reached" event?  There's not any reliable way to avoid problems when
> destroying QPs attached to an SRQ without it, and the IB spec requires
> CAs that support SRQs to generate it (o11-5.2.5 in chapter 11 of vol 1).
> 
> I don't see any code in ehca to generate the event, and IPoIB CM at
> least will be very unhappy when using SRQs if the event is not
> generated.
Thanks for this good catch. We're investigating how to implement this.
Will keep you updated.
Regards
Nam

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-07-30 14:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-20 14:02 [PATCH 2/5] ehca: Generate event when SRQ limit reached Hoang-Nam Nguyen
2007-07-21  4:12 ` Roland Dreier
2007-07-30 15:02   ` Hoang-Nam Nguyen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).