Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5b673b71 authored by Joachim Fenkes's avatar Joachim Fenkes Committed by Roland Dreier
Browse files

IB/ehca: Filter PATH_MIG events if QP was never armed



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: default avatarJoachim Fenkes <fenkes@de.ibm.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent d35cb360
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -194,6 +194,7 @@ struct ehca_qp {
	u32 packet_count;
	u32 packet_count;
	atomic_t nr_events; /* events seen */
	atomic_t nr_events; /* events seen */
	wait_queue_head_t wait_completion;
	wait_queue_head_t wait_completion;
	int mig_armed;
};
};


#define IS_SRQ(qp) (qp->ext_type == EQPT_SRQ)
#define IS_SRQ(qp) (qp->ext_type == EQPT_SRQ)
+4 −0
Original line number Original line Diff line number Diff line
@@ -178,6 +178,10 @@ static void dispatch_qp_event(struct ehca_shca *shca, struct ehca_qp *qp,
{
{
	struct ib_event event;
	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.device = &shca->ib_device;
	event.event = event_type;
	event.event = event_type;


+2 −0
Original line number Original line Diff line number Diff line
@@ -1460,6 +1460,8 @@ static int internal_modify_qp(struct ib_qp *ibqp,
			goto modify_qp_exit2;
			goto modify_qp_exit2;
		}
		}
		mqpcb->path_migration_state = attr->path_mig_state + 1;
		mqpcb->path_migration_state = attr->path_mig_state + 1;
		if (attr->path_mig_state == IB_MIG_REARM)
			my_qp->mig_armed = 1;
		update_mask |=
		update_mask |=
			EHCA_BMASK_SET(MQPCB_MASK_PATH_MIGRATION_STATE, 1);
			EHCA_BMASK_SET(MQPCB_MASK_PATH_MIGRATION_STATE, 1);
	}
	}