From patchwork Fri May 11 03:33:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lijun Ou X-Patchwork-Id: 10393165 X-Patchwork-Delegate: jgg@ziepe.ca Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3556C60236 for ; Fri, 11 May 2018 03:34:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A78228D1D for ; Fri, 11 May 2018 03:34:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2CCD028DF1; Fri, 11 May 2018 03:34:20 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6DC7528D1D for ; Fri, 11 May 2018 03:34:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752408AbeEKDeR (ORCPT ); Thu, 10 May 2018 23:34:17 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:53684 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752357AbeEKDeQ (ORCPT ); Thu, 10 May 2018 23:34:16 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 763E9EE4F06C9; Fri, 11 May 2018 11:34:13 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.361.1; Fri, 11 May 2018 11:34:13 +0800 From: Lijun Ou To: , , CC: Subject: [PATCH rdma-core 3/6] libhns: Update errno for exception return Date: Fri, 11 May 2018 11:33:27 +0800 Message-ID: <1526009610-72089-4-git-send-email-oulijun@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1526009610-72089-1-git-send-email-oulijun@huawei.com> References: <1526009610-72089-1-git-send-email-oulijun@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch mainly fix the return errno when the function run exception. Signed-off-by: Lijun Ou --- providers/hns/hns_roce_u_hw_v2.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/providers/hns/hns_roce_u_hw_v2.c b/providers/hns/hns_roce_u_hw_v2.c index c69069c..06830ac 100644 --- a/providers/hns/hns_roce_u_hw_v2.c +++ b/providers/hns/hns_roce_u_hw_v2.c @@ -448,7 +448,7 @@ static int hns_roce_v2_poll_one(struct hns_roce_cq *cq, if (data_len) { wc->status = IBV_WC_LOC_LEN_ERR; - return -1; + return V2_CQ_POLL_ERR; } } } @@ -550,13 +550,13 @@ static int hns_roce_u_v2_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr, for (nreq = 0; wr; ++nreq, wr = wr->next) { if (hns_roce_v2_wq_overflow(&qp->sq, nreq, to_hr_cq(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 = EINVAL; *bad_wr = wr; goto out; } @@ -691,7 +691,7 @@ static int hns_roce_u_v2_post_send(struct ibv_qp *ibvqp, struct ibv_send_wr *wr, /* Inline */ if (wr->send_flags & IBV_SEND_INLINE && wr->num_sge) { if (le32toh(rc_sq_wqe->msg_len) > qp->max_inline_data) { - ret = -1; + ret = EINVAL; *bad_wr = wr; printf("data len=%d, send_flags = 0x%x!\r\n", rc_sq_wqe->msg_len, wr->send_flags);