From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com ([209.132.183.28]:46166 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752132Ab3ABRI0 (ORCPT ); Wed, 2 Jan 2013 12:08:26 -0500 Message-ID: <50E4697F.70408@redhat.com> Date: Wed, 02 Jan 2013 12:08:15 -0500 From: Don Dutile MIME-Version: 1.0 To: Bjorn Helgaas CC: "Rose, Gregory V" , linux-pci@vger.kernel.org, Yuval Mintz , bhutchings@solarflare.com, yinghai@kernel.org, davem@davemloft.net Subject: Re: [PATCH v2] PCI SRIOV device enable and disable via sysfs References: <1352146841-64458-1-git-send-email-ddutile@redhat.com> <20121214101911.00002f59@unknown> <50CF7993.9040606@redhat.com> <20121217232439.GA9746@google.com> <50D24355.1050100@redhat.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Sender: linux-pci-owner@vger.kernel.org List-ID: On 12/21/2012 02:49 PM, Bjorn Helgaas wrote: > On Thu, Dec 20, 2012 at 2:47 PM, Bjorn Helgaas wrote: > >> I made the -EPERM change suggested by Greg and added this to my >> pci/for-3.8 branch. I'll ask Linus to pull it soon after v3.8-rc1. > > After a little off-list discussion about the merits of EINVAL, EPERM, > EBUSY, etc., I adopted Ben's suggestion of EBUSY for this case: > > + if (pdev->sriov->num_VFs) { > + dev_warn(&pdev->dev, "%d VFs already enabled. Disable > before enabling %d VFs\n", > + pdev->sriov->num_VFs, num_vfs); > + return -EBUSY; > > where the idea is "the device is already busy providing N VFs, so you > can't configure it to serve M VFs" > > Does that sound agreeable to everybody? > > Bjorn Ack!