From: Yui Washizu <yui.washidu@gmail.com>
To: qemu-devel@nongnu.org
Cc: Yui Washizu <yui.washidu@gmail.com>,
jasowang@redhat.com, mst@redhat.com, akihiko.odaki@daynix.com,
yvugenfi@redhat.com, ybendito@redhat.com, mapfelba@redhat.com,
marcel@redhat.com, ghammer@redhat.com, mdean@redhat.com
Subject: [RFC 0/1] virtio-net: add support for SR-IOV emulation
Date: Wed, 19 Jul 2023 10:56:47 +0900 [thread overview]
Message-ID: <1689731808-3009-1-git-send-email-yui.washidu@gmail.com> (raw)
This patch series is the first step towards enabling
hardware offloading of the L2 packet switching feature on virtio-net device to host machine.
We are considering that this hardware offloading enables
the use of high-performance networks in virtual infrastructures,
such as container infrastructures on VMs.
To enable L2 packet switching by SR-IOV VFs, we are considering the following:
- making the guest recognize virtio-net devices as SR-IOV PF devices
(archived with this patch series)
- allowing virtio-net devices to connect SR-IOV VFs to the backend networks,
leaving the L2 packet switching feature to the management layer like libvirt
- This makes hardware offloading of L2 packet switching possible.
For example, when using vDPA devices, it allows the guest
to utilize SR-IOV NIC embedded switch of hosts.
This patch series aims to enable SR-IOV emulation on virtio-net devices.
With this series, the guest can identify the virtio-net device as an SR-IOV PF device.
The newly added property 'sriov_max_vfs' allows us to enable the SR-IOV feature
on the virtio-net device.
Currently, we are unable to specify the properties of a VF created from the guest.
The properties are set to their default values.
In the future, we plan to allow users to set the properties.
qemu-system-x86_64 --device virtio-net,sriov_max_vfs=<num>
# when 'sriov_max_vfs' is present, the SR-IOV feature will be automatically enabled
# <num> means the max number of VF on guest
Example commands to create VFs in virtio-net device from the guest:
guest% readlink -f /sys/class/net/eth1/device
/sys/devices/pci0000:00/0000:00:02.0/0000:01:00.0/virtio1
guest% echo "2" > /sys/devices/pci0000:00/0000:00:02.0/0000:01:00.0/sriov_numvfs
guest% ip link show
eth0: ....
eth1: ....
eth2: .... #virtual VF created
eth3: .... #virtual VF created
Please note that communication between VF and PF/VF is not possible by this patch series itself.
Yui Washizu (1):
virtio-pci: add SR-IOV capability
hw/pci/msix.c | 8 +++--
hw/pci/pci.c | 4 +++
hw/virtio/virtio-pci.c | 62 ++++++++++++++++++++++++++++++----
include/hw/virtio/virtio-pci.h | 1 +
4 files changed, 66 insertions(+), 9 deletions(-)
--
2.39.3
next reply other threads:[~2023-07-19 13:54 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-07-19 1:56 Yui Washizu [this message]
2023-07-19 1:56 ` [RFC 1/1] virtio-pci: add SR-IOV capability Yui Washizu
2023-07-20 0:45 ` Akihiko Odaki
2023-07-20 2:19 ` Jason Wang
2023-07-20 2:20 ` [RFC 0/1] virtio-net: add support for SR-IOV emulation Jason Wang
2023-07-24 2:32 ` Yui Washizu
2023-07-24 6:58 ` Jason Wang
2023-07-28 7:35 ` Yui Washizu
2023-08-30 5:28 ` Yui Washizu
2023-09-06 5:09 ` Yui Washizu
2023-09-15 7:01 ` Jason Wang
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=1689731808-3009-1-git-send-email-yui.washidu@gmail.com \
--to=yui.washidu@gmail.com \
--cc=akihiko.odaki@daynix.com \
--cc=ghammer@redhat.com \
--cc=jasowang@redhat.com \
--cc=mapfelba@redhat.com \
--cc=marcel@redhat.com \
--cc=mdean@redhat.com \
--cc=mst@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=ybendito@redhat.com \
--cc=yvugenfi@redhat.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).