From patchwork Wed Mar 9 14:02:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Heinz X-Patchwork-Id: 621421 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id p29E2qa3001582 for ; Wed, 9 Mar 2011 14:03:00 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932340Ab1CIODA (ORCPT ); Wed, 9 Mar 2011 09:03:00 -0500 Received: from tx2ehsobe002.messaging.microsoft.com ([65.55.88.12]:58118 "EHLO TX2EHSOBE003.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932409Ab1CIOC7 convert rfc822-to-8bit (ORCPT ); Wed, 9 Mar 2011 09:02:59 -0500 Received: from mail62-tx2-R.bigfish.com (10.9.14.245) by TX2EHSOBE003.bigfish.com (10.9.40.23) with Microsoft SMTP Server id 14.1.225.8; Wed, 9 Mar 2011 14:02:56 +0000 Received: from mail62-tx2 (localhost.localdomain [127.0.0.1]) by mail62-tx2-R.bigfish.com (Postfix) with ESMTP id 2F85C14A050D; Wed, 9 Mar 2011 14:02:56 +0000 (UTC) X-SpamScore: -20 X-BigFish: VPS-20(zzbb2cK542N1dbaL9371Pzz1202hzz8275bh8275dhz2ei2a8h668h61h) X-Spam-TCS-SCL: 0:0 X-Forefront-Antispam-Report: KIP:(null); UIP:(null); IPVD:NLI; H:avexcashub1.qlogic.com; RD:avexcashub2.qlogic.com; EFVD:NLI Received: from mail62-tx2 (localhost.localdomain [127.0.0.1]) by mail62-tx2 (MessageSwitch) id 1299679375921042_5082; Wed, 9 Mar 2011 14:02:55 +0000 (UTC) Received: from TX2EHSMHS028.bigfish.com (unknown [10.9.14.246]) by mail62-tx2.bigfish.com (Postfix) with ESMTP id DDADE1448051; Wed, 9 Mar 2011 14:02:55 +0000 (UTC) Received: from avexcashub1.qlogic.com (198.70.193.64) by TX2EHSMHS028.bigfish.com (10.9.99.128) with Microsoft SMTP Server (TLS) id 14.1.225.8; Wed, 9 Mar 2011 14:02:53 +0000 Received: from MNEXCASHUB2.qlogic.org (10.33.2.104) by avexcashub2.qlogic.org (10.1.4.162) with Microsoft SMTP Server (TLS) id 8.1.436.0; Wed, 9 Mar 2011 06:02:52 -0800 Received: from MNEXMB1.qlogic.org ([fe80::8516:7839:9549:6996]) by MNEXCASHUB2.qlogic.org ([::1]) with mapi; Wed, 9 Mar 2011 08:02:51 -0600 From: Mike Heinz To: Jason Gunthorpe , Roland Dreier , "linux-rdma@vger.kernel.org" Date: Wed, 9 Mar 2011 08:02:48 -0600 Subject: RE: [PATCH/libmlx4] Return ERRNO codes from ibv_post_send/recv instead of -1 Thread-Topic: [PATCH/libmlx4] Return ERRNO codes from ibv_post_send/recv instead of -1 Thread-Index: Acvd+VGLbMmB9nnsQUKJ7EftdaRHCQAaUJgg Message-ID: <4C2744E8AD2982428C5BFE523DF8CDCB4A20BB3C79@MNEXMB1.qlogic.org> References: <20110309012810.GM22729@obsidianresearch.com> In-Reply-To: <20110309012810.GM22729@obsidianresearch.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 X-OriginatorOrg: qlogic.com Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter1.kernel.org [140.211.167.41]); Wed, 09 Mar 2011 14:03:00 +0000 (UTC) diff --git a/src/qp.c b/src/qp.c index d194ae3..ec138cd 100644 --- a/src/qp.c +++ b/src/qp.c @@ -40,6 +40,7 @@ #include #include #include +#include #include "mlx4.h" #include "doorbell.h" @@ -206,19 +207,19 @@ int mlx4_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr, for (nreq = 0; wr; ++nreq, wr = wr->next) { if (wq_overflow(&qp->sq, nreq, to_mcq(qp->ibv_qp.send_cq))) { - ret = -1; + ret = ENOMEM; *bad_wr = wr; goto out; } if (wr->num_sge > qp->sq.max_gs) { - ret = -1; + ret = ENOMEM; *bad_wr = wr; goto out; } if (wr->opcode >= sizeof mlx4_ib_opcode / sizeof mlx4_ib_opcode[0]) { - ret = -1; + ret = EINVAL; *bad_wr = wr; goto out; } @@ -309,7 +310,7 @@ int mlx4_post_send(struct ibv_qp *ibqp, struct ibv_send_wr *wr, if (inl > qp->max_inline_data) { inl = 0; - ret = -1; + ret = ENOMEM; *bad_wr = wr; goto out; } @@ -450,13 +451,13 @@ int mlx4_post_recv(struct ibv_qp *ibqp, struct ibv_recv_wr *wr, for (nreq = 0; wr; ++nreq, wr = wr->next) { if (wq_overflow(&qp->rq, nreq, to_mcq(qp->ibv_qp.recv_cq))) { - ret = -1; + ret = ENOMEM; *bad_wr = wr; goto out; } if (wr->num_sge > qp->rq.max_gs) { - ret = -1; + ret = ENOMEM; *bad_wr = wr; goto out; }