From patchwork Fri Dec 8 19:00:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bryan Tan X-Patchwork-Id: 10103177 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5D0D9602A0 for ; Fri, 8 Dec 2017 19:00:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C7DF28CDC for ; Fri, 8 Dec 2017 19:00:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4125E28D20; Fri, 8 Dec 2017 19:00:33 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 2546528CDC for ; Fri, 8 Dec 2017 19:00:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752338AbdLHTAa (ORCPT ); Fri, 8 Dec 2017 14:00:30 -0500 Received: from mail-co1nam03on0048.outbound.protection.outlook.com ([104.47.40.48]:27584 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752375AbdLHTA3 (ORCPT ); Fri, 8 Dec 2017 14:00:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=onevmw.onmicrosoft.com; s=selector1-vmware-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=AZehkLnfvtFwX8m12mtEpBekBGFlFFryUgq38+IeS9Y=; b=lPG03u2HM8Hlja0KK9DMy4ZZwDrNn+6D5Tj7dnjZ0/1yS0JLSTmo5eUU/BkrF888HvPfY+JGl3SnKdzuqqKIdh4KuLCINo+onbzdfDYgyosATAlG/An6pUjbSlNxyTl9EIZ9ag1FCkQKCQVnqsvYcn0qIeEkrOKZ/9HKPfe5iG8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=bryantan@vmware.com; Received: from bryantan-devbox.prom.eng.vmware.com.prom.eng.vmware.com (208.91.1.34) by SN2PR05MB2782.namprd05.prod.outlook.com (2603:10b6:804:16::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.2; Fri, 8 Dec 2017 19:00:26 +0000 Date: Fri, 8 Dec 2017 11:00:17 -0800 From: Bryan Tan To: linux-rdma@vger.kernel.org Subject: [PATCH for-rc 1/6] RDMA/vmw_pvrdma: Clarify QP is_kernel logic Message-ID: <20171208190010.GA31023@bryantan-devbox.prom.eng.vmware.com.prom.eng.vmware.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20171208185818.GA28514@bryantan-devbox.prom.eng.vmware.com.prom.eng.vmware.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Originating-IP: [208.91.1.34] X-ClientProxiedBy: YQXPR0101CA0064.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:c00:14::41) To SN2PR05MB2782.namprd05.prod.outlook.com (2603:10b6:804:16::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4621c0ae-ec09-4aa0-9dd0-08d53e6df1bb X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307); SRVR:SN2PR05MB2782; X-Microsoft-Exchange-Diagnostics: 1; SN2PR05MB2782; 3:iqY4VUkwrZX0nR4zh3oj9JLs2GrN2ZnngJ4WiQUSS1kS2ZLxrrdX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umw/z33W8B1kqZ2ujzuNmIjR7KH4bcfQyoYYIiaBJlgsgdaXS7gO93AqaX9jelTlJW164iJn74jfJ4mF8hl0QqF9yhZtSN6TGWi+jTGPNQKmjJmEQXWM1kh9zI/i/7IDnhAwU8ksvBLep+DV0CoMnjrtxXlm0rf1nO8rTngn7mEdOGAzjAiMjD/3B/HmTJkKmVpkeNGNkhms+rYSNfNTVSwpSJ20z2V83oi/0a7KhtxBaTwW99DSlJr+gpX/E1u8UeKE/TH/BHwfTVqN/AVmJ/l46EsUkrlYGGAOwL; 4:2bn4oszZzIBN6V/PTRLOl6BMTzHpoIRVhrw6WUIUD3zlNj2ODUAirLNw/hnhYWrImEtbM1wcEu76LLMXEMQDRDtuE6QrqlQ+nFHgIMPSf5oXvdg7onZQMtdtXkeaFPK+XbzN1lb4rUmpJDUvFuciCFi1fsTae7i7e10XeJ4XLSYMLLMQj6I+J8NG3h5G0I4xrIBviwsqaxDlc8Iyg8ttRkmo6tv/+Q0ak2hCIQuBt8Lsy01s9uNeKNm2ICBAjUFx/jOT/zKuY7H2y2TWrMWi6Jp8+JLMDAMr+kPlKdSV1C+7brLLAe+yfkYuXb1eJtJF X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(61668805478150); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(10201501046)(3231022)(93006095)(93001095)(3002001)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148)(201708071742011); SRVR:SN2PR05MB2782; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:SN2PR05MB2782; X-Forefront-PRVS: 0515208626 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(366004)(376002)(39860400002)(189003)(199004)(55016002)(2361001)(2351001)(25786009)(47776003)(86362001)(53936002)(66066001)(81156014)(81166006)(8676002)(2906002)(33656002)(5660300001)(8936002)(52116002)(16586007)(7696005)(58126008)(68736007)(23726003)(478600001)(1076002)(105586002)(316002)(97736004)(6116002)(50466002)(16526018)(106356001)(3846002)(6916009)(7736002)(83506002)(305945005)(6666003)(2950100002)(18370500001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN2PR05MB2782; H:bryantan-devbox.prom.eng.vmware.com.prom.eng.vmware.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: vmware.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR05MB2782; 23:62EzckpZadBqcaAejT1y7n+Ofyo8DtYBYR8fsqLVE?= =?us-ascii?Q?Z1QjknYnbiSy4lBzBW0vZOXDuY7tQNhB0IU7EO9dAky9jQoIyhyTJzjzOxmM?= =?us-ascii?Q?X7r47ZXZw461Lg3rkzxUpPYhFdiKaKjx6yg34wH0+HhTU8fp5h4HUL17hcfN?= =?us-ascii?Q?9534BMTlrEOvFNOxPXG1NjFbVjK34caPHYPSM1X4iFMX4PsE/+6yvhySnt5Y?= =?us-ascii?Q?EaYFG2kwHgUNAOBxhk4ldE4zzsaZdvr+aZ56WM5pOLdQug9EWZQeaJJehbCj?= =?us-ascii?Q?64T4KbnFteZV927eYzx2SPIL/5+a1goueARQXLIAJKgiVz+dLyrTsBpYU15e?= =?us-ascii?Q?ex4HJzhiSA/6TJ7E4G/83LEeOnbyXXSSOPr+SV+rofD9Bo17zghpDVYe7+kQ?= =?us-ascii?Q?yOcnyEtF7pxH+SWKepR3vXLu/m1YqBVsMDIAU5mqcrg8eV4/uMVDFiJVhSJz?= =?us-ascii?Q?mmWh2AE5WMq2vvt54tRwaFSd725cskMq/ENXQhwnuu/GrwnRoX2CukZ9OxNa?= =?us-ascii?Q?OjpsDaaXzW02z6pvPbRtlAQ3LLWwPBVZga8cr187YZgPPPIE4pCMO2SsVtSV?= =?us-ascii?Q?MpTDCusct2cvdmdOWzCnYLJGgRg8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qFmQH+xuwEWnSXLih59D80wCq4=; 24:BmdZO/WYfhKCjDwzIuJYV6thkwR32nOjc6p+rgQmPfptuc+zU475JyZnmEIxg+4qAP99GwZBrywwQOoChdMkvMFhsv+BvYTSb0yljrtf35M=; 7:0XQdvQpwJUIj3lRMO3x8k1oBeyXuSV5+swk9lphLxUxOfUzUujI1MB/x6b4rN7N1Yw9JeDiu6BaeGbbZ9m+c2x4eoRf2Eka3dwiD65sdg0DTt7ztuNQLmoxzBVosaeuvj3WWce15ZLe0sPZUuswkX+f4gsJtlvZa22WLRQBX1u45/JVTul/QJxoVNroe1VdfDHdw4s6/Gw/i+VIKXU73mEAehdwBfiLUNH9Ht8awfkxzbGaTAEedq+v0oV7BYukz SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN2PR05MB2782; 20:UxWTNuFmVcs91EN5EypfVMwfQf4XNxFSEUQj9wfvEMK7iNj2mvn+3aGGCchouxTQ55OwNwyqvs7t8Ned2XlUoEDCOYQ6B3dQXvIgHL59k9jCOewxGx8EcPKgQ/w8EUVfFM9a52y5VwQo1vwM+bU3QGfuoVLfc7r4AgOxlc2RoXU= X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2017 19:00:26.5130 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4621c0ae-ec09-4aa0-9dd0-08d53e6df1bb X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR05MB2782 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 Be more consistent in checking is_kernel flag for QPs. Testing Done: ibv_rc_pingpong, rping, perftests. Reviewed-by: Adit Ranadive Reviewed-by: Aditya Sarwade Reviewed-by: Jorgen Hansen Signed-off-by: Bryan Tan Reviewed-by: Yuval Shaia --- drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c index 10420a1..b932b7e 100644 --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_qp.c @@ -249,8 +249,9 @@ struct ib_qp *pvrdma_create_qp(struct ib_pd *pd, init_waitqueue_head(&qp->wait); qp->state = IB_QPS_RESET; + qp->is_kernel = !(pd->uobject && udata); - if (pd->uobject && udata) { + if (!qp->is_kernel) { dev_dbg(&dev->pdev->dev, "create queuepair from user space\n"); @@ -291,8 +292,6 @@ struct ib_qp *pvrdma_create_qp(struct ib_pd *pd, qp->npages_recv = 0; qp->npages = qp->npages_send + qp->npages_recv; } else { - qp->is_kernel = true; - ret = pvrdma_set_sq_size(to_vdev(pd->device), &init_attr->cap, qp); if (ret) @@ -394,7 +393,7 @@ struct ib_qp *pvrdma_create_qp(struct ib_pd *pd, err_pdir: pvrdma_page_dir_cleanup(dev, &qp->pdir); err_umem: - if (pd->uobject && udata) { + if (!qp->is_kernel) { if (qp->rumem) ib_umem_release(qp->rumem); if (qp->sumem)