You copied the Doc URL to your clipboard.

VirtioNetMMIO component

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, and 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.

Setting up VirtioNetMMIO

Take the following steps to set up the 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, as shown below. 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, below.

Example kernel command-line argument:

virtio_mmio.device=0x10000@0x1c150000:76

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 4-212 VirtioNetMMIO 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.

Table 4-213 VirtioNetMMIO parameters

Name Type Allowed values Default value Description
secure_accesses bool true, false false Make device generate transactions with NS=0.
enabled bool true, false false Enable or disable the device. If disabled, the device can be accessed, but is not activated.
transport string "modern", "legacy" "modern" Use legacy or modern virtio transport. If not specified, modern transport is used.
mac_address string - ""

Specifies the device's MAC address, if it is valid. If "guest" is specified, a fully random MAC address is expected to be generated by the simulated target. If "arm" is specified, a partially random MAC address with the pattern 00-02-F7-76-xx-xx is generated by the model. If not specified, or improperly specified, a fully random MAC address is generated.

offload string - "gso, gro"

Offload TCP/UDP segmentation/receiving operations to the host. This is a comma-separated list of offload options. If an option string exists, the corresponding offload is enabled. The default is to enable all. Two groups of options are defined. The following options are defined for tx-packet segmentation:

tso
TCP Segmentation Offload.
ufo
UDP Fragmentation Offload.
gso
Generic Segmentation Offload. This has the same effect as "tso, ufo".

The following options are defined for rx-packet combination:

tro
TCP Receiving Offload.
uro
UDP Receving Offload.
gro
Generic Receiving Offload. This has the same effect as "tro, uro".
hostbridge.userNetworking bool true, false false If true, the outgoing Ethernet packets of the model go to a proxy router that translates them into host socket calls. If false, the default, the model attempts to open a TAP/TUN device.
hostbridge.interfaceName string - "" The host TAP/TUN-like device that is used by the HostBridge. This should be specified with a non-empty valid interface name when hostbridge.userNetworking=false. The device could be an ordinary TAP or MacVTap (Linux only).
hostbridge.userNetPorts string - "" Specifies an optional port number mapping between listening ports on the host and listening ports on the model for user-mode networking. The syntax is a comma-separated list of items in the form [host-ip:]hostport=[model-ip:]modelport. For example, 5022=22,5080=80 causes sshd and httpd services on the model to listen on ports 5022 and 5080 on the host. You can use the optional host-ip or model-ip to select a specific interface for the mapping, for example 127.0.0.1. The default is to accept connections on any interface (INADDR_ANY).
hostbridge.userNetSubnet string - "172.20.51.0/24" Presents a range of subnet network addresses to the model, in the ip-address/significant-bits syntax, for example 192.168.0.0/24 or 10.0.0.0/8. Omitting trailing zero octets is acceptable, for example 192.168/16. The default subnet is 172.20.51.0/24, taken from the RFC1918 private-use area.
Was this page helpful? Yes No