MAINTAINERS | 10 + docs/specs/cnuas-vnic.rst | 78 +++++ docs/specs/cnuasgpu.rst | 91 ++++++ docs/specs/index.rst | 2 + docs/specs/pci-ids.rst | 4 + hw/misc/Kconfig | 5 + hw/misc/cnuasgpu.c | 557 ++++++++++++++++++++++++++++++++++ hw/misc/meson.build | 1 + hw/net/Kconfig | 5 + hw/net/cnuas_vnic.c | 508 +++++++++++++++++++++++++++++++ hw/net/meson.build | 1 + include/hw/pci/pci.h | 2 + tests/qtest/cnuas-vnic-test.c | 233 ++++++++++++++ tests/qtest/cnuasgpu-test.c | 274 +++++++++++++++++ tests/qtest/meson.build | 2 + 15 files changed, 1773 insertions(+) create mode 100644 docs/specs/cnuas-vnic.rst create mode 100644 docs/specs/cnuasgpu.rst create mode 100644 hw/misc/cnuasgpu.c create mode 100644 hw/net/cnuas_vnic.c create mode 100644 tests/qtest/cnuas-vnic-test.c create mode 100644 tests/qtest/cnuasgpu-test.c
This series adds PCI IDs and QEMU models for the Cnuas virtual network adapter and CnuasGPU AI/ML accelerator. CnuasNIC provides guest DMA and Linux SOCK_SEQPACKET transport. CnuasGPU provides MMIO control, device memory, and optional link transport. Both models include reset and migration state, MSI and INTx support, documentation, and functional qtests. Changes since v2: - use 1b36:0017 (CnuasNIC) and 1b36:0018 (CnuasGPU) to avoid PCI ID conflicts - add PCI-ID documentation links along with their target document additions The complete QEMU device implementation is included in this patch series. Regards, Weqaar Janjua Packet Five Networks Ltd. Dublin, Ireland https://www.packetfive.com Weqaar Janjua (6): pci: Add device ID for CnuasNIC hw/net: Add Cnuas virtual network adapter tests/qtest: Add Cnuas virtual network adapter tests pci: Add device ID for CnuasGPU hw/misc: Add CnuasGPU virtual accelerator tests/qtest: Add CnuasGPU tests MAINTAINERS | 10 + docs/specs/cnuas-vnic.rst | 78 +++++ docs/specs/cnuasgpu.rst | 91 ++++++ docs/specs/index.rst | 2 + docs/specs/pci-ids.rst | 4 + hw/misc/Kconfig | 5 + hw/misc/cnuasgpu.c | 557 ++++++++++++++++++++++++++++++++++ hw/misc/meson.build | 1 + hw/net/Kconfig | 5 + hw/net/cnuas_vnic.c | 508 +++++++++++++++++++++++++++++++ hw/net/meson.build | 1 + include/hw/pci/pci.h | 2 + tests/qtest/cnuas-vnic-test.c | 233 ++++++++++++++ tests/qtest/cnuasgpu-test.c | 274 +++++++++++++++++ tests/qtest/meson.build | 2 + 15 files changed, 1773 insertions(+) create mode 100644 docs/specs/cnuas-vnic.rst create mode 100644 docs/specs/cnuasgpu.rst create mode 100644 hw/misc/cnuasgpu.c create mode 100644 hw/net/cnuas_vnic.c create mode 100644 tests/qtest/cnuas-vnic-test.c create mode 100644 tests/qtest/cnuasgpu-test.c -- 2.43.0
Hi, A gentle ping on the series, patches 1 and 4 have Gerd's Reviewed-by; patches 2, 3, 5 and 6 are still awaiting review. Could someone please have a look? https://lore.kernel.org/qemu-devel/20260929202358.725310-1-weqaar.janjua@packetfive.com/ Thanks, appreciated! Weqaar
Hi, Ping. Patches 1 and 4 (PCI IDs) have Gerd's Reviewed-by. Patches 2, 3, 5 and 6 (CnuasNIC/CnuasGPU/dev models/qtests) are pending review. https://lore.kernel.org/qemu-devel/20260929202358.725310-1-weqaar.janjua@packetfive.com/ @Michael, @Jason: Would one of you please be willing to take this series through your tree once it is reviewed, or could you suggest who should? I am happy to rework anything needed, and I understand this may now target the next release given the upcoming soft freeze. Thanks, appreciated! Weqaar
On Tue, Oct 27, 2026 at 08:07:44AM +0000, Weqaar Janjua wrote: > Hi, > > Ping. > > Patches 1 and 4 (PCI IDs) have Gerd's Reviewed-by. Patches 2, 3, 5 > and 6 (CnuasNIC/CnuasGPU/dev models/qtests) are pending review. > > https://lore.kernel.org/qemu-devel/20260929202358.725310-1-weqaar.janjua@packetfive.com/ > > @Michael, @Jason: > Would one of you please be willing to take this series through your > tree once it is reviewed, or could you suggest who should? I am happy > to rework anything needed, and I understand this may now target the > next release given the upcoming soft freeze. > > Thanks, appreciated! > > Weqaar Thanks for the patches! Sorry I can merge if someone reviews but I just can't take on reviewing a new device right now, I'm buried under AI security reports as it is. I appreciate that you listed yourself as the sole maintainer but you are a first time contributor. Maybe Jason can review. Try poking other net device maintainers. Maybe rdma migration guys? if this is useful to test qemu rdma migration then suddenly you have users within the community. Indeed, next release. Thanks! -- MST
On Tue, Oct 27, 2026 at 06:46:49AM -0400, Michael S. Tsirkin wrote:
> Sorry I can merge if someone reviews but I just can't take on reviewing
> a new device right now, I'm buried under AI security reports as it is.
Thanks Michael, understood, and thank you for offering to merge once
it is reviewed.
> I appreciate that you listed yourself as the sole maintainer but you are
> a first time contributor.
Fair point. I am happy to be listed as a reviewer instead, or alongside
an existing maintainer if someone in the net or migration area is
willing. I will keep supporting the code either way.
> Maybe Jason can review. Try poking other net device maintainers.
> Maybe rdma migration guys? if this is useful to test
> qemu rdma migration then suddenly you have users within the community.
Thanks for the suggestion, I tried it. Setup: two Linux guests on one
host, each with a CnuasNIC (1b36:0017 from this series) attached to a
shared user-space switch, using the in-kernel RDMA stack over RoCEv2.
- rping over RDMA CM, 1000 iterations per size, data verified with -V
(rping -s/-c -a <ip> -C 1000 -S <size> -V), both sides exit 0:
size wall time per iteration RDMA READ+WRITE data
64 B 1.218 s 1218 us 0.8 Mb/s
4096 B 1.172 s 1172 us 55.9 Mb/s
32768 B 1.857 s 1857 us 282.4 Mb/s
Wall time is measured on the client and includes connect and
disconnect.
- perftest over RDMA CM (ib_send_bw -R, ib_read_lat -R,
ib_write_lat -R) passes.
- QEMU RDMA migration of a nested TCG guest with 512 MiB of RAM filled
with random data, source paused, migrate rdma:<ip>:<port>. With QEMU
master (29b1dc631d) it completed in 6.4 s at about 675 Mbps with
269 ms downtime, and a pmemsave of guest RAM is identical on source
and destination.
So CnuasNIC gives another way to exercise migration/rdma.c on a single
host without RDMA hardware. The guest driver changes needed for RDMA CM
will be part of our Linux driver submission (blocked on PCI ID patches 1
and 4), and I can share the full setup if anyone wants to reproduce it.
Jason, Peter, Zhijian, Akihiko: would one of you be able to review
patches 2 and 3 (the CnuasNIC device model and its qtest)?
> Indeed, next release.
Agreed for the device models.
One request on the PCI IDs: patches 1 and 4 only reserve 1b36:0017 and
1b36:0018, and both have Gerd's Reviewed-by. Our Linux driver and
rdma-core provider submissions depend on these IDs, so the device models
waiting for the next release also holds up that work. Would it be
acceptable to merge patches 1 and 4 ahead of the device models, for
11.2 if there is still time before the soft freeze? If it is easier, I
can send them as a separate two-patch series rebased on master.
Thanks,
Weqaar
On Thu, Oct 29, 2026 at 11:57:06AM +0000, Weqaar Janjua wrote: > On Tue, Oct 27, 2026 at 06:46:49AM -0400, Michael S. Tsirkin wrote: > > Sorry I can merge if someone reviews but I just can't take on reviewing > > a new device right now, I'm buried under AI security reports as it is. > > Thanks Michael, understood, and thank you for offering to merge once > it is reviewed. > > > I appreciate that you listed yourself as the sole maintainer but you are > > a first time contributor. > > Fair point. I am happy to be listed as a reviewer instead, or alongside > an existing maintainer if someone in the net or migration area is > willing. I will keep supporting the code either way. > > > Maybe Jason can review. Try poking other net device maintainers. > > Maybe rdma migration guys? if this is useful to test > > qemu rdma migration then suddenly you have users within the community. > > Thanks for the suggestion, I tried it. Setup: two Linux guests on one > host, each with a CnuasNIC (1b36:0017 from this series) attached to a > shared user-space switch, using the in-kernel RDMA stack over RoCEv2. > > - rping over RDMA CM, 1000 iterations per size, data verified with -V > (rping -s/-c -a <ip> -C 1000 -S <size> -V), both sides exit 0: > > size wall time per iteration RDMA READ+WRITE data > 64 B 1.218 s 1218 us 0.8 Mb/s > 4096 B 1.172 s 1172 us 55.9 Mb/s > 32768 B 1.857 s 1857 us 282.4 Mb/s > > Wall time is measured on the client and includes connect and > disconnect. > - perftest over RDMA CM (ib_send_bw -R, ib_read_lat -R, > ib_write_lat -R) passes. > - QEMU RDMA migration of a nested TCG guest with 512 MiB of RAM filled > with random data, source paused, migrate rdma:<ip>:<port>. With QEMU > master (29b1dc631d) it completed in 6.4 s at about 675 Mbps with > 269 ms downtime, and a pmemsave of guest RAM is identical on source > and destination. > > So CnuasNIC gives another way to exercise migration/rdma.c on a single > host without RDMA hardware. The guest driver changes needed for RDMA CM > will be part of our Linux driver submission (blocked on PCI ID patches 1 > and 4), and I can share the full setup if anyone wants to reproduce it. > > Jason, Peter, Zhijian, Akihiko: would one of you be able to review > patches 2 and 3 (the CnuasNIC device model and its qtest)? > > > Indeed, next release. > > Agreed for the device models. > > One request on the PCI IDs: patches 1 and 4 only reserve 1b36:0017 and > 1b36:0018, and both have Gerd's Reviewed-by. Our Linux driver and > rdma-core provider submissions depend on these IDs, so the device models > waiting for the next release also holds up that work. Would it be > acceptable to merge patches 1 and 4 ahead of the device models, for > 11.2 if there is still time before the soft freeze? If it is easier, I > can send them as a separate two-patch series rebased on master. > > Thanks, > > Weqaar Hmm wait a second. I don't understand. Isn't it a physical device you are emulating? Why is it using the Red Hat IDs? -- MST
On Thu, Oct 29, 2026 at 01:50:11PM -0400, Michael S. Tsirkin wrote: > Hmm wait a second. I don't understand. Isn't it a physical device you > are emulating? Why is it using the Red Hat IDs? No, it is not a physical device. There is no CnuasNIC or CnuasGPU hardware; both exist only as virtual devices, the QEMU device models in this series. Think of CnuasNIC as veth or rxe for RDMA, but presented to the guest as a PCI device so the full driver, verbs and RDMA CM path runs unmodified. The Cnuas project (cnuas.io) emulates the rest of the RDMA subsystem around it, including a RoCEv2 and InfiniBand switch. CnuasGPU is the same idea for an accelerator. The register interfaces are defined by the models themselves and documented in docs/specs/cnuas-vnic.rst (patch 2) and docs/specs/cnuasgpu.rst (patch 5), with more detail in the datasheets at: https://cnuas.io/cnuas/docs/datasheets/CnuasNIC_Datasheet/ https://cnuas.io/cnuas/docs/datasheets/CnuasGPU_Datasheet/ So this is the same situation as other QEMU-specific devices in the 1b36 range, for example pvpanic-pci (1b36:0011) and the emulated UFS host controller (1b36:0013), which also have upstream Linux drivers. That is why I asked Gerd for IDs from the QEMU range. If we were to build hardware, it would use our own PCI vendor ID, not 1b36. The "RDMA network adapter" wording may have suggested otherwise. It is an RoCEv2 adapter in the sense that a Linux guest sees a normal RDMA device, but the wire side is a socket to a user-space switch process, not a real NIC. I can make "virtual" more explicit in the commit messages and docs if that helps. Thanks, Weqaar
On Thu, Oct 29, 2026 at 07:42:24PM +0000, Weqaar Janjua wrote: > On Thu, Oct 29, 2026 at 01:50:11PM -0400, Michael S. Tsirkin wrote: > > Hmm wait a second. I don't understand. Isn't it a physical device you > > are emulating? Why is it using the Red Hat IDs? > > No, it is not a physical device. There is no CnuasNIC or CnuasGPU > hardware; both exist only as virtual devices, the QEMU device models > in this series. Think of CnuasNIC as veth or rxe for RDMA, but > presented to the guest as a PCI device so the full driver, verbs and > RDMA CM path runs unmodified. The Cnuas project (cnuas.io) emulates > the rest of the RDMA subsystem around it, including a RoCEv2 and > InfiniBand switch. CnuasGPU is the same idea for an accelerator. > > The register interfaces are defined by the models themselves and > documented in docs/specs/cnuas-vnic.rst (patch 2) and > docs/specs/cnuasgpu.rst (patch 5), with more detail in the > datasheets at: > > https://cnuas.io/cnuas/docs/datasheets/CnuasNIC_Datasheet/ > https://cnuas.io/cnuas/docs/datasheets/CnuasGPU_Datasheet/ > > So this is the same situation as other QEMU-specific devices in the > 1b36 range, for example pvpanic-pci (1b36:0011) and the emulated UFS > host controller (1b36:0013), which also have upstream Linux drivers. > That is why I asked Gerd for IDs from the QEMU range. If we were to > build hardware, it would use our own PCI vendor ID, not 1b36. > > The "RDMA network adapter" wording may have suggested otherwise. It is > an RoCEv2 adapter in the sense that a Linux guest sees a normal RDMA > device, but the wire side is a socket to a user-space switch process, > not a real NIC. I can make "virtual" more explicit in the commit > messages and docs if that helps. > > Thanks, > > Weqaar I see. Then a simple way for you to get some eyes on this, and a path towards upstreaming, could be to try and add this rdma functionality in the virtio spec. Interface changes might be required during the standardization process. -- MST
On Fri, Oct 30, 2026 at 07:19:05PM -0400, Michael S. Tsirkin wrote: > I see. Then a simple way for you to get some eyes on this, and a path > towards upstreaming, could be to try and add this rdma functionality > in the virtio spec. > Interface changes might be required during the standardization > process. Thanks Michael, that is a helpful pointer. The intended use of the Cnuas emulated PCIe devices is the reason they were not designed as virtio devices. Cnuas is intended for teaching and research of Open Compute ORV3 (and future versions as it evolves) rack-scale data center systems, where the PCIe devices and their drivers are what is being studied. CnuasNIC and CnuasGPU are small, fully documented PCIe devices in the spirit of edu, but with production-like features such as configurable link speed and width, a 64-bit prefetchable BAR (CnuasGPU), and a switch transport that joins several guests into one fabric. Their guest drivers are full netdev and RDMA core drivers that run rping, perftest and QEMU RDMA migration unmodified. Just to clarify these aren't edu extensions because they are different PCI classes (network and co-processor), and edu's fixed register map is used by existing course material. My concern with virtio device is that it would hide the layer we want people to work with. Also, that in the ORV3 rack model, each sled carries its own NIC and accelerator as separate PCIe functions with their own driver, next to the virtio devices the guest uses for its disk and management network. I understand that a virtio-rdma device could definitely be useful in its own right, I am happy to look at it separately since the CnuasSwitch backend could serve both. If you are ok with it, for this series I would like to keep the devices as they are, in the same spirit as the other QEMU-only devices in the 1b36 range, and keep looking for a reviewer for patches 2 and 3 (Jason, Peter, Zhijian, Akihiko, any of you?). Thanks, Weqaar
On Sat, Oct 31, 2026 at 12:05:14PM +0000, Weqaar Janjua wrote: > On Fri, Oct 30, 2026 at 07:19:05PM -0400, Michael S. Tsirkin wrote: > > I see. Then a simple way for you to get some eyes on this, and a path > > towards upstreaming, could be to try and add this rdma functionality > > in the virtio spec. > > Interface changes might be required during the standardization > > process. > > Thanks Michael, that is a helpful pointer. > > The intended use of the Cnuas emulated PCIe devices is the reason they > were not designed as virtio devices. > > Cnuas is intended for teaching and research of Open Compute ORV3 > (and future versions as it evolves) rack-scale data center systems, where the > PCIe devices and their drivers are what is being studied. CnuasNIC and > CnuasGPU are small, fully documented PCIe devices in the spirit of > edu, but with production-like features such as configurable link speed and > width, a 64-bit prefetchable BAR (CnuasGPU), and a switch transport > that joins several guests into one fabric. Their guest drivers are > full netdev and RDMA core drivers that run rping, perftest and QEMU > RDMA migration unmodified. Just to clarify these aren't edu extensions > because they are different PCI classes (network and co-processor), and > edu's fixed register map is used by existing course material. My concern with > virtio device is that it would hide the layer we want people to work with. People being the students? > Also, that in the ORV3 rack model, each sled carries its own NIC and accelerator > as separate PCIe functions with their own driver, next to the virtio > devices the guest uses for its disk and management network. > > I understand that a virtio-rdma device could definitely be useful in its own right, > I am happy to look at it separately since the CnuasSwitch backend could serve > both. If you are ok with it, for this series I would like to keep the devices as > they are, in the same spirit as the other QEMU-only devices in the 1b36 range, and > keep looking for a reviewer for patches 2 and 3 (Jason, Peter, Zhijian, Akihiko, > any of you?). > > Thanks, > > Weqaar -- MST
On Sat, Oct 31, 2026 at 01:54:08PM -0400, Michael S. Tsirkin wrote: > > My concern with > > virtio device is that it would hide the layer we want people to work with. > > People being the students? Students in the context of training and skill building, and researchers from academia and industry working on rack-scale systems. It is also intended for upskilling and onboarding staff, and for developing and validating user-space and kernel-space code on a complete software-defined rack-scale ORV3 system. With virtio the transport and the driver are already defined, so there would be no device-specific PCIe driver for them to write, whether as a training exercise or as custom kernel-space PCIe code that industry and academic researchers develop and want to validate. Thanks, Weqaar
On 2026/11/01 3:58, Weqaar Janjua wrote: > On Sat, Oct 31, 2026 at 01:54:08PM -0400, Michael S. Tsirkin wrote: >>> My concern with >>> virtio device is that it would hide the layer we want people to work with. >> >> People being the students? > > Students in the context of training and skill building, and researchers > from academia and industry working on rack-scale systems. It is also intended > for upskilling and onboarding staff, and for developing and validating > user-space and kernel-space code on a complete software-defined rack-scale > ORV3 system. With virtio the transport and the driver are already defined, so > there would be no device-specific PCIe driver for them to write, whether > as a training exercise or as custom kernel-space PCIe code that industry > and academic researchers develop and want to validate. I have reviewed the series, and it looks interesting. I am wondering if vfio-user might be better suited for your use case. While the code is clean and would serve well as teaching and research material, upstreaming it to QEMU requires integrating with QEMU's common infrastructure and meeting its architectural requirements, which is currently missing. Specifically, the implementation bypasses QEMU's network stack, and migration is not fully implemented. Fixing these issues is certainly possible, but it would require a significant effort from both you and the reviewers. Unfortunately, there is currently very little bandwidth for reviewing network patches; I only work on this in my spare time, and I haven't seen much activity from Jason recently either (unless I missed something). Furthermore, fixing this might actually conflict with your goals. Tighter integration with QEMU internals would couple your device implementation more closely to QEMU, making it harder to keep pace with upstream development and increasing the codebase size. This extra burden may be undesirable if your primary focus is teaching and research. Using vfio-user would save you the effort of upstreaming and keeping up with QEMU internal changes. One downside is that it does not support migration—though I suspect that isn't a requirement for your use case (though QEMU RDMA migration developers might be disappointed). Regardless of the approach, you will still need to reserve the device ID by updating the documentation. Regards, Akihiko Odaki
On Wed, Nov 04, 2026 at 06:14:36PM +0900, Akihiko Odaki wrote: > I am wondering if vfio-user might be better suited for your use case. @Akihiko, thanks for the review and the suggestion. I agree, vfio-user seems to fit better. The guest still sees the same PCIe devices, with the same config space, BARs, doorbells and interrupts so that addresses my concern I discissed with Michael about virtio that device-specific drivers stay exactly as they are; also implies the device models no longer need to track QEMU internals. @Thanos, thanks for the note on migration. I will move CnuasNIC and CnuasGPU to standalone vfio-user servers built on libvfio-user and maintain them independently in the Cnuas project. Your comments on patches 2, 3 and 5 still apply there, and I will address them in that code. Pls consider v3 withdrawn. I will send a replacement v4 for the series with a single documentation patch combining patches 1 and 4 which reserve 1b36:0017 and 1b36:0018 in docs/specs/pci-ids.rst for these vfio-user devices along with a link to their specifications. @Michael, @Gerd, Cnuas needs PCI IDs for these devices as without PCI-SIG membership we have no other way to obtain a vendor ID. Are you fine with these two IDs being used for devices that run outside QEMU through vfio-user? Thanks, Weqaar
> -----Original Message----- > From: qemu-devel-bounces+thanos.makatos=nutanix.com@nongnu.org <qemu- > devel-bounces+thanos.makatos=nutanix.com@nongnu.org> On Behalf Of > Akihiko Odaki > Sent: 04 November 2026 09:14 > To: Weqaar Janjua <weqaar.janjua@packetfive.com>; Michael S. Tsirkin > <mst@redhat.com> > Cc: qemu-devel@nongnu.org; kraxel@redhat.com; > peter.maydell@linaro.org; pierrick.bouvier@oss.qualcomm.com; > jasowangio@gmail.com; pbonzini@redhat.com; farosas@suse.de; > lvivier@redhat.com; marcel.apfelbaum@gmail.com; peterx@redhat.com; > lizhijian@fujitsu.com > Subject: Re: [PATCH v3 0/6] hw: Add Cnuas virtual devices > > !-------------------------------------------------------------------| > CAUTION: External Email > > |-------------------------------------------------------------------! > > On 2026/11/01 3:58, Weqaar Janjua wrote: > > On Sat, Oct 31, 2026 at 01:54:08PM -0400, Michael S. Tsirkin wrote: > >>> My concern with > >>> virtio device is that it would hide the layer we want people to > work with. > >> > >> People being the students? > > > > Students in the context of training and skill building, and > researchers > > from academia and industry working on rack-scale systems. It is also > intended > > for upskilling and onboarding staff, and for developing and > validating > > user-space and kernel-space code on a complete software-defined > rack-scale > > ORV3 system. With virtio the transport and the driver are already > defined, so > > there would be no device-specific PCIe driver for them to write, > whether > > as a training exercise or as custom kernel-space PCIe code that > industry > > and academic researchers develop and want to validate. > > I have reviewed the series, and it looks interesting. > > I am wondering if vfio-user might be better suited for your use case. > While the code is clean and would serve well as teaching and research > material, upstreaming it to QEMU requires integrating with QEMU's > common > infrastructure and meeting its architectural requirements, which is > currently missing. > > Specifically, the implementation bypasses QEMU's network stack, and > migration is not fully implemented. > > Fixing these issues is certainly possible, but it would require a > significant effort from both you and the reviewers. Unfortunately, > there > is currently very little bandwidth for reviewing network patches; I > only > work on this in my spare time, and I haven't seen much activity from > Jason recently either (unless I missed something). > > Furthermore, fixing this might actually conflict with your goals. > Tighter integration with QEMU internals would couple your device > implementation more closely to QEMU, making it harder to keep pace > with > upstream development and increasing the codebase size. This extra > burden > may be undesirable if your primary focus is teaching and research. > > Using vfio-user would save you the effort of upstreaming and keeping > up > with QEMU internal changes. One downside is that it does not support > migration—though I suspect that isn't a requirement for your use case > (though QEMU RDMA migration developers might be disappointed). John has picked up the migration patches to add live migration to vfio-user. > > Regardless of the approach, you will still need to reserve the device > ID > by updating the documentation. > > Regards, > Akihiko Odaki
© 2016 - 2026 Red Hat, Inc.