Received: by 10.223.185.116 with SMTP id b49csp7797121wrg; Thu, 1 Mar 2018 11:14:37 -0800 (PST) X-Google-Smtp-Source: AG47ELsCKHz1bqAiKlXHmIAXc/E6sDKo/O661l6AzxHsqGiP8hQIOBDYlCD7e74zsG1/P9aQpvBr X-Received: by 2002:a17:902:6884:: with SMTP id i4-v6mr2825223plk.259.1519931676931; Thu, 01 Mar 2018 11:14:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519931676; cv=none; d=google.com; s=arc-20160816; b=Zhcv6vuu4Fo1mbCmzCVR1/0F9UKiXKC5io4e9Xs1UdQrqM5WvC+oYHHqgOkgmdyxzY /Me4AV/onStSi8+NhVQU3/2zEYzSJVxzYB5YqoaMu7iCtektyHscrLO94QLHzgZR0uKu PQAYBRyR6MMH7ekiR3PIXQRcLrW/PFVRGWlymicdbZfngNf8QdkwhfKoUBXb4oGy6XV4 qs1q332w62h1rpX1dd+jWq711h+3+CzNaCenwLkBU6xhfTEPzDnu30/1Yca+CGBMSELT kpyTJychkiaZnDhX6WkK4LW/x5B4zyGs1bQL40zUIkSV9cOeSJq4eQg6DwsQBcxyqHqw y2Jw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:subject:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:arc-authentication-results; bh=6CCoqU46EKbsd7Vl1f3i4H/NdpxjnJmD5K8Ts/0vCbY=; b=vba/Wx7cbZEHcvIaFa9ALsDmMDxmwWw93d6wFcfkGw2dH4oAKA5hkMYJO9zGgbDNPo DcOAmcsZgYKVPkO3uyPje32mW7Kfu79e0B85IRgqM0bM2tZUKd1Pl5FrtT/1Iqefnbf8 LxrEKPkhjNedXAaiAPCCLtwRlTunnzKx4FpcsYF+kd3e3qjvIfg52HwM4/ZhEBwFOCAb IuF7b3+D814wWSqmuJ5Us/8Vu4rwMtIBjRqaKHB9cDXYl48YJuITLmuKeFwF7MabQfhF BrahWvon8+Zl8vra1yKDbvoYibikgAXELUvZ67dbbybrY0uBYxD5iQpyuxua5//UDbvo 5rlA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l5-v6si3549687plk.390.2018.03.01.11.14.21; Thu, 01 Mar 2018 11:14:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161195AbeCATNb (ORCPT + 99 others); Thu, 1 Mar 2018 14:13:31 -0500 Received: from ale.deltatee.com ([207.54.116.67]:37570 "EHLO ale.deltatee.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161161AbeCATN1 (ORCPT ); Thu, 1 Mar 2018 14:13:27 -0500 Received: from guinness.priv.deltatee.com ([172.16.1.162]) by ale.deltatee.com with esmtp (Exim 4.89) (envelope-from ) id 1erTdk-0000AU-Hf; Thu, 01 Mar 2018 12:13:17 -0700 To: Bjorn Helgaas Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, linux-nvme@lists.infradead.org, linux-rdma@vger.kernel.org, linux-nvdimm@lists.01.org, linux-block@vger.kernel.org, Stephen Bates , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , Dan Williams , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , Benjamin Herrenschmidt , Alex Williamson References: <20180228234006.21093-1-logang@deltatee.com> <20180228234006.21093-5-logang@deltatee.com> <20180301180257.GH13722@bhelgaas-glaptop.roam.corp.google.com> From: Logan Gunthorpe Message-ID: Date: Thu, 1 Mar 2018 12:13:10 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180301180257.GH13722@bhelgaas-glaptop.roam.corp.google.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 172.16.1.162 X-SA-Exim-Rcpt-To: alex.williamson@redhat.com, benh@kernel.crashing.org, jglisse@redhat.com, dan.j.williams@intel.com, maxg@mellanox.com, jgg@mellanox.com, bhelgaas@google.com, sagi@grimberg.me, keith.busch@intel.com, axboe@kernel.dk, hch@lst.de, sbates@raithlin.com, linux-block@vger.kernel.org, linux-nvdimm@lists.01.org, linux-rdma@vger.kernel.org, linux-nvme@lists.infradead.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, helgaas@kernel.org X-SA-Exim-Mail-From: logang@deltatee.com X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on ale.deltatee.com X-Spam-Level: X-Spam-Status: No, score=-8.7 required=5.0 tests=ALL_TRUSTED,BAYES_00, GREYLIST_ISWHITE,MYRULES_NATURALLY,T_RP_MATCHES_RCVD autolearn=ham autolearn_force=no version=3.4.1 Subject: Re: [PATCH v2 04/10] PCI/P2PDMA: Clear ACS P2P flags for all devices behind switches X-SA-Exim-Version: 4.2.1 (built Tue, 02 Aug 2016 21:08:31 +0000) X-SA-Exim-Scanned: Yes (on ale.deltatee.com) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/03/18 11:02 AM, Bjorn Helgaas wrote: >> void pci_enable_acs(struct pci_dev *dev) >> { >> + if (pci_p2pdma_disable_acs(dev)) >> + return; > > This doesn't read naturally to me. I do see that when > CONFIG_PCI_P2PDMA is not set, pci_p2pdma_disable_acs() does nothing > and returns 0, so we'll go ahead and try to enable ACS as before. > > But I think it would be clearer to have an #ifdef CONFIG_PCI_P2PDMA > right here so it's more obvious that we only disable ACS when it's > selected. I could do this... however, I wrote it this way because I've read Linus dislikes using #ifdef's inside function bodies and I personally agree with that sentiment. Logan