From patchwork Mon Dec 17 15:15:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shamir Rabinovitch X-Patchwork-Id: 10733657 X-Patchwork-Delegate: jgg@ziepe.ca 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 74E1E14DE for ; Mon, 17 Dec 2018 15:24:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6559029559 for ; Mon, 17 Dec 2018 15:24:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5945629C14; Mon, 17 Dec 2018 15:24:07 +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 EF38527F54 for ; Mon, 17 Dec 2018 15:24:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727774AbeLQPYG (ORCPT ); Mon, 17 Dec 2018 10:24:06 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:55632 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726637AbeLQPYG (ORCPT ); Mon, 17 Dec 2018 10:24:06 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id wBHFEdGg100646; Mon, 17 Dec 2018 15:23:39 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=IcMUZu2e7HXh9rFd05Odmxwxo/AOWJkPNINe2xfDbFA=; b=ShuLiTWDWPsmUdP3GSFs/GE4qt+a9y6H1YqKsLocOaSUsWipc+KCpYDPIk2zG4E4OhUC GKQicYobanGsmJ/p95PENsXEz0eo8j7/J2s2e8Z60D2Q66uI72WpMbpqYEF6zXXkKQZn 79didIq2vlod/ZUQ7c7phwvEzj1psgIGg1efH8Zpuv7cHj3eDH8vh93hjCddtZ1NpxTl 4n0KqqyvTw8JR919yxDZuEpcywsV/H+Jwz6bUBGaIUmp9xBVbjxfjVyli3YnWSBAXyLE 4tTkFC4FZXsWCY6o/GMcchPSpXm9HaODBbw1sVpMlTGTmnFTFRu0Dqdy6tvBzsuDNbso sA== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2pct8qp4mg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Dec 2018 15:23:39 +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 wBHFNcmW021734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 17 Dec 2018 15:23:39 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id wBHFNc5K019625; Mon, 17 Dec 2018 15:23:38 GMT Received: from localhost.localdomain (/77.124.81.87) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 17 Dec 2018 07:23:37 -0800 From: Shamir Rabinovitch To: linux-rdma@vger.kernel.org Cc: dledford@redhat.com, jgg@ziepe.ca, Shamir Rabinovitch , Lijun Ou , "Wei Hu(Xavier)" , Faisal Latif , Dennis Dalessandro , Bart Van Assche , Sagi Grimberg , Kees Cook , Kamal Heib Subject: [PATCH v4 4/4] IB/hw: use rdma_is_user_pd instead of pd uobject pointer Date: Mon, 17 Dec 2018 17:15:19 +0200 Message-Id: <20181217151528.30743-5-shamir.rabinovitch@oracle.com> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181217151528.30743-1-shamir.rabinovitch@oracle.com> References: <20181217151528.30743-1-shamir.rabinovitch@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9110 signatures=668679 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=1 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=857 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1812170136 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 Now we have the ability to tell from ib_pd if ib_pd was created by user/kernel verbs. Stop using the ib_pd->uobject pointer for this. This patch prepare the ib_pb uobject pointer removal that will happen in another patch. Signed-off-by: Shamir Rabinovitch --- drivers/infiniband/hw/hns/hns_roce_hw_v1.c | 2 +- drivers/infiniband/hw/mthca/mthca_qp.c | 3 ++- drivers/infiniband/hw/nes/nes_verbs.c | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c index a35355fa7405..a6c581a3450b 100644 --- a/drivers/infiniband/hw/hns/hns_roce_hw_v1.c +++ b/drivers/infiniband/hw/hns/hns_roce_hw_v1.c @@ -3926,7 +3926,7 @@ int hns_roce_v1_destroy_qp(struct ib_qp *ibqp) struct hns_roce_qp_work *qp_work; struct hns_roce_v1_priv *priv; struct hns_roce_cq *send_cq, *recv_cq; - bool is_user = ibqp->uobject; + bool is_user = rdma_is_user_pd(ibqp->pd); int is_timeout = 0; int ret; diff --git a/drivers/infiniband/hw/mthca/mthca_qp.c b/drivers/infiniband/hw/mthca/mthca_qp.c index 4e5b5cc17f1d..bf94d96e0b42 100644 --- a/drivers/infiniband/hw/mthca/mthca_qp.c +++ b/drivers/infiniband/hw/mthca/mthca_qp.c @@ -951,7 +951,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_user_pd(&pd->ibpd) ? + max_data_size - MTHCA_INLINE_HEADER_SIZE : 0; } static void mthca_adjust_qp_caps(struct mthca_dev *dev, diff --git a/drivers/infiniband/hw/nes/nes_verbs.c b/drivers/infiniband/hw/nes/nes_verbs.c index 1f9dc4485f98..8af3ae34ab34 100644 --- a/drivers/infiniband/hw/nes/nes_verbs.c +++ b/drivers/infiniband/hw/nes/nes_verbs.c @@ -733,7 +733,7 @@ static int nes_dealloc_pd(struct ib_pd *ibpd) struct nes_device *nesdev = nesvnic->nesdev; struct nes_adapter *nesadapter = nesdev->nesadapter; - if ((ibpd->uobject) && (ibpd->uobject->context)) { + if (rdma_is_user_pd(ibpd) && (ibpd->uobject->context)) { nesucontext = to_nesucontext(ibpd->uobject->context); nes_debug(NES_DBG_PD, "Clearing bit %u from allocated doorbells\n", nespd->mmap_db_index);