]> err.no Git - linux-2.6/commitdiff
IB/ehca: Filter PATH_MIG events if QP was never armed
authorJoachim Fenkes <fenkes@de.ibm.com>
Tue, 22 Jul 2008 21:18:07 +0000 (14:18 -0700)
committerRoland Dreier <rolandd@cisco.com>
Tue, 22 Jul 2008 21:18:07 +0000 (14:18 -0700)
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>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
drivers/infiniband/hw/ehca/ehca_classes.h
drivers/infiniband/hw/ehca/ehca_irq.c
drivers/infiniband/hw/ehca/ehca_qp.c

index 1e9e99a13933bd7dfa671cc8a125c9abddb526fc..0b0618edd64528b363fe7acb85fd2388adf8f812 100644 (file)
@@ -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)
index 0792d930c481d508fb4ea87e6161795bcdcb5cd4..99642a6e17c4b1c1236040cbc9725082227b146f 100644 (file)
@@ -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;
 
index 3f59587338ea5fc03a2404500f0d9633a468439f..ea13efddf175b818747af7db1f024da9e2384639 100644 (file)
@@ -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);
        }