Received: by 10.223.185.116 with SMTP id b49csp4042520wrg; Mon, 26 Feb 2018 10:08:08 -0800 (PST) X-Google-Smtp-Source: AG47ELuDWx5ZSiIrqnTxKWBptUmA9dbbIPEFknClhoVwAhoRe1M2yXbFG+Kdb+gGVXLl2Ie01aVF X-Received: by 2002:a17:902:8a8d:: with SMTP id p13-v6mr7940156plo.144.1519668488205; Mon, 26 Feb 2018 10:08:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519668488; cv=none; d=google.com; s=arc-20160816; b=HNUyAHJLaAL9Idv9BbpzYbwePS3j/i2OPYS313M1+eInbo3h+eTkFrlvpwoz8HTuR5 ZcvLAfYMTCRkfIuR3JbpzT8q8xyXG7DWbQz08GzoaZm96595VQ5Hu7DfBCuH10Uzy3C8 +/sILY6i0xuzhzJZ3RNMoM8il85wdMxfNPX0iqOg6cAl4QWpVASNjbbMAZE6zIbqwMNe hFMkgKVmuUOpnevlGtQ0D/wE3Jpg7XLI4yniEo9DKm88zEh9e7dm67ocN17cAf8tqJef 3VVZFughZpzipfGXPvvjHbkkVgECkN1Tebx2TMCwJ4rNgbwFD8bLUUGCtaGBVt4L5ZnH TsAg== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:arc-authentication-results; bh=iJ1W4S9s8MEmEXETJ2UiODYOnsxgrV91vDbKP4sVBS0=; b=TVILwA5wPCRYdqfugjTZUi7ZuHN1sb4O251NiUSkwLICJWtRxasB9mNDp1CXnZqg99 oJdYBJr6TV0h+FzjfOWLhLiLIOX5h3bbc4O/EAtJYvSygtFhbHU7l7gUr1X7ktP/8JuZ rpZZB1EYr/xxPgGLfM0vec0KnG1UvOvcXElipY0iwEu2ijWv3BthzLeAHd1lQGqbfI7w XLJEteIkg1iksrG9kgHZJn07v48AjSWa2wDm16bhqJfjdW+5fOng18nMgAjpy14yxdjh uYM8ChHhmSl7TJ+2xJ8snL/SYFzkOb2Nx1Z0c0qehXgmgqnC9dk0izz5+lBAhqmvye5S zDaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rPMhfeKm; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a6-v6si7044807plz.497.2018.02.26.10.07.51; Mon, 26 Feb 2018 10:08:08 -0800 (PST) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rPMhfeKm; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751868AbeBZSFf (ORCPT + 99 others); Mon, 26 Feb 2018 13:05:35 -0500 Received: from mail-qk0-f174.google.com ([209.85.220.174]:34944 "EHLO mail-qk0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750767AbeBZSFd (ORCPT ); Mon, 26 Feb 2018 13:05:33 -0500 Received: by mail-qk0-f174.google.com with SMTP id s188so20157963qkb.2; Mon, 26 Feb 2018 10:05:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=iJ1W4S9s8MEmEXETJ2UiODYOnsxgrV91vDbKP4sVBS0=; b=rPMhfeKmxdUgJIWG66+cJKYMPB8W+J8a2W0KwoSAaVhJpexxwItGdVFIHiCTONURf+ /WuyClctvJakYbMAVdP4BmPml+8+sleHZrtRmB0gMLP2P+qClFlXhliBTMCNwmqHHX0V hFFb7oEWWF0qn56r3lVkwzVzkGJ7tvZQ1/miDowtYi4K8PGEqLuwFfLVLVs1JkeRNqea bO6wHWzhEn/OByyFSiyE7ENTleWOCNk86HKC4oVMPxiStqJZTj402xBJMDoF6/nVN6UB QFVgYpJydNtihWHWYo3QSBlH4Hz64TgsuxH9qkzma/vb1muVw4fobXOovyyc6vMnekND nbPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=iJ1W4S9s8MEmEXETJ2UiODYOnsxgrV91vDbKP4sVBS0=; b=BHRZmuhEE9qbHvUkkEnkzIjofXd20RY1p1+g5ByQn11k1HEePnDExRbxRDs2YY74Xk 6pD3WBOjFgGYVaBtYfEbZclVOEy+k44qzTpeuEbMiSvmdgqRDn8KnBWsO+70nEj1l8DC qXCUPayxVbXG9PNHy6eK81SbSiUo24AD6DMLD+RjplfWr/wnxYL28pJkGaTmRKE0fYOz tstbDjRngo7b1FJ/qyYU4mxxim59QWL4wtg4+ibb6Wx7gnIVIaxra9/hWPbk0vmd7b0H DyhmrseSNhVYJC6iHK+lTr086sXqsX9l4PmwJFJmShPogM+Y6s4N6jo7Mq+JK8fWsUge EaiQ== X-Gm-Message-State: APf1xPCJQms79yiApb4Rq5SMsUUGJA3lUFTZg4lByEGHbu19rAlbeAXf GVM0hX8wvcER5HLDj9W75QOJ2yDaREcR6W9BRVM= X-Received: by 10.55.173.7 with SMTP id f7mr17883060qkm.195.1519668332309; Mon, 26 Feb 2018 10:05:32 -0800 (PST) MIME-Version: 1.0 Received: by 10.140.89.138 with HTTP; Mon, 26 Feb 2018 10:05:31 -0800 (PST) In-Reply-To: References: <20180226044837.19543.12267.stgit@mdrustad-mac04.local> From: Alexander Duyck Date: Mon, 26 Feb 2018 10:05:31 -0800 Message-ID: Subject: Re: [RFC PATCH V4] pci: virtio_pci: Add SR-IOV support for virtio_pci devices To: "Rustad, Mark D" Cc: "virtio-dev@lists.oasis-open.org" , Netdev , LKML , "linux-pci@vger.kernel.org" , "Daly, Dan" , Alex Williamson , "MRustad@gmail.com" , "Michael S. Tsirkin" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 26, 2018 at 9:48 AM, Rustad, Mark D w= rote: > Alex, > >> On Feb 26, 2018, at 7:26 AM, Alexander Duyck = wrote: >> >> Mark, >> >> In the future please don't put my "Reviewed-by" on a patch that I >> haven't reviewed. I believe I reviewed one of the earlier patches, but >> I hadn't reviewed this version. > > I'm very sorry. I completely spaced doing something about that. I think y= ours was the first Reviewed-by I ever had in this way. In the future I will= remove such things from my changelog right after sending. Thanks for alert= ing me to what I had failed to do. > >> Also, after thinking about it over the weekend we may want to look at >> just coming up with a truly "generic" solution that is applied to >> SR-IOV capable devices that don't have a SR-IOV capable driver loaded >> on them. That would allow us to handle the uio, vfio, pci-stub, and >> virtio cases all in one fell swoop. I think us going though and >> modifying one patch at a time to do this kind of thing isn't going to >> scale. > > The notion of that kind of troubles me - at least pci-stub does. Having w= orked on ixgbe a bit, I have to wonder what kind of havoc would ensue if an= ixgbe device were assigned to a guest, and an attempt was made to allocate= VFs by the pci-stub. The guest could be running any version of the ixgbe d= river, possibly even an old one that didn't support SR-IOV. Even if it did = support SR-IOV, I don't know how it would respond to mailbox messages when = it doesn't think it has VFs. The assumption here is that the root user knows what they are doing. We have already had some discussion on this in regards to VFIO. My thought is we look at adding a new PCI sysfs option called "sriov_unmanaged_autoprobe" that would be similar to "sriov_drivers_autoprobe" and is used to determine if we allow for auto probing of the VFs into the host kernel when SR-IOV is enabled. I would want to default the value to false so that by default an unmanaged PF wouldn't have its VFs assigned to the host unless we specifically enable it by updating the sysfs value. >> I'll try to do some digging and find the VFIO approach we had been >> working on. I think with a couple tweaks we can probably make that >> truly generic and ready for submission. > > I'd like to know more about you are thinking about. Basic idea is to take your generic SR-IOV enable/disable bits from (http://patchwork.ozlabs.org/patch/877674/) and combine it with the some of the autoprobe bits and feedback comments from (http://patchwork.ozlabs.org/patch/846454/). The idea would be when either no driver is loaded, or a driver without the sriov_configure method we update the iov auto probe setting based on the value we set via sriov_unamanaged_autoprobe, and then call your generic configuration method to enable SR-IOV.