Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp5563642rwl; Tue, 11 Apr 2023 07:11:11 -0700 (PDT) X-Google-Smtp-Source: AKy350b3x51Uf/EMF4cZ+VXG3sYpPRmnPJKsRj8oo6GkV34azAHKy75aRJb99Y0/3uzhQ75YUjMs X-Received: by 2002:a17:90b:4acc:b0:237:b702:499f with SMTP id mh12-20020a17090b4acc00b00237b702499fmr18572456pjb.22.1681222271382; Tue, 11 Apr 2023 07:11:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1681222271; cv=pass; d=google.com; s=arc-20160816; b=C49DDyFA1NLt3esCqwetunI7MJDyFRWSf9TWhNfl0kdvOPmm8VN6fQAoUcK6RmVqWv mayIb+D1EuOCql4rbyb+LD1eIE6IkNsbPFvgmujTuJcpt1z40pGUfSAHr8wkEO5tU0A9 HSr1yzA8aHHHf3xLJh2LRTCjecKWcv+7gVjg+xnJFobcD7NX9skwm5JRc7uXTj1yOuu4 c4Lb9QnmXsHG8m0dIKwbbsOqAoqRoD+IqP7iMqjLXyofH9OdUKC7qa+NsXQtGAfE8Jt+ tF2JriRmW4wiQEe3GDvWIw8Wt+N8QYTgX0dXsnvV4tq+wCUxvrQD5vedfuglgYEwZsmD MMFQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:in-reply-to:content-disposition :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ST+0aIr4HCS7shAG0Xxk1aGPdBb0zd56Sh+Cr48R2q8=; b=aajiOhT9tG0jjq2Q4dq1SO/DmXliF/7XvIbTxw1GLO1dhFEDDeAkLwWuQHeiSf05I7 YjFlF23aTozevcn8hhak6+mRPlb7PonvY2DxuydYhX6jsiRUGHhjTIkmpE/vhVfk7tzh Gm3/j6Shi5eNlDi92/4CZ0GC7rRNO9KChbjVVCu53/weWondUQ8enplPS/Rrx/gAtNe4 iKdIvEM46aZqkGQKyS/B6ibvS21DPVsenTi6rNYFn1nGekeGm/Hm9mAiioNXOhvjvZHs VmzXWacB57/Oo1V4uFX3OB6fkd1ssXcKVjuKmc9jZglHwC/kV0ubwm1rDz7+cMGy9oym jMUA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=rrMQTT6E; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oj16-20020a17090b4d9000b0023f37b648d9si13095084pjb.157.2023.04.11.07.10.55; Tue, 11 Apr 2023 07:11:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=rrMQTT6E; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231185AbjDKOBJ (ORCPT + 99 others); Tue, 11 Apr 2023 10:01:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55928 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230471AbjDKOBI (ORCPT ); Tue, 11 Apr 2023 10:01:08 -0400 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (mail-dm6nam12on2087.outbound.protection.outlook.com [40.107.243.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EFFC5121; Tue, 11 Apr 2023 07:01:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kH8wFAkrE4qZliL5c3gW+619oyLeiJY3+Aj22gVafvOXNGUOlpo/O+ndXof+YpIKVZj+S3VU+jekoD3T6SJ7vGo+AyZn+5j2VIR/hcz4yqzLGXobLEhVJ3YJB254Z4ZWX4r2+eOuTFft07Ph/FT7lhU27biif/KyvoLYpUNMRJi+Jhtj83vB7z2B8zL8OfZu+qLGzjQ0ZrQ5Gn5LrRsUdOPDA84EddJXuS/VIJtMb+SnqP/BlFa9w8DvvOLGzfQUMIyrq8q6Ctihv3YOGQiWflPtYkqQFqVLb5mK3LABs79pY4reTQTXriSHYi46x9jPJYrbRwNHKNx4+7KC3NZKzw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=ST+0aIr4HCS7shAG0Xxk1aGPdBb0zd56Sh+Cr48R2q8=; b=dBA4OvebaQqnbQ06fi7dNbjkFblNk0YvwxLNpawuglMqf/w0RTkdGdkv5MHSuCjO70QlrOWlamAaTCoYVIlGrblkMD4XnOhh5qFXF923XLBkABOl0o6e1uo9ibRhB2rAZfZo5spUj4MKSYe54URawgvm+40Sdn4wqS5cdd9gxfY3X32kvwhiVahm435HxQ44ChXU4ttuO+LVwE/w9dRLIYrM0Y1VylcaqJZBS8qSg/bVIHa+ZBkSceNgKjN/z3OC2z4yqiGdzWixkgMbx+qaNhyyW9T5So+WX8WfTvrOyGVYV6blFOHSlLhrIY5xLQMCOw48AxTsr2uH24BaqUJlMA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ST+0aIr4HCS7shAG0Xxk1aGPdBb0zd56Sh+Cr48R2q8=; b=rrMQTT6E/3DMOWunCKxx8VtvfQWq7PkQBZ7UxLnYB/2UPRxufHLkbuL7XiZiLiKZqPYOVfUQDTX+XHHU/mUgozsgcWogsn/D9nfi+M+82AigClGYYLIvUzaynnZYSZ8ILxfblq1wNchPx3GNuBA7Hc20k9KfPqL/5S6FrrOA1MBFD3dtxC/O4h79Holv/cFZX8JSROv9yBI2McIE1IQjrauslSDQ53VW1XoKe2mmZAZW9YEcrlsRl9Af1nU0tRBRMvauSJkJ4AO7vnMEEklMoG4oEVs1uPWMQzcdf5qVYK7qYlSoHRn7DAMYNHB2TVc9StQFKuMppZWd5DQ7JPh5rQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) by DM6PR12MB4927.namprd12.prod.outlook.com (2603:10b6:5:20a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6277.35; Tue, 11 Apr 2023 14:01:05 +0000 Received: from LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::6045:ad97:10b7:62a2]) by LV2PR12MB5869.namprd12.prod.outlook.com ([fe80::6045:ad97:10b7:62a2%9]) with mapi id 15.20.6277.038; Tue, 11 Apr 2023 14:01:04 +0000 Date: Tue, 11 Apr 2023 11:01:03 -0300 From: Jason Gunthorpe To: Leon Romanovsky Cc: Leon Romanovsky , Avihai Horon , Aya Levin , Eric Dumazet , Jakub Kicinski , linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, Meir Lichtinger , Michael Guralnik , netdev@vger.kernel.org, Paolo Abeni , Saeed Mahameed , Shay Drory Subject: Re: [PATCH rdma-next 0/4] Allow relaxed ordering read in VFs and VMs Message-ID: References: Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-ClientProxiedBy: YT4PR01CA0090.CANPRD01.PROD.OUTLOOK.COM (2603:10b6:b01:ff::16) To LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: LV2PR12MB5869:EE_|DM6PR12MB4927:EE_ X-MS-Office365-Filtering-Correlation-Id: 2be22f36-2011-409a-5fd1-08db3a9530cf X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2WKgrqelUymq0JqHByL2cNGijgNMs+TQqYBjTv9sMcXStpPvKVBYlO2z8gmn0w8exvBIXD/Y/kZzFjB1WDFaanoHL4VvMiNd9fYzdPl5VHFOCzTjSSaJfdkulfiKc4s43VSNsjOJMG/QYacyz2qLGDgFP9NS8cbdH/1rjPWdi2dU2KtxeobU61d73TGVaa1Pz1VuRZvg6CewBRlW65pX3wRCjiyHWKXOHw/0WF/tWnz8Dsy0zbPYUHALDv+CtKt3tx6eInG5uAdZXmgWkrYVFEU/u9UTCs21rFuXRpvLTBTS5QUyOUXEhhp7++LnStckHdN0d+zf7lYpc/run7zTgswutCa/PSRQnEl+GWL999h7hTrF9H2Ly3Xlt1kYhzMnEKDngnvMzfl/v5EjxTM/tE9C7ZQuUCZe6c5gQ3t6NDRotLvv0EsOknQ+/IGNwrzEG0BelhbtQtL+xIMSZacOcuSgr7M7vmtGhT59VZvuYqEiEa6u/y4pJ3rh4Je0pzl4LGc8hSemxI2Fgqmrzg/zBRCa/68hC36ACVkJrUCWwoMAQ7E2h5P6uBQajYRrtdZl X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:LV2PR12MB5869.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230028)(4636009)(366004)(396003)(376002)(346002)(39860400002)(136003)(451199021)(478600001)(6512007)(316002)(26005)(6506007)(186003)(54906003)(6486002)(2906002)(5660300002)(4326008)(66946007)(107886003)(41300700001)(8676002)(6916009)(66476007)(8936002)(66556008)(86362001)(83380400001)(36756003)(2616005)(38100700002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?JFmWWngR1YYKJYso++hekIDiRF2pEiqsxZG51sTv8eBsNPzNHw2RsThEpRmd?= =?us-ascii?Q?iiM1AWB8AXGU2MLqIBPzPiwpkjyOGuzN4WMkyMNw1LanPsTMjEogkKPZMeXk?= =?us-ascii?Q?PbBR6jgugAGZTKzL3VNxOgpqW4bqbQlx83ZcfyT/47yJLKe2Ces/L+Vsd6EE?= =?us-ascii?Q?hyQQvyCJm4NRmfx1GzxdYnWBjbcoWfxChxJJfSn0K7Hhafn117S+zLBlY/qU?= =?us-ascii?Q?+NZI9kT0kn3aNpbSHYiO4g8cNvMAMVwP8vluCxLqEHEASPdklguwb6mV4jCY?= =?us-ascii?Q?aE7stmSTB30nj+F4gp2yBZJvbvrivNaOFoz2nIbfxxD1g6PMxmjMsGDu7eT9?= =?us-ascii?Q?w9G4q2tHX5nQigmoTAdO7wOIeGa2OfxpNlBj2nCNMcM7zbBOWgLxyV892xvw?= =?us-ascii?Q?4BMaRD0XBl4vaQVa2p8JuG5il7sSSGDtKh7YmUn7+5RrbhrPmN9wFEJnZNgd?= =?us-ascii?Q?PW4ID82qlg2i1SfMvfH+4LWJz3RWsrIndKZbC5wR4R+Tg2MFdqPvPQQZY25i?= =?us-ascii?Q?jF8QycAt/5sAOM5jhPRtRvDRr9nBeTM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ii?Q?qBXfteErEvpKeHRFGgnd4Wv1i9DRNWS2rNapvLND7JOlwgaElY8+8AreW59H?= =?us-ascii?Q?LQn9Apv2sVQvCFD8/hLDkpYpA2XC+5uhuOUScBdLux+qQMwniKTrhOOiqZK4?= =?us-ascii?Q?AeQabbwoXTINu/rKb/Xu6Xix/rA/h4c8sD1P62qN?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2be22f36-2011-409a-5fd1-08db3a9530cf X-MS-Exchange-CrossTenant-AuthSource: LV2PR12MB5869.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 Apr 2023 14:01:04.8346 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Xlj5sXJyupgMiTJuAS7qTOaMF0WY4X4uO3FTPZ5qYIusPBv4Y2wm0auz3+eSurhK X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4927 X-Spam-Status: No, score=0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 10, 2023 at 04:07:49PM +0300, Leon Romanovsky wrote: > From: Leon Romanovsky > > From Avihai, > > Currently, Relaxed Ordering (RO) can't be used in VFs directly and in > VFs assigned to QEMU, even if the PF supports RO. This is due to issues > in reporting/emulation of PCI config space RO bit and due to current > HCA capability behavior. > > This series fixes it by using a new HCA capability and by relying on FW > to do the "right thing" according to the PF's PCI config space RO value. > > Allowing RO in VFs and VMs is valuable since it can greatly improve > performance on some setups. For example, testing throughput of a VF on > an AMD EPYC 7763 and ConnectX-6 Dx setup showed roughly 60% performance > improvement. > > Thanks > > Avihai Horon (4): > RDMA/mlx5: Remove pcie_relaxed_ordering_enabled() check for RO write > RDMA/mlx5: Check pcie_relaxed_ordering_enabled() in UMR > net/mlx5: Update relaxed ordering read HCA capabilities > RDMA/mlx5: Allow relaxed ordering read in VFs and VMs This looks OK, but the patch structure is pretty confusing. It seems to me there are really only two patches here, the first is to add some static inline 'mlx5 supports read ro' which supports both the cap bits described in the PRM, with a little comment to explain that old devices only set the old cap. And a second patch to call it in all the places we need to check before setting the mkc ro read bit. Maybe a final third patch to sort out that mistake in the write side. But this really doesn't have anything to do with VFs and VMs, this is adjusting the code to follow the current PRM because the old one was mis-desgined. Jason