From patchwork Wed Aug 28 07:41:33 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yuval Shaia X-Patchwork-Id: 11118091 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0514C13B1 for ; Wed, 28 Aug 2019 07:42:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D0F5A22CF5 for ; Wed, 28 Aug 2019 07:42:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="lNvRZnlw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726273AbfH1Hmr (ORCPT ); Wed, 28 Aug 2019 03:42:47 -0400 Received: from aserp2120.oracle.com ([141.146.126.78]:40480 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726154AbfH1Hmr (ORCPT ); Wed, 28 Aug 2019 03:42:47 -0400 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x7S7d2iQ130597; Wed, 28 Aug 2019 07:42:15 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 : mime-version : content-transfer-encoding; s=corp-2019-08-05; bh=W7/pUu22+A8c1nExIS3YuA36jEctFTpHfpteDc9MWXI=; b=lNvRZnlwlXLA6vJYvnHozACHQi07X5xY5FGixjKkNEokuq/dwlT1NXuF4GK6igEcJ4Nm iQTBuce35GLIS5qzDx9CAMMLZrj13nThUj1v/IUZJHtOiObyYjkrGOtouX37JrfwpcR4 C97AKCKRzr5/eZOUGRz7X84EN+/esTkFvsD7QD2XI1bwqEU5xvF3CM/iO4Bh4CzhM+Hy m5+5nTwn4/R+U76Xk0ZAngetvEZZnwAG0zGMt7hCYMRwkdVOTEarig6f4b0XHOUaTwel 01jyKBzA92cIkiUeklk28knFmMXxdgo+LAHQpLdgh/b/tg173xfwbqnKU+d2mM7dhG5W fQ== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 2unnbhg1dt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Aug 2019 07:42:15 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x7S7chdM148493; Wed, 28 Aug 2019 07:42:14 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 2un6q2a862-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Aug 2019 07:42:14 +0000 Received: from abhmp0002.oracle.com (abhmp0002.oracle.com [141.146.116.8]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x7S7gDRJ016541; Wed, 28 Aug 2019 07:42:13 GMT Received: from host5.lan (/77.138.183.59) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 28 Aug 2019 00:42:12 -0700 From: Yuval Shaia To: dledford@redhat.com, jgg@ziepe.ca, oulijun@huawei.com, xavier.huwei@huawei.com, leon@kernel.org, majd@mellanox.com, markz@mellanox.com, swise@opengridcomputing.com, galpress@amazon.com, monis@mellanox.com, israelr@mellanox.com, maxg@mellanox.com, dan.carpenter@oracle.com, kamalheib1@gmail.com, yuval.shaia@oracle.com, denisd@mellanox.com, yuvalav@mellanox.com, dennis.dalessandro@intel.com, ereza@mellanox.com, will@kernel.org, linux-rdma@vger.kernel.org, jgg@mellanox.com, srabinov7@gmail.com, santosh.shilimkar@oracle.com Cc: Shamir Rabinovitch Subject: [PATCH 3/4] IB/{core,hw}: ib_pd should not have ib_uobject pointer Date: Wed, 28 Aug 2019 10:41:33 +0300 Message-Id: <20190828074134.17042-4-yuval.shaia@oracle.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190828074134.17042-1-yuval.shaia@oracle.com> References: <20190828074134.17042-1-yuval.shaia@oracle.com> MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9362 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=2 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-1906280000 definitions=main-1908280080 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9362 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=2 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1906280000 definitions=main-1908280080 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org From: Shamir Rabinovitch As a preparation step to shared PD, where ib_pd object will be pointed by one or more ib_uobjects, remove ib_uobject pointer from ib_pd struct. Signed-off-by: Shamir Rabinovitch Signed-off-by: Shamir Rabinovitch --- drivers/infiniband/core/uverbs_cmd.c | 1 - drivers/infiniband/core/verbs.c | 1 - drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 1 - drivers/infiniband/hw/mlx5/main.c | 1 - drivers/infiniband/hw/mthca/mthca_qp.c | 3 ++- include/rdma/ib_verbs.h | 1 - 6 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c index 204a93305f1c..d1f0c04f0ae8 100644 --- a/drivers/infiniband/core/uverbs_cmd.c +++ b/drivers/infiniband/core/uverbs_cmd.c @@ -432,7 +432,6 @@ static int ib_uverbs_alloc_pd(struct uverbs_attr_bundle *attrs) } pd->device = ib_dev; - pd->uobject = uobj; pd->__internal_mr = NULL; atomic_set(&pd->usecnt, 0); pd->res.type = RDMA_RESTRACK_PD; diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c index f974b6854224..1d0215c1a504 100644 --- a/drivers/infiniband/core/verbs.c +++ b/drivers/infiniband/core/verbs.c @@ -263,7 +263,6 @@ struct ib_pd *__ib_alloc_pd(struct ib_device *device, unsigned int flags, return ERR_PTR(-ENOMEM); pd->device = device; - pd->uobject = NULL; pd->__internal_mr = NULL; atomic_set(&pd->usecnt, 0); pd->flags = flags; diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c index 0ff5f9617639..bd4a09b2ec1e 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c @@ -760,7 +760,6 @@ static int hns_roce_v1_rsv_lp_qp(struct hns_roce_dev *hr_dev) free_mr->mr_free_pd = to_hr_pd(pd); free_mr->mr_free_pd->ibpd.device = &hr_dev->ib_dev; - free_mr->mr_free_pd->ibpd.uobject = NULL; free_mr->mr_free_pd->ibpd.__internal_mr = NULL; atomic_set(&free_mr->mr_free_pd->ibpd.usecnt, 0); diff --git a/drivers/infiniband/hw/mlx5/main.c b/drivers/infiniband/hw/mlx5/main.c index 98e566acb746..93db6d4c7da4 100644 --- a/drivers/infiniband/hw/mlx5/main.c +++ b/drivers/infiniband/hw/mlx5/main.c @@ -4937,7 +4937,6 @@ static int create_dev_resources(struct mlx5_ib_resources *devr) return -ENOMEM; devr->p0->device = ibdev; - devr->p0->uobject = NULL; atomic_set(&devr->p0->usecnt, 0); ret = mlx5_ib_alloc_pd(devr->p0, NULL); diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c index d04c245359eb..b1a9169e3af6 100644 --- a/drivers/infiniband/hw/mthca/mthca_qp.c +++ b/drivers/infiniband/hw/mthca/mthca_qp.c @@ -956,7 +956,8 @@ static int mthca_max_data_size(struct mthca_dev *dev, struct mthca_qp *qp, int d static inline int mthca_max_inline_data(struct mthca_pd *pd, int max_data_size) { /* We don't support inline data for kernel QPs (yet). */ - return pd->ibpd.uobject ? max_data_size - MTHCA_INLINE_HEADER_SIZE : 0; + return !rdma_is_kernel_res(&pd->ibpd.res) ? + max_data_size - MTHCA_INLINE_HEADER_SIZE : 0; } static void mthca_adjust_qp_caps(struct mthca_dev *dev, diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h index 391499008a22..7b429b2e7cf6 100644 --- a/include/rdma/ib_verbs.h +++ b/include/rdma/ib_verbs.h @@ -1509,7 +1509,6 @@ struct ib_pd { u32 local_dma_lkey; u32 flags; struct ib_device *device; - struct ib_uobject *uobject; atomic_t usecnt; /* count all resources */ u32 unsafe_global_rkey;