From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bart Van Assche Subject: Re: [patch v2 21/37] add rxe_qp.c Date: Mon, 15 Aug 2011 18:13:57 +0200 Message-ID: References: <20110724194300.421253331@systemfabricworks.com> <20110724201229.163423781@systemfabricworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: In-Reply-To: <20110724201229.163423781-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org> Sender: linux-rdma-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: rpearson-klaOcWyJdxkshyMvu7JE4pqQE7yCjDx5@public.gmane.org Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-rdma@vger.kernel.org On Sun, Jul 24, 2011 at 9:43 PM, wrot= e: > +char *rxe_qp_state_name[] =3D { > + [QP_STATE_RESET] =3D "RESET", > + [QP_STATE_INIT] =3D "INIT", > + [QP_STATE_READY] =3D "READY", > + [QP_STATE_DRAIN] =3D "DRAIN", > + [QP_STATE_DRAINED] =3D "DRAINED", > + [QP_STATE_ERROR] =3D "ERROR", > +}; Doesn't the compiler complain about assigning const char* to char* for the above array definition ? And since this array is only used in this source file, I think it can be declared static. > +static int rxe_qp_chk_cap(struct rxe_dev *rxe, struct ib_qp_cap *cap= , > + int has_srq) > +{ > + if (cap->max_send_wr > rxe->attr.max_qp_wr) { > + pr_warn("invalid send wr =3D %d > %d\n", > + cap->max_send_wr, rxe->attr.max_qp_wr); > + goto err1; > + } Context information is missing in the message generated by the above pr_warn() statement. Shouldn't that be dev_warn() instead ? > +/* move the qp to the error state */ > +void rxe_qp_error(struct rxe_qp *qp) > +{ > + qp->req.state =3D QP_STATE_ERROR; > + qp->resp.state =3D QP_STATE_ERROR; > + > + /* drain work and packet queues */ > + rxe_run_task(&qp->resp.task, 1); > + > + if (qp_type(qp) =3D=3D IB_QPT_RC) > + rxe_run_task(&qp->comp.task, 1); > + else > + __rxe_do_task(&qp->comp.task); > + rxe_run_task(&qp->req.task, 1); > +} A quote from the InfiniBand Architecture Specification: o11-5.2.5: If the HCA supports SRQ, for RC and UD service, the CI shall generate a Last WQE Reached Affiliated Asynchronous Event on a QP that is in the Error State and is associated with an SRQ when either: =95 a CQE is generated for the last WQE, or =95 the QP gets in the Error State and there are no more WQEs on the RQ= =2E I haven't found the code yet for generating the last WQE event in the ib_rxe implementation ? Bart. -- To unsubscribe from this list: send the line "unsubscribe linux-rdma" i= n the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html