Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3869652pxf; Tue, 6 Apr 2021 02:15:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy3eIviw2F6bOcr6LsB7/2Z6aevqW+wvBP09TdeGOvEP8HVxPAS76VG5vm4Hxc2Wr4/hI5w X-Received: by 2002:a02:694b:: with SMTP id e72mr28403052jac.89.1617700510417; Tue, 06 Apr 2021 02:15:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1617700510; cv=pass; d=google.com; s=arc-20160816; b=noj8NEm8R82FkJsG7x+gJP/0bAsupdWybr0tkDk5dbIwzpGuAqa6LsTsTIjcecIHry Cki+VRC16SteiRKyL1gfnK4Ij88BK6icFiyn+adrbVqULtajFbxOVepgQhu0/+QVxGTW u02zjy9PDg5qoNpOS3RDpcmw4MoIG3jHCkdqUym1EnFmu8/lfx91Sue7NjLS1Q5IsZHX keXv1CjzRF44WpxShYa5EtAl5au4ov1fcucN9FQGLO8F5Ac3x6PpHN4yR6ahkdNq0K46 d4gv5orsGotwywcZ+9G+GmmPEdZl2A4l+YZGpH6Yxxf85PALHSN3bQAAKxcuDFONy59B Pi5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-language :content-transfer-encoding:in-reply-to:user-agent:date:message-id :from:references:cc:to:subject:dkim-signature; bh=kwggBMfJRdb6PvoedbOJgy5q2y0CmtkKVqX55sP0WGE=; b=V9GsVvBZ1ASLYiZ5ZRFyXRTGhHeXjrIMKkT8K6eR44wQdczC8gGq2CCITuQEModDxI M/5RHTkUTcKddUhVb/y43GKyKf8WISyNpSuY336P5BJ2PmFi1kD/pAMzWHKp/FuNyJcD Q47Mi7PE0YpipyYtSj+6t3Ip0yWMH52t0Cz8xGBaioQHxHA5V9xpbNwfQmlcYKryyS8H C/2TTGHRMvWyMNJT329cwPoV0aZaR0orUGBdBid5YgwW0KtxLsNmDIPrA8s4mQNsdTEu +nLsab7YMtCMX9dwbJIvCyNtZ6JRyq4Fyk0o0n7drwILANbi3O0+AdgCdOEhkItgyR0Z e8lA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@vmware.com header.s=selector2 header.b=2a3A57uM; arc=pass (i=1 spf=pass spfdomain=vmware.com dkim=pass dkdomain=vmware.com dmarc=pass fromdomain=vmware.com); spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=vmware.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z17si17146997jat.122.2021.04.06.02.14.45; Tue, 06 Apr 2021 02:15:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@vmware.com header.s=selector2 header.b=2a3A57uM; arc=pass (i=1 spf=pass spfdomain=vmware.com dkim=pass dkdomain=vmware.com dmarc=pass fromdomain=vmware.com); spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=vmware.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235409AbhDEUkq (ORCPT + 99 others); Mon, 5 Apr 2021 16:40:46 -0400 Received: from mail-mw2nam12on2058.outbound.protection.outlook.com ([40.107.244.58]:19192 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S235289AbhDEUkp (ORCPT ); Mon, 5 Apr 2021 16:40:45 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IYOs6IGqflxW3uQigDcAjwP7B8vcadYzvv2JnqkGzZ+bJYnMIBmy7DGGhmV5M9LnxpBzk0Q2y/lbYUt9rwNQSW7yYWluDNwBP9UlF0Nwh7CYi/dD+opOcTOZ1H6e+PfAxHIKbgX8yGF0FT62OSZgMd/uQrXiG+w1wy5bzbdvHHHMoe04M3i5SEchRVEQnM4F6GU5tqDLp/HflcOVmAynYzE5ghJQxGz6WU240Kmy/bS5MFibiOnC+p520X1ivciR2ruUygUpoWpfTsuHXv15V9P7Ho68mof4SF8IkDKchSzPqTd0tyAURo3UZ9ItJXFqXzJ+LhAty8d+2ZuD9MzDkg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kwggBMfJRdb6PvoedbOJgy5q2y0CmtkKVqX55sP0WGE=; b=bV1aT6klXfToCGVFiab1lVJ+SoDMehS8s6QUY7p0EflZt/DxcZOIfTGGEe7yYCUiJ3X/vSDBUPmVYioJlCCN04MMEppOUPF5CWpyM2E2s6CZyq3VgxMEcFglP92C+GQHo6JYXPSMBeeatS9vvsC01kMfBPqEqswhr4kDlwPFecGg279rYujGOQMAPabSPwnw7eJyC3u62qZxGqP+qzpCPaad01f2uaK5ZH7Cv1cyL7ugQgonZ8GkO8RXvmwoDSG7RFgTpgQb2UVyug7GJ095fApLRLH0lvrHAS+e8ZO0XbOjtuRfAt3t59Rsh5niLY1LDkYLYc2GHMvZ+i0m5Kin5Q== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kwggBMfJRdb6PvoedbOJgy5q2y0CmtkKVqX55sP0WGE=; b=2a3A57uM5lP2T8mmDBo3782LTdLEaPgTYcMuYdAsbpK4OHxmO3ntJLsLEsle7PoHhPF2Ps2dwf7SktTAr4iluTqMpSfPhBzwnZ9j+faoHJki+7TSCOL6ka6E3om2CgEZDhL765LtVvj5GxFEpHlGT5F7oD18nNTDlP1L/520DSc= Authentication-Results: gmail.com; dkim=none (message not signed) header.d=none;gmail.com; dmarc=none action=none header.from=vmware.com; Received: from BY5PR05MB7155.namprd05.prod.outlook.com (2603:10b6:a03:1bf::24) by SJ0PR05MB7341.namprd05.prod.outlook.com (2603:10b6:a03:278::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4020.8; Mon, 5 Apr 2021 20:40:32 +0000 Received: from BY5PR05MB7155.namprd05.prod.outlook.com ([fe80::8c33:8eab:566:f63a]) by BY5PR05MB7155.namprd05.prod.outlook.com ([fe80::8c33:8eab:566:f63a%5]) with mapi id 15.20.4020.016; Mon, 5 Apr 2021 20:40:32 +0000 Subject: Re: [PATCH rdma-next 02/10] RDMA/core: Enable Relaxed Ordering in __ib_alloc_pd() To: Tom Talpey , Leon Romanovsky , Doug Ledford , Jason Gunthorpe Cc: Avihai Horon , Anna Schumaker , Ariel Elior , Bart Van Assche , Bernard Metzler , Christoph Hellwig , Chuck Lever , "David S. Miller" , Dennis Dalessandro , Devesh Sharma , Faisal Latif , Jack Wang , Jakub Kicinski , "J. Bruce Fields" , Jens Axboe , Karsten Graul , Keith Busch , Lijun Ou , linux-cifs@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nfs@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, linux-s390@vger.kernel.org, Max Gurtovoy , Max Gurtovoy , "Md. Haris Iqbal" , Michael Guralnik , Michal Kalderon , Mike Marciniszyn , Naresh Kumar PBS , netdev@vger.kernel.org, Potnuri Bharat Teja , rds-devel@oss.oracle.com, Sagi Grimberg , samba-technical@lists.samba.org, Santosh Shilimkar , Selvin Xavier , Shiraz Saleem , Somnath Kotur , Sriharsha Basavapatna , Steve French , Trond Myklebust , VMware PV-Drivers , Weihang Li , Yishai Hadas , Zhu Yanjun References: <20210405052404.213889-1-leon@kernel.org> <20210405052404.213889-3-leon@kernel.org> From: Adit Ranadive Message-ID: <7246a8dc-d484-e022-0270-23e29eaea390@vmware.com> Date: Mon, 5 Apr 2021 13:40:29 -0700 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [71.204.167.113] X-ClientProxiedBy: BY3PR04CA0017.namprd04.prod.outlook.com (2603:10b6:a03:217::22) To BY5PR05MB7155.namprd05.prod.outlook.com (2603:10b6:a03:1bf::24) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from aditr-a02.vmware.com (71.204.167.113) by BY3PR04CA0017.namprd04.prod.outlook.com (2603:10b6:a03:217::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3999.26 via Frontend Transport; Mon, 5 Apr 2021 20:40:30 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 36e5738e-3a05-479b-44d9-08d8f8730e0b X-MS-TrafficTypeDiagnostic: SJ0PR05MB7341: X-LD-Processed: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0,ExtAddr X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:580; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: /vynTHLHZfa7GV83Z2iZ1hUCJuEz/L/0v7ppej4i30yCDay1NYNSfwDfTIFwp04YM16OnsRSe4TGswGYifQHvPxQaDiiyuALW/IjvMA7Ho25vYcrp3LX2zJtG8mHur8L3M7nUBK7NZEB99nYeMYkT7y+nbu3fOzRO2YG8LUc+Q48wrqUnlhiGO03ieYfTngcVDUAsYMTihHhz/Xr9AHp9EV6SJ23lFjWVxf1++fKXOIXsqUxdFqC8CJWbOvKgAtN229m7LP5nd87ThpqxU4Uepqfnf8lEmvXpOwG9YO1ulIhYOM491o+AOar6oDe5n2LEiKZ8ZaI0F08qRAjMW2llHNRTmT5Q7LmdJnnJWIuTJ5s+dkwwl4KLeH8BrJfG7cQpvie5C1NTnnERkWktbdX5r5V+waDqTPfxd4KOaI0XQLW1Q+WYo3lYHcoJ/dmk0+PDZJiZo8AFrvUYowmvtMq/IWGBtKKjQ/vAyXsUY2iNleW5afev3MpCHMZ2vJ/wJupxgvp3XCpnBMMX2JW0WQPjxRvVFfOj6StbCdyTfOcIjK/ge8zFcCwvtw8Dphz0AaS5GkDXqeCcPNElqCrc9exyzmCsFE2kz0+AoTrilFXid1oN4VPF4fORzMCpYE/4byLlBHQ3JIKeageG0ImvClMpPXSU0SjkTBPibiDlBzCwZSyNjW23VhUdrMDwqXJazgTbMhUM23JgXDjUBDuXqgUF1LPPnSc61IbSGxQSChnc9E= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BY5PR05MB7155.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(376002)(39860400002)(396003)(136003)(366004)(346002)(478600001)(6486002)(83380400001)(7696005)(36756003)(2616005)(31686004)(8936002)(186003)(66556008)(66476007)(66946007)(4326008)(16526019)(8676002)(86362001)(53546011)(110136005)(31696002)(54906003)(956004)(7406005)(7366002)(7416002)(5660300002)(26005)(316002)(2906002)(38100700001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData: =?utf-8?B?RWxmdmo5RFZ0dEtVOFJWb3Y5TDQ3cUJmMTRveDlzNVhvTGVzQ0hHNldqTTAx?= =?utf-8?B?NTBwRVdvZHAxZUpkRUkwUXFhczVIWFU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change-CrossTenant-AuthSource: BY5PR05MB7155.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Apr 2021 20:40:32.2157 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: XAt9q7HxE8cbKfbH6TY/pIyZrAUq64tbkPnedCjIjPNuUXbYaeVmzb28O7EDFZmACBPBO07x39zb8Vk18SU4ug== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR05MB7341 Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On 4/5/21 11:01 AM, Tom Talpey wrote: > On 4/5/2021 1:23 AM, Leon Romanovsky wrote: >> From: Avihai Horon >> >> Enable Relaxed Ordering in __ib_alloc_pd() allocation of the >> local_dma_lkey. >> >> This will take effect only for devices that don't pre-allocate the lkey >> but allocate it per PD allocation. >> >> Signed-off-by: Avihai Horon >> Reviewed-by: Michael Guralnik >> Signed-off-by: Leon Romanovsky >> --- >>   drivers/infiniband/core/verbs.c              | 3 ++- >>   drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c | 1 + >>   2 files changed, 3 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/infiniband/core/verbs.c b/drivers/infiniband/core/verbs.c >> index a1782f8a6ca0..9b719f7d6fd5 100644 >> --- a/drivers/infiniband/core/verbs.c >> +++ b/drivers/infiniband/core/verbs.c >> @@ -287,7 +287,8 @@ struct ib_pd *__ib_alloc_pd(struct ib_device *device, unsigned int flags, >>       if (device->attrs.device_cap_flags & IB_DEVICE_LOCAL_DMA_LKEY) >>           pd->local_dma_lkey = device->local_dma_lkey; >>       else >> -        mr_access_flags |= IB_ACCESS_LOCAL_WRITE; >> +        mr_access_flags |= >> +            IB_ACCESS_LOCAL_WRITE | IB_ACCESS_RELAXED_ORDERING; > > So, do local_dma_lkey's get relaxed ordering unconditionally? > >>       if (flags & IB_PD_UNSAFE_GLOBAL_RKEY) { >>           pr_warn("%s: enabling unsafe global rkey\n", caller); >> diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c >> index b3fa783698a0..d74827694f92 100644 >> --- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c >> +++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_mr.c >> @@ -66,6 +66,7 @@ struct ib_mr *pvrdma_get_dma_mr(struct ib_pd *pd, int acc) >>       int ret; >>         /* Support only LOCAL_WRITE flag for DMA MRs */ >> +    acc &= ~IB_ACCESS_RELAXED_ORDERING; >>       if (acc & ~IB_ACCESS_LOCAL_WRITE) { >>           dev_warn(&dev->pdev->dev, >>                "unsupported dma mr access flags %#x\n", acc); > > Why does the pvrdma driver require relaxed ordering to be off? PVRDMA doesn't support any other flags other than LOCAL_WRITE for DMA MRs so the MR creation will fail if any new unconditionally added flag isn't cleared.