All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jesse Brandeburg <jesse.brandeburg@intel.com>
To: intel-wired-lan@osuosl.org
Subject: [Intel-wired-lan] Not able to create VFs on PF passthrough of ethernet interface to VM
Date: Mon, 13 May 2019 10:53:19 -0700	[thread overview]
Message-ID: <20190513105319.0000594c@intel.com> (raw)
In-Reply-To: <AM0PR07MB531393AB5237B86A25991A7A8A0F0@AM0PR07MB5313.eurprd07.prod.outlook.com>

On Mon, 13 May 2019 07:36:41 +0000 Periyasamy wrote:
> Hi,
> 
> I?m trying to achieve PF passthrough of 40/10G ethernet interface (i40e) into guest VM running on qemu/kvm hypervisor and then create VFs on the PF inside the VM.
> This is to have a flexibility and better manageability of VFs inside the VM (for example, kubernetes worker node) itself and not on the host.
> 
> 
> The ethernet PCI device is seen inside the VM and bound to i40e driver. But I don?t see an option to create VFs. i.e. sriov_numvfs file is not seen under /sys/devices/pci0000:00/0000:00:02.1/0000:02:00.0 directory.

Hi Periyasamy,

The PCI space itself is not passed-through, it is completely fake and
generated by QEMU.

Do you know if anyone has ever gotten what you're trying to do to
work?  I don't think you can do what you're trying to do with using a
VM to spawn SR-IOV devices, at least I've not heard of it working.

Basically you have a scoping problem.  At it's core, the PCI space is
owned by the host, not the VM, and the hardware is literally in the
host PCI device space no matter where you pass it to.  The hardware
actually creates (starts decoding addresses and PCI space for) the new
PCI devices when you enable the device via sriov_numvfs.  Those devices
will appear in space reserved by the host, for SR-IOV devices to
"appear", but there is no guarantee that memory range will be passed
through to the VF, and again all the VM PCI devices are "fake" PCI
config space, so without some daemon monitoring and adding the devices
via virsh or something, I doubt the VM would ever see them even.


> Host versions:
> OS: Ubuntu 16.04.5 LTS, Kernel: 4.15.0-48-generic, libvirt: 4.0.0, qemu: 2.11.1
> i40e version: 2.1.14-k, firmware-version: 6.01 0x800034a3 1.1747.0
> 
> Guest versions:
> OS: CentOS 7 (Core) Kernel: 3.10.0-862.14.4.el7.x86_64
> i40e version: 2.1.14-k, firmware-version: 6.01 0x800034a3 1.1747.0
> 
> The VM libvirt xml configuration [1], PF configuration at host [2], PF configuration at VM [3] are attached.
> The lspci output line nos. 63-75 related to SRIOV Capabilities in host [2] are missing in VM which looks bit weird.

as per above, the PCI config space is completely virtualized by QEMU.

Hope this helps!
Jesse

      reply	other threads:[~2019-05-13 17:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <AM0PR07MB531316C34EDCB413A855132A8A0C0@AM0PR07MB5313.eurprd07.prod.outlook.com>
     [not found] ` <AM0PR07MB531317D299B0EC8D11D67F568A0C0@AM0PR07MB5313.eurprd07.prod.outlook.com>
2019-05-13  7:36   ` [Intel-wired-lan] Not able to create VFs on PF passthrough of ethernet interface to VM Periyasamy Palanisamy
2019-05-13 17:53     ` Jesse Brandeburg [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190513105319.0000594c@intel.com \
    --to=jesse.brandeburg@intel.com \
    --cc=intel-wired-lan@osuosl.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.