From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932145AbdCFKTH (ORCPT ); Mon, 6 Mar 2017 05:19:07 -0500 Received: from lelnx193.ext.ti.com ([198.47.27.77]:36390 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753048AbdCFKRX (ORCPT ); Mon, 6 Mar 2017 05:17:23 -0500 Subject: Re: [PATCH v2 04/22] Documentation: PCI: Guide to use pci endpoint configfs To: Christoph Hellwig References: <1487325042-28227-1-git-send-email-kishon@ti.com> <1487325042-28227-5-git-send-email-kishon@ti.com> <20170217171506.GB15276@infradead.org> CC: Bjorn Helgaas , Jingoo Han , Joao Pinto , , , , , , , From: Kishon Vijay Abraham I Message-ID: <58BD36EF.9070804@ti.com> Date: Mon, 6 Mar 2017 15:46:15 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2 MIME-Version: 1.0 In-Reply-To: <20170217171506.GB15276@infradead.org> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Friday 17 February 2017 10:45 PM, Christoph Hellwig wrote: > I'm commenting on the configfs layout here instead of the patch with the > code as the issues are easier to explain that way. I think the layout > is a bit confusing and could be cleaner by making use of pre-created > entries and symlinks. Here is my suggestion: > > /sys/kernel/config/pci_ep/functions/ > .. test/ # a directory for each function driver > ... user-specified-name1/ > ... user-specified-name2 > .. nvme/ > ... user-specified-name42/ > > Each directory under /sys/kernel/config/pci_ep/functions/ is owned > by a function drivers. Under that function driver's directory you > can create a directory for each instance of a function driver. The > configfs layout is controlled by the function driver. E.g. your current > EPF fields would move into the test function driver, while the nvme > function would expose totally different fields. > > > /sys/kernel/config/pci_ep/controllers/ > ... dwc-0/ > ... function > ... dwc-1/ > ... function > ... vhost-0/ > ... function > > Here you have a directory for each controller that can be bound > to a function. The directories are pre-created for each > controller port that is EP capable. > Function is a symlink to the function instance above. > Additional parameters might also be present depending on the > EPC driver. I've changed the configfs entry according to your suggestion. However I've considered only the generic test function and a standard EP controller and implemented the configfs in a single file pci-ep-cfs.c. But I think this will get more complex as we add custom parameters for individual EPC, new functions etc.. Thanks Kishon