From d4f50c76a08b8b7faf3d52faf9bce879803a9ad8 Mon Sep 17 00:00:00 2001 From: Vinay Shaw Date: Tue, 31 May 2016 18:35:05 +0200 Subject: [PATCH] sif: eq: Avoid sending COMM_EST event to ULPs (UD, RAW & GSI QPs) From IB spec, o11-5.1.1: For UD and Raw service types, generation of the Communication Established Affiliated Asynchronous Event is allowed, but is strongly discouraged. Signed-off-by: Vinay Shaw Reviewed-by: Knut Omang --- drivers/infiniband/hw/sif/sif_eq.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/infiniband/hw/sif/sif_eq.c b/drivers/infiniband/hw/sif/sif_eq.c index df1d4e0e0ceff..5b5db9bf72162 100644 --- a/drivers/infiniband/hw/sif/sif_eq.c +++ b/drivers/infiniband/hw/sif/sif_eq.c @@ -659,8 +659,15 @@ static void handle_event_work(struct work_struct *work) struct ib_qp *ibqp = ew->ibe.element.qp; struct sif_qp *qp = to_sqp(ibqp); - /* Avoid MAD layer reporting of fatal error */ - if ((ibqp->qp_type == IB_QPT_GSI) && (ew->ibe.event == IB_EVENT_COMM_EST)) + /* IB spec o11-5.1.1 says suppress COMM_EST event for UD & RAW QP types. + * Also, avoid sending COMM_EST to MAD layer (it reports fatal error). + */ + if ((ew->ibe.event == IB_EVENT_COMM_EST) + && ((ibqp->qp_type == IB_QPT_GSI) + || (ibqp->qp_type == IB_QPT_UD) + || (ibqp->qp_type == IB_QPT_RAW_IPV6) + || (ibqp->qp_type == IB_QPT_RAW_ETHERTYPE) + || (ibqp->qp_type == IB_QPT_RAW_PACKET))) break; if (ibqp->event_handler) -- 2.50.1