From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Hutchings Subject: Re: New commands to configure IOV features Date: Wed, 19 Sep 2012 23:46:13 +0100 Message-ID: <1348094773.2636.85.camel@bwh-desktop.uk.solarflarecom.com> References: <5003DC9B.8000706@broadcom.com> <5005BD00.4090106@redhat.com> <5005D45D.1040302@genband.com> <20120717.141153.46613285253481776.davem@davemloft.net> <500978C7.5050004@genband.com> <50097FBD.9080202@redhat.com> <1342806146.2678.31.camel@bwh-desktop.uk.solarflarecom.com> <5009B186.6000806@genband.com> <1342814473.2678.65.camel@bwh-desktop.uk.solarflarecom.com> <5009ECDF.4090305@genband.com> <500D59BF.9040006@redhat.com> <500D6932.8090306@genband.com> <20120723113607.56ce7aaf@nehalam.linuxnetplumber.net> <5059A767.2090307@broadcom.com> <20120919085306.00006af9@unknown> <1348083847.2636.37.camel@bwh-desktop.uk.solarflarecom.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Cc: Bjorn Helgaas , Greg Rose , Yuval Mintz , "davem@davemloft.net" , "netdev@vger.kernel.org" , Ariel Elior , Eilon Greenstein , linux-pci To: Yinghai Lu Return-path: In-Reply-To: Sender: linux-pci-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Wed, 2012-09-19 at 15:17 -0700, Yinghai Lu wrote: > On Wed, Sep 19, 2012 at 12:44 PM, Ben Hutchings > wrote: > > On Wed, 2012-09-19 at 08:53 -0700, Greg Rose wrote: > >> I was not able to attend the Linux conference held at the end of August > >> myself but coworkers of mine here at Intel informed that method 2 here > >> seems to be the preferred approach. Perhaps some folks who attended > >> the the conference can chime in with more specifics. > > > > There really wasn't much more specific discussion. Bjorn's summary of > > the mini-summit says: > > > >> SR-IOV Management > >> > >> Currently drivers implement module parameters like "max_vfs". This means > >> all devices claimed by the driver get the same number of VFs, and you can't > >> change anything without unloading and reloading the driver. > >> > >> Consensus that we should try to implement a knob for this in sysfs so it > >> can be generic (not in each driver) and set individually for each device. > > > > I don't think any implementation has been posted to the linux-pci list > > please check attached three patches... [...] > --- linux-2.6.orig/drivers/pci/pci-sysfs.c > +++ linux-2.6/drivers/pci/pci-sysfs.c > @@ -459,6 +459,30 @@ boot_vga_show(struct device *dev, struct > } > struct device_attribute vga_attr = __ATTR_RO(boot_vga); > > +static ssize_t > +max_vfs_show(struct device *dev, struct device_attribute *attr, char *buf) > +{ > + struct pci_dev *pdev = to_pci_dev(dev); > + > + return sprintf(buf, "%u\n", pdev->max_vfs); > +} > +static ssize_t > +max_vfs_store(struct device *dev, struct device_attribute *attr, > + const char *buf, size_t count) > +{ > + unsigned long val; > + struct pci_dev *pdev = to_pci_dev(dev); > + > + if (strict_strtoul(buf, 0, &val) < 0) > + return -EINVAL; > + > + pdev->max_vfs = val; > + > + return count; > +} [...] Then what would actually trigger creation of the VFs? There's no way we can assume that some sysfs attribute will be written before the PF driver is loaded (what if it's built-in?). I thought the idea was to add a driver callback that would be called when the sysfs attribute was written. Ben. -- Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.