From patchwork Sun Oct 14 05:53:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shamir Rabinovitch X-Patchwork-Id: 10640517 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 51A59109C for ; Sun, 14 Oct 2018 05:54:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 34164297DD for ; Sun, 14 Oct 2018 05:54:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12B4E2A285; Sun, 14 Oct 2018 05:54:11 +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 9E934297DD for ; Sun, 14 Oct 2018 05:54:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726062AbeJNNdz (ORCPT ); Sun, 14 Oct 2018 09:33:55 -0400 Received: from userp2130.oracle.com ([156.151.31.86]:45916 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726012AbeJNNdz (ORCPT ); Sun, 14 Oct 2018 09:33:55 -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 w9E5s0LV003805; Sun, 14 Oct 2018 05:54:00 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=3NvA8/YSpl3YJXRPoF7SpOO2QmnqdcFPhJYLkEv0uZE=; b=zIEnLUgB1XL5rZmntF9QN/C3EAOZ6DqOouoQxM3I7BrEzR/OowLnJj3pyoZIlOyOZ6Yn 8s9aHh/Pi9CEBZ6g/s/gZc75G0fzgI7bPF2wqVzTOlS1Fax4z9r7pOMdHlA7UlJj3Lu8 LjKfI4zfGeDtadTuqr0h8sdXOTYzTAlCRK4WT9apPjwYsp3jivu+IJLrm+fHY5FiwY3C IF0dkSD/WjoXtDmISA4UHPGy8NIWWvGkLr11HXLSbB/JKVVfqrIQ/H2XXepnH2RlLvHW zrCMkp7UJYXUNK8v/68FpA3QntZK03XaYvjRlweYPztfLkFCD4cF07qCxVfbXOc18MY0 dA== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp2130.oracle.com with ESMTP id 2n384tm7sk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 14 Oct 2018 05:54:00 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w9E5rxc8020819 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Sun, 14 Oct 2018 05:53:59 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w9E5rwIH030911; Sun, 14 Oct 2018 05:53:59 GMT Received: from localhost.localdomain (/10.175.37.52) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Sun, 14 Oct 2018 05:53:58 +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 v2 0/4] figure uverbs/kernel ib_pd w/o using ib_pd uobject Date: Sun, 14 Oct 2018 08:53:41 +0300 Message-Id: <20181014055345.25348-1-shamir.rabinovitch@oracle.com> X-Mailer: git-send-email 2.17.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9045 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=610 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1810140057 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 change has 2 steps. first step is to change the resource tracker so it will not use ib_x uobject pointer to figure if ib_x object was created by uverbs/kernel. the second step is to use the resource tracker ability to tell if ib_pd was created by uverbs/kernel and replace every place in the code where the code test for valid ib_pd uobject pointer just to tell if the ib_pd was created by uverbs/kernel. this series is the first step toward releasing the code from the dependency in the uobject pointer in the ib_pd. this change is required before we can move to shared ib_pd model. Changelog: v1->v2: * Patch 1: Comments from Jason & Leon - Fix bool assign - Add rdma_restrack_kadd, rdma_restrack_uadd - Remove res_is_user - Fix rdma_is_kernel_res * Patch 2: Comments from Jason - Fix rdma_is_user_pd * Patch 3: Comments from Jason to add cleanup patch * Patch 4: Comments from Jason which include the missing patch 3 Shamir Rabinovitch (4): RDMA/restrack: resource-tracker should not use uobject pointers IB/verbs: Add rdma_is_user_pd function IB/hw: cleanup of incorrect pd->uobject usage IB/{hw,sw}: use rdma_is_user_pd instead of pd uobject pointer drivers/infiniband/core/cma.c | 2 +- drivers/infiniband/core/core_priv.h | 5 ++- drivers/infiniband/core/cq.c | 2 +- drivers/infiniband/core/restrack.c | 40 +++++++---------- drivers/infiniband/core/uverbs_cmd.c | 6 +-- drivers/infiniband/core/uverbs_std_types_cq.c | 2 +- drivers/infiniband/core/verbs.c | 6 +-- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 4 +- drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 2 +- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 3 +- drivers/infiniband/hw/hns/hns_roce_qp.c | 17 +++---- drivers/infiniband/hw/i40iw/i40iw_verbs.c | 44 +++++++++---------- drivers/infiniband/hw/mlx4/qp.c | 17 +++---- drivers/infiniband/hw/mlx4/srq.c | 10 ++--- drivers/infiniband/hw/mlx5/qp.c | 8 ++-- drivers/infiniband/hw/mlx5/srq.c | 8 ++-- drivers/infiniband/hw/mthca/mthca_provider.c | 10 ++--- drivers/infiniband/hw/mthca/mthca_qp.c | 7 +-- drivers/infiniband/hw/mthca/mthca_srq.c | 8 ++-- drivers/infiniband/hw/nes/nes_verbs.c | 7 +-- drivers/infiniband/hw/ocrdma/ocrdma_verbs.c | 2 +- drivers/infiniband/hw/qedr/verbs.c | 4 +- drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c | 2 +- drivers/infiniband/hw/vmw_pvrdma/pvrdma_srq.c | 2 +- drivers/infiniband/sw/rxe/rxe_qp.c | 3 +- include/rdma/ib_verbs.h | 5 +++ include/rdma/restrack.h | 16 +++++-- 27 files changed, 129 insertions(+), 113 deletions(-)