Received: by 10.192.165.148 with SMTP id m20csp4910009imm; Tue, 8 May 2018 17:18:21 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr8JeG4D+2QWzZI8dz/3SgkbRDjN4fVuvgUUKv5QZ8OEnsGqASN2CrJD6YnwVP9/x0T0JwM X-Received: by 2002:a17:902:8307:: with SMTP id bd7-v6mr42979588plb.234.1525825101875; Tue, 08 May 2018 17:18:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525825101; cv=none; d=google.com; s=arc-20160816; b=jYzIKl07TSZ0gwpFn1fGFRtt7YZVZDFDkHfMAY0HuQS6iEoSp/gHjiQFJKEMPqHqSP VDi960JywJXDDkaa1UdI/y8HpePS3L72JiGsLl77vxVrOjvqNihZFdBJqcYxTejQ1feW 3TG59eIw0/iXrbNGhwcAbHhh7DPaUHSWOPsZUEwcHBj3L7UWpoBr18dbU0AXE/havYYs /S0Rl/uj/H33EWJzk/6JtC+4CryR7vUtf9acsOIZCkycmKospV7X/xZ/yHPTNT6Kw7nW KtfSxdv+Jitq/sZ+Ddx5tXJfu64fciChSApnn4fyy48FO4cqgHP6HePW2L2IoFPIQMRH 32Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=Crt1+YIFyrdraw021CXlUqwgO6lABsgbqzg25xECEIM=; b=oVxbKJQId990P2mUFwVrqhFG0LtCJRRGMNqQbvmF44zTBGsJa4vPItplRw59Dtxf78 AwU/bzeuXFBPBBwK5GKqwx3IrOgpfxyG4QEfvv5240WCR7tqailgsZy9urnzk5/d6MpS 59PN+bI//s1ljrPVK9EbuJupjQmLU+eJaVh3DmMhSZnM3qa7B0lgteAGMKZpLAGyDaZD s6v941D2bjGJ7Y0ax+rvwBbe1GcLOLnLfEqJnSny6QjkGaNmfFE+2WuuB+4C3FW8e9TA gLCg38lilK7GIl9oo6+2YbQ6Wnb/kEYbi+R8OagYBGMc3w3VWm8b0vvRDXerigtTJTqQ vDwA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l7-v6si26099299plt.197.2018.05.08.17.18.07; Tue, 08 May 2018 17:18:21 -0700 (PDT) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933201AbeEIARj (ORCPT + 99 others); Tue, 8 May 2018 20:17:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53170 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932475AbeEIARh (ORCPT ); Tue, 8 May 2018 20:17:37 -0400 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.25]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7DB953150023; Wed, 9 May 2018 00:17:35 +0000 (UTC) Received: from w520.home (ovpn-116-103.phx2.redhat.com [10.3.116.103]) by smtp.corp.redhat.com (Postfix) with ESMTP id 37D912010CB7; Wed, 9 May 2018 00:17:34 +0000 (UTC) Date: Tue, 8 May 2018 18:17:33 -0600 From: Alex Williamson To: Logan Gunthorpe Cc: Stephen Bates , Christian =?UTF-8?B?S8O2bmln?= , Bjorn Helgaas , "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" , Christoph Hellwig , Jens Axboe , Keith Busch , Sagi Grimberg , Bjorn Helgaas , Jason Gunthorpe , Max Gurtovoy , Dan Williams , =?UTF-8?B?SsOpcsO0bWU=?= Glisse , Benjamin Herrenschmidt Subject: Re: [PATCH v4 04/14] PCI/P2PDMA: Clear ACS P2P flags for all devices behind switches Message-ID: <20180508181733.13cbee8b@w520.home> In-Reply-To: <0a0a1782-04b2-c571-63c7-bfff68312946@deltatee.com> References: <20180423233046.21476-1-logang@deltatee.com> <20180423233046.21476-5-logang@deltatee.com> <20180507231306.GG161390@bhelgaas-glaptop.roam.corp.google.com> <0b4183ef-e720-204b-9e85-b9eaf7a4136a@deltatee.com> <3584a6ac-95c7-5d23-1859-aee30605776e@deltatee.com> <20180508133407.57a46902@w520.home> <5fc9b1c1-9208-06cc-0ec5-1f54c2520494@deltatee.com> <20180508141331.7cd737cb@w520.home> <20180508144341.0441b676@w520.home> <20180508152631.50fd583c@w520.home> <354F7407-0DC7-470C-B9AA-74FDF9C46B08@raithlin.com> <20180508160336.0935ddde@w520.home> <20905682-9440-7d4b-0260-99d3dc794c3d@deltatee.com> <20180508171150.0e8fd291@w520.home> <0a0a1782-04b2-c571-63c7-bfff68312946@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.25 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.46]); Wed, 09 May 2018 00:17:37 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 8 May 2018 17:31:48 -0600 Logan Gunthorpe wrote: > On 08/05/18 05:11 PM, Alex Williamson wrote: > > A runtime, sysfs approach has some benefits here, > > especially in identifying the device assuming we're ok with leaving > > the persistence problem to userspace tools. I'm still a little fond of > > the idea of exposing an acs_flags attribute for devices in sysfs where > > a write would do a soft unplug and re-add of all affected devices to > > automatically recreate the proper grouping. Any dynamic change in > > routing and grouping would require all DMA be re-established anyway and > > a soft hotplug seems like an elegant way of handling it. Thanks, > > This approach sounds like it has a lot more issues to contend with: > > For starters, a soft unplug/re-add of all the devices behind a switch is > going to be difficult if a lot of those devices have had drivers > installed and their respective resources are now mounted or otherwise in > use. > > Then, do we have to redo a the soft-replace every time we change the ACS > bit for every downstream port? That could mean you have to do dozens > soft-replaces before you have all the ACS bits set which means you have > a storm of drivers being added and removed. True, anything requiring tweaking multiple downstream ports would induce a hot-unplug/replug for each. A better sysfs interface would allow multiple downstream ports to be updated in a single shot. > This would require some kind of fancy custom setup software that runs at > just the right time in the boot sequence or a lot of work on the users > part to unbind all the resources, setup the ACS bits and then rebind > everything (assuming the soft re-add doesn't rebind it every time you > adjust one ACS bit). Ugly. > > IMO, if we need to do the sysfs approach then we need to be able to > adjust the groups dynamically in a sensible way and not through the > large hammer that is soft-replaces. I think this would be great but I > don't think we will be tackling that with this patch set. OTOH, I think the only sensible way to dynamically adjust groups is through hotplug, we cannot have running drivers attached to downstream endpoints as we're adjusting the routing. Thanks, Alex