linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] IB/ehca: Two minor circumventions
@ 2008-07-21 11:13 Joachim Fenkes
  2008-07-21 11:15 ` [PATCH 1/2] IB/ehca: Filter PATH_MIG events if QP was never armed Joachim Fenkes
  2008-07-21 11:16 ` [PATCH 2/2] IB/ehca: Default value for Local CA ACK Delay Joachim Fenkes
  0 siblings, 2 replies; 4+ messages in thread
From: Joachim Fenkes @ 2008-07-21 11:13 UTC (permalink / raw)
  To: LinuxPPC-Dev, LKML, OF-General, Roland Dreier, OF-EWG
  Cc: Stefan Roscher, Alexander Schmidt, Christoph Raisch

[1/2] fixes spurious PATH_MIG events with certain FW versions
[2/2] inserts a default value for Local CA ACK Delay

Please review these patches and queue them for inclusion into the kernel if
you think they're okay.

Thanks!
  Joachim

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

* [PATCH 1/2] IB/ehca: Filter PATH_MIG events if QP was never armed
  2008-07-21 11:13 [PATCH 0/2] IB/ehca: Two minor circumventions Joachim Fenkes
@ 2008-07-21 11:15 ` Joachim Fenkes
  2008-07-21 11:16 ` [PATCH 2/2] IB/ehca: Default value for Local CA ACK Delay Joachim Fenkes
  1 sibling, 0 replies; 4+ messages in thread
From: Joachim Fenkes @ 2008-07-21 11:15 UTC (permalink / raw)
  To: LinuxPPC-Dev, LKML, OF-General, Roland Dreier, OF-EWG
  Cc: Stefan Roscher, Alexander Schmidt, Christoph Raisch

Certain firmware versions sometimes cause spurious PATH_MIG events to occur
during QP creation. Filter these events by making sure PATH_MIG events are
only handed down when they actually make sense (i.e. when the QP has been
armed at least once).

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
---
 drivers/infiniband/hw/ehca/ehca_classes.h |    1 +
 drivers/infiniband/hw/ehca/ehca_irq.c     |    4 ++++
 drivers/infiniband/hw/ehca/ehca_qp.c      |    2 ++
 3 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_classes.h b/drivers/infiniband/hw/ehca/ehca_classes.h
index 1e9e99a..0b0618e 100644
--- a/drivers/infiniband/hw/ehca/ehca_classes.h
+++ b/drivers/infiniband/hw/ehca/ehca_classes.h
@@ -194,6 +194,7 @@ struct ehca_qp {
 	u32 packet_count;
 	atomic_t nr_events; /* events seen */
 	wait_queue_head_t wait_completion;
+	int mig_armed;
 };
 
 #define IS_SRQ(qp) (qp->ext_type == EQPT_SRQ)
diff --git a/drivers/infiniband/hw/ehca/ehca_irq.c b/drivers/infiniband/hw/ehca/ehca_irq.c
index 0792d93..99642a6 100644
--- a/drivers/infiniband/hw/ehca/ehca_irq.c
+++ b/drivers/infiniband/hw/ehca/ehca_irq.c
@@ -178,6 +178,10 @@ static void dispatch_qp_event(struct ehca_shca *shca, struct ehca_qp *qp,
 {
 	struct ib_event event;
 
+	/* PATH_MIG without the QP ever having been armed is false alarm */
+	if (event_type == IB_EVENT_PATH_MIG && !qp->mig_armed)
+		return;
+
 	event.device = &shca->ib_device;
 	event.event = event_type;
 
diff --git a/drivers/infiniband/hw/ehca/ehca_qp.c b/drivers/infiniband/hw/ehca/ehca_qp.c
index 3f59587..ea13efd 100644
--- a/drivers/infiniband/hw/ehca/ehca_qp.c
+++ b/drivers/infiniband/hw/ehca/ehca_qp.c
@@ -1460,6 +1460,8 @@ static int internal_modify_qp(struct ib_qp *ibqp,
 			goto modify_qp_exit2;
 		}
 		mqpcb->path_migration_state = attr->path_mig_state + 1;
+		if (attr->path_mig_state == IB_MIG_REARM)
+			my_qp->mig_armed = 1;
 		update_mask |=
 			EHCA_BMASK_SET(MQPCB_MASK_PATH_MIGRATION_STATE, 1);
 	}
-- 
1.5.5

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

* [PATCH 2/2] IB/ehca: Default value for Local CA ACK Delay
  2008-07-21 11:13 [PATCH 0/2] IB/ehca: Two minor circumventions Joachim Fenkes
  2008-07-21 11:15 ` [PATCH 1/2] IB/ehca: Filter PATH_MIG events if QP was never armed Joachim Fenkes
@ 2008-07-21 11:16 ` Joachim Fenkes
  2008-07-21 16:34   ` Roland Dreier
  1 sibling, 1 reply; 4+ messages in thread
From: Joachim Fenkes @ 2008-07-21 11:16 UTC (permalink / raw)
  To: LinuxPPC-Dev, LKML, OF-General, Roland Dreier, OF-EWG
  Cc: Stefan Roscher, Alexander Schmidt, Christoph Raisch

Some firmware versions report a Local CA ACK Delay of 0. In that case,
return a more sensible default value of 12 (-> 16 msec) instead.

Signed-off-by: Joachim Fenkes <fenkes@de.ibm.com>
---
 drivers/infiniband/hw/ehca/ehca_hca.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/infiniband/hw/ehca/ehca_hca.c b/drivers/infiniband/hw/ehca/ehca_hca.c
index bc3b37d..4628822 100644
--- a/drivers/infiniband/hw/ehca/ehca_hca.c
+++ b/drivers/infiniband/hw/ehca/ehca_hca.c
@@ -114,7 +114,9 @@ int ehca_query_device(struct ib_device *ibdev, struct ib_device_attr *props)
 	}
 
 	props->max_pkeys           = 16;
-	props->local_ca_ack_delay  = min_t(u8, rblock->local_ca_ack_delay, 255);
+	/* Some FW versions say 0 here; insert sensible value in that case */
+	props->local_ca_ack_delay  = rblock->local_ca_ack_delay ?
+		min_t(u8, rblock->local_ca_ack_delay, 255) : 12;
 	props->max_raw_ipv6_qp     = limit_uint(rblock->max_raw_ipv6_qp);
 	props->max_raw_ethy_qp     = limit_uint(rblock->max_raw_ethy_qp);
 	props->max_mcast_grp       = limit_uint(rblock->max_mcast_grp);
-- 
1.5.5

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

* Re: [PATCH 2/2] IB/ehca: Default value for Local CA ACK Delay
  2008-07-21 11:16 ` [PATCH 2/2] IB/ehca: Default value for Local CA ACK Delay Joachim Fenkes
@ 2008-07-21 16:34   ` Roland Dreier
  0 siblings, 0 replies; 4+ messages in thread
From: Roland Dreier @ 2008-07-21 16:34 UTC (permalink / raw)
  To: Joachim Fenkes
  Cc: LKML, OF-EWG, LinuxPPC-Dev, Christoph Raisch, OF-General,
	Alexander Schmidt, Stefan Roscher

thanks, applied 1 and 2

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

end of thread, other threads:[~2008-07-21 16:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-21 11:13 [PATCH 0/2] IB/ehca: Two minor circumventions Joachim Fenkes
2008-07-21 11:15 ` [PATCH 1/2] IB/ehca: Filter PATH_MIG events if QP was never armed Joachim Fenkes
2008-07-21 11:16 ` [PATCH 2/2] IB/ehca: Default value for Local CA ACK Delay Joachim Fenkes
2008-07-21 16:34   ` Roland Dreier

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).