3.7.35 VirtioNetMMIO

Virtio net device over MMIO transport. This model is written in C++.

About VirtioNetMMIO

This is a model of a virtual Ethernet virtio device over MMIO transport, supporting both legacy and current OASIS virtio specifications. It provides much better network performance than the SMSC_91C111 component, because it features host-assisted network acceleration. This means that it can offload packet processing operations from the simulated OS on the target, to the host side. These operations include:

  • Checksum computation
  • TX packet segmentation
  • RX packet combination

If the target simulated Linux or Linux-derived OS has an appropriate virtio net driver, Arm recommends you use VirtioNetMMIO instead of SMSC_91C111.

Unlike SMSC_91C111, which must work with an external HostBridge component, VirtioNetMMIO has a built-in HostBridge sub-component. The parameters to control the HostBridge are described in the VirtioNetMMIO parameters table, with the hostbridge parameter sub-namespace.

Note:

To enable tracing of user-mode networking, which can help to debug networking issues, set the FASTSIM_USERNET_DUMP environment variable to any or all of the following values:

arpin,arpout,udpin,udpout,etherin,etherout,ipv4in,ipv4out,ipv4fragin,ipv4fragout,tcpin,tcpout

Take the following steps to set up this component in a virtual platform:

  • Use a version of Linux that contains a virtio network driver.

  • Add the following option to the Linux kernel configuration:

    CONFIG_VIRTIO_NET=y
  • Update the device tree to include the VirtioNetMMIO component, or specify it on the kernel command line, for example

    virtio_mmio.device=0x10000@0x1c150000:76

    The address range for both VE and Base platforms is 0x1C1500000x1C15FFFF. The interrupt number is 44, or IRQ 76, for both VE and Base platforms.

  • Select the hostbridge that you want to use to communicate with the host in the model:
    virtio_net.hostbridge.userNetworking=true/false (User mode or TAP/TUN networking)
  • Configure the networking environment, as described in the related tasks at the end of this topic.

Example entries for DTS files:

  • Add this entry next to the corresponding virtio_block or virtio_p9 entry:

    virtio_net@0150000 {
            compatible = "virtio,mmio";
            reg = <0x150000 0x1000>;
            interrupts = <0x2c>; 
    };
  • Add this entry to the interrupt map:

    <0 0 44 &gic 0 44 4>;

Table 3-268 Ports

Name Protocol Type Description
intr Signal Master Virtio device sets interrupt to signal completion.
pvbus PVBus Slave Virtio MMIO control/config/status registers.
virtio_m PVBus Master Virtio device performs DMA accesses via master.
Non-ConfidentialPDF file icon PDF version100964_1110_00_en
Copyright © 2014–2020 Arm Limited or its affiliates. All rights reserved.