Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4703487imm; Wed, 30 May 2018 10:17:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLTy3pe40fKMLy3dsMk16OZemI4+/Q7WuO8hgxN+WoZn8SPCjIvNQdm3Bewl7sxk4xDVCpP X-Received: by 2002:a62:5dc5:: with SMTP id n66-v6mr3558871pfj.220.1527700621059; Wed, 30 May 2018 10:17:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527700621; cv=none; d=google.com; s=arc-20160816; b=QRnh0z2S75gNV1z7AuXc3XPt0LYtPFKBSjd8GFkQ9n0/tHXt29MceTnPIjN46eHxQX aQBpYme+syRecSgnCsC1I72OA39K3d8VEm1KfVWAjQPuZhYhAZfwUmvE8dvjtLXkCBny LLQhNaqNanoYqTYsceKVdR6G61EiIy7/T8HiBW+/j22eOhJTsH01Fb9JTtnqJu3Iznq3 mT9bVuAceZE5IJg08LxIT8KVJHXoezgx+0eNjjWfXWtXBU38FGl6U23Vx0MU7D6ReN4U gJJgrGtIUdKWQ5HwNWh4yNtPmDSoJJhZ4P8rZNP/5aT57eDEUCLPk7pxTK2OxEXfhi+v QbcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=dAJ8djxkcM1gU73bUt6RkQeg4psQngm9KiN4XQ7boRE=; b=a69umrZxz6o9oxSsMK2Q1qS+FKVE+XP11mkd+3KarECVBQqMKlsG/AZN0hiDYvioNi l/QgZF/xeQUxM9E/NQIB3nLHHWsK7jZm1Bc5/o1SKSdTAMgPZbcy69aM/RN8+jjSGTtD GS/WfEdbPfnMmACfUBVLCStYiHljIPkbgVaHKBeFWUUVBCJ6a1x5s0Zgu6NQER6sITKb pIUW9cIrIgY6/q4CaPK/lPNzT0bcubFfG86DzUCq4va7hJcv9KjlCFLimMRd8oahoQHx YBk0VMkRFTFHTjL55UdvV7U8/g6MBYZQKwaJ88z+tmwbhAs0DbHbX0s9omt3Wy2Wtivp tx4A== 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 u4-v6si13019354plj.43.2018.05.30.10.16.47; Wed, 30 May 2018 10:17:01 -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 S1753013AbeE3RPt (ORCPT + 99 others); Wed, 30 May 2018 13:15:49 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:44522 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753359AbeE3RPp (ORCPT ); Wed, 30 May 2018 13:15:45 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 32CC84022414; Wed, 30 May 2018 17:15:45 +0000 (UTC) Received: from redhat.com (ovpn-120-96.rdu2.redhat.com [10.10.120.96]) by smtp.corp.redhat.com (Postfix) with SMTP id 46C622026DFD; Wed, 30 May 2018 17:15:44 +0000 (UTC) Date: Wed, 30 May 2018 20:15:43 +0300 From: "Michael S. Tsirkin" To: "Duyck, Alexander H" Cc: "alexander.duyck@gmail.com" , "linux-kernel@vger.kernel.org" , "virtualization@lists.linux-foundation.org" , "virtio-dev@lists.oasis-open.org" , "Rustad, Mark D" , "Daly, Dan" , "Bie, Tiwei" , "linux-pci@vger.kernel.org" , "bhelgaas@google.com" , "Liang, Cunming" , "Wang, Zhihong" Subject: Re: [virtio-dev] [PATCH] virtio_pci: support enabling VFs Message-ID: <20180530201034-mutt-send-email-mst@kernel.org> References: <20180530085521.26583-1-tiwei.bie@intel.com> <20180530192215-mutt-send-email-mst@kernel.org> <1527697588.16245.136.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1527697588.16245.136.camel@intel.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 30 May 2018 17:15:45 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.6]); Wed, 30 May 2018 17:15:45 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 30, 2018 at 04:26:30PM +0000, Duyck, Alexander H wrote: > On Wed, 2018-05-30 at 19:22 +0300, Michael S. Tsirkin wrote: > > On Wed, May 30, 2018 at 09:10:57AM -0700, Alexander Duyck wrote: > > > On Wed, May 30, 2018 at 1:55 AM, Tiwei Bie wrote: > > > > There is a new feature bit allocated in virtio spec to > > > > support SR-IOV (Single Root I/O Virtualization): > > > > > > > > https://github.com/oasis-tcs/virtio-spec/issues/11 > > > > > > > > This patch enables the support for this feature bit in > > > > virtio driver. > > > > > > > > Signed-off-by: Tiwei Bie > > > > > > So from a quick glance it looks like we are leaving SR-IOV enabled if > > > the driver is removed. Do we want to have that behavior or should we > > > be adding the code to disable SR-IOV and free the VFs on driver > > > removal? > > > > Could pci core handle it for us somehow? > > Maybe, but it would require changes to the pci core to do it. > > The problem is some drivers want to leave the VFs there since the PF > doesn't really do anything, or they have the option of essentially > putting the VFs into a standby state when the PF is gone. > > My main concern is do we care if VFs are allocated and then somebody > removes the driver and binds a different driver to the interface? If > not then this code and be left as is, but I just wanted to be certain > since I know this isn't just enabling SR-IOV we are having to do a > number of other checks against the virtio device. Well the spec says features have to be negotiated, and since we reset the device when we unbind from it I think it's a given we should keep a driver bound to the PF. IOW until we are sure we need the capability to keep it enabled, let's disable it to be safe. -- MST