From patchwork Sun Oct 7 07:23:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shamir Rabinovitch X-Patchwork-Id: 10629373 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0F0CA13BB for ; Sun, 7 Oct 2018 07:23:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EAE4329174 for ; Sun, 7 Oct 2018 07:23:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DF5F32917D; Sun, 7 Oct 2018 07:23:57 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI, 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 8DB2D29174 for ; Sun, 7 Oct 2018 07:23:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726427AbeJGOaR (ORCPT ); Sun, 7 Oct 2018 10:30:17 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:42932 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726351AbeJGOaR (ORCPT ); Sun, 7 Oct 2018 10:30:17 -0400 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w977Iv00183405; Sun, 7 Oct 2018 07:23:53 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=C4J5IGer6ZrV20uf87dHDAXSpAIdnmdJ5wt4X1mAiBk=; b=s16x7rhFduUPolXOwIbawY8NQOrdl2MnNp9lASZq18lre5ueRoWyIoS3BQ+mYjaYnz7o y9okdLJJqAuDnPm/xxcNgbNewbb/hNVrZPVZkpF7YZHNHatu+qKTj/G1hif4GuGYBlAu RUNZba4znpq0V+mFbfetFAbCUjZiSOwifyus3R4h/0vkEgN5L5Wh0IgDY6MZ4BQjiO5n c7qV5i8nRhAQBwJqWjFJ46o03lWGJxqfsTb4t7zbSUUKARE+RRJDlfuEpuetOP/VdiE3 BCy3pS89UrF8Sb+m8ruPIai1KjlvzgtBO51vlge30qihecIGF2cWNHSQ0Aq7ivT5E51P fQ== Received: from aserv0021.oracle.com (aserv0021.oracle.com [141.146.126.233]) by userp2130.oracle.com with ESMTP id 2mxmfta4gb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 07 Oct 2018 07:23:53 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w977Nqoh005446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 7 Oct 2018 07:23:52 GMT Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w977Nqbu011337; Sun, 7 Oct 2018 07:23:52 GMT Received: from localhost.localdomain (/77.127.47.118) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 07 Oct 2018 07:23:51 +0000 From: Shamir Rabinovitch To: linux-rdma@vger.kernel.org Cc: dledford@redhat.com, jgg@ziepe.ca, leon@kernel.org, santosh.shilimkar@oracle.com, shamir.rabinovitch@oracle.com Subject: [PATCH 2/3] IB/verbs: Add rdma_is_user_pd function Date: Sun, 7 Oct 2018 10:23:07 +0300 Message-Id: <20181007072308.10936-3-shamir.rabinovitch@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181007072308.10936-1-shamir.rabinovitch@oracle.com> References: <20181007072308.10936-1-shamir.rabinovitch@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9038 signatures=668706 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810070078 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 function can replace the need for tests based on 'pd->uobject' in the IB core code and will be used in next patches. Signed-off-by: Shamir Rabinovitch --- include/rdma/ib_verbs.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 9897d2329f2c..136f2ffc4b0b 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -1550,6 +1550,11 @@ struct ib_pd { struct rdma_restrack_entry res; }; +static inline bool rdma_is_user_pd(struct ib_pd *pd) +{ + return !rdma_is_kernel_res(&pd->res); +} + struct ib_xrcd { struct ib_device *device; atomic_t usecnt; /* count all exposed resources */