From patchwork Sun Mar 25 20:09:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuval Shaia X-Patchwork-Id: 10306729 X-Patchwork-Delegate: leon@leon.nu 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 28C4560385 for ; Sun, 25 Mar 2018 20:09:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C6E12906D for ; Sun, 25 Mar 2018 20:09:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F1B4929211; Sun, 25 Mar 2018 20:09:22 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY 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 BEEC72906D for ; Sun, 25 Mar 2018 20:09:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751873AbeCYUJU (ORCPT ); Sun, 25 Mar 2018 16:09:20 -0400 Received: from aserp2130.oracle.com ([141.146.126.79]:46930 "EHLO aserp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751835AbeCYUJT (ORCPT ); Sun, 25 Mar 2018 16:09:19 -0400 Received: from pps.filterd (aserp2130.oracle.com [127.0.0.1]) by aserp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w2PK6UuP167137; Sun, 25 Mar 2018 20:09:14 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2017-10-26; bh=5gCwx8flDnHSjX0GtCPMJq9HGj8gWGfsLOsT7/ajD08=; b=WIj5wIQlfJeOEaD0AcHeWJX1wARDj9IAbhbnrUKZ4viYF7J0pIqU3rbYWW/e3aE1V7QN 4fjpW8RkBgvWRzupjmsqlyhUwp/jN1Jv6lhH3gCEhv3Plm3HCHDE12DgkiG8pt6FLdMh m6ayt5XwIjrZ/DzXzk3A6F2/jLtqF9vfXplSxlB2jgxaRYf8b1rmlqP+hzZIH/0O18X+ JnYq3xMiVBHOErA5HTSfY8qTAojntiMtSpHYBlJdeX3U+wPtMC8eA1q8ecE0JWPCqIrA c5Jbhb5DpvpXh3CFudE+K5h+ZbY/RMJSuWhU40zBNfUe9ap8v2J5swmTJBsJVj1YBO23 Hg== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by aserp2130.oracle.com with ESMTP id 2gxj6000qr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 25 Mar 2018 20:09:14 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w2PK9D8K008775 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 25 Mar 2018 20:09:13 GMT Received: from abhmp0009.oracle.com (abhmp0009.oracle.com [141.146.116.15]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w2PK9Cdn003613; Sun, 25 Mar 2018 20:09:12 GMT Received: from yuvallap.nl.oracle.com (/10.175.28.62) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 25 Mar 2018 20:09:12 +0000 From: Yuval Shaia To: dledford@redhat.com, jgg@mellanox.com, leonro@mellanox.com, linux-rdma@vger.kernel.org Cc: Yuval Shaia Subject: [PATCH] librdmacm: Return errno on create_qp failure Date: Sun, 25 Mar 2018 23:09:02 +0300 Message-Id: <20180325200902.13017-1-yuval.shaia@oracle.com> X-Mailer: git-send-email 2.14.3 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8843 signatures=668695 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=850 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1803250243 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 Upon QP creation failure provider's create_qp function sets errno with error code and return NULL to caller. Let's return this errno to caller to reflect the exact reason for the error. Signed-off-by: Yuval Shaia --- librdmacm/cma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/librdmacm/cma.c b/librdmacm/cma.c index fa370650..e92a022c 100644 --- a/librdmacm/cma.c +++ b/librdmacm/cma.c @@ -1369,7 +1369,7 @@ int rdma_create_qp_ex(struct rdma_cm_id *id, attr->srq = id->srq; qp = ibv_create_qp_ex(id->verbs, attr); if (!qp) { - ret = ERR(ENOMEM); + ret = ERR(errno); goto err1; }