From patchwork Wed Oct 31 12:42:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shamir Rabinovitch X-Patchwork-Id: 10662609 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 6F53414BD for ; Wed, 31 Oct 2018 12:43:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5EB962892A for ; Wed, 31 Oct 2018 12:43:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 52A8928908; Wed, 31 Oct 2018 12:43: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=-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 59AA12AC21 for ; Wed, 31 Oct 2018 12:43:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728851AbeJaVlK (ORCPT ); Wed, 31 Oct 2018 17:41:10 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:55608 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729084AbeJaVlJ (ORCPT ); Wed, 31 Oct 2018 17:41:09 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w9VChEVb036754; Wed, 31 Oct 2018 12:43:14 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=Y7fSgh1j6RzENxpFwCb8jZoHId8UuxI3COrQVcLlOnY=; b=lvMnNKodD9lqVdwMx8NytmsSwD1//ai4FtgAiGzMSMib2LjqPqvpi1KpSLekR6XOnVXl GsenDkg9NRbrTldi17b8fzu1b6Y0LdFakvG7xWOR++dSfa+hhUntCknAq5W1LEj4Gd9K Xn/hEBucPzKIUHlX1HFkCmM7z2s0GQzjZFNhxm+tqhR6cTcpAFJK9UlKxFBu8Aopyjb7 WmfMLNN7F1am5IyriOJtp4p6D1GB+9Oz6WpglZsAiNzgRfdD/khBwBzSYj2KBWIFfsZz 7/lzibtc7fHfez6cikSRpVa1jjetNuZq1sTU6UDYsgQUap4k/FjKkjysSTkQdIL7DFW+ 0A== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by aserp2120.oracle.com with ESMTP id 2ncfyq2nhh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 31 Oct 2018 12:43:14 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w9VCh428006569 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 31 Oct 2018 12:43:05 GMT Received: from abhmp0011.oracle.com (abhmp0011.oracle.com [141.146.116.17]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w9VCh4St021104; Wed, 31 Oct 2018 12:43:04 GMT Received: from localhost.localdomain (/10.175.5.115) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 31 Oct 2018 05:43:04 -0700 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 v3 3/5] IB/verbs: Add rdma_is_user_pd function Date: Wed, 31 Oct 2018 14:42:40 +0200 Message-Id: <20181031124242.24239-4-shamir.rabinovitch@oracle.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031124242.24239-1-shamir.rabinovitch@oracle.com> References: <20181031124242.24239-1-shamir.rabinovitch@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9062 signatures=668683 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-1810310105 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 b17eea0..8f812e9 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 */