diff --git a/doc/developer-guides/hld/hld-devicemodel.rst b/doc/developer-guides/hld/hld-devicemodel.rst index 2d540e5a0..273ba1e6e 100644 --- a/doc/developer-guides/hld/hld-devicemodel.rst +++ b/doc/developer-guides/hld/hld-devicemodel.rst @@ -110,7 +110,7 @@ Here's an example showing how to run a VM with: -s 1:0,lpc -l com1,stdio \ -s 5,virtio-console,@pty:pty_port \ -s 3,virtio-blk,/home/acrn/UserVM.img \ - -s 4,virtio-net,tap_LaaG \ + -s 4,virtio-net,tap=LaaG \ --acpidev_pt MSFT0101,00 \ --intr_monitor 10000,10,1,100 \ -B "root=/dev/vda2 rw rootwait maxcpus=3 nohpet console=hvc0 \ @@ -773,7 +773,7 @@ example: -s 1:0,lpc -l com1,stdio \ -s 5,virtio-console,@pty:pty_port \ -s 3,virtio-blk,/home/acrn/UserVM.img \ - -s 4,virtio-net,tap_LaaG \ + -s 4,virtio-net,tap=LaaG \ -B "root=/dev/vda2 rw rootwait maxcpus=3 nohpet console=hvc0 \ console=ttyS0 no_timer_check ignore_loglevel log_buf_len=16M \ consoleblank=0 tsc=reliable \ diff --git a/doc/developer-guides/hld/hostbridge-virt-hld.rst b/doc/developer-guides/hld/hostbridge-virt-hld.rst index 15ec40855..27b6ad05a 100644 --- a/doc/developer-guides/hld/hostbridge-virt-hld.rst +++ b/doc/developer-guides/hld/hostbridge-virt-hld.rst @@ -21,11 +21,10 @@ command line input. Using this command line, as an example:: -s 5,virtio-console,@stdio:stdio_port \ -s 6,virtio-hyper_dmabuf \ -s 3,virtio-blk,/home/acrn/UserVM.img \ - -s 4,virtio-net,tap0 \ + -s 4,virtio-net,tap=tap0,mac_seed=$mac_seed \ -s 7,virtio-rnd \ --ovmf /usr/share/acrn/bios/OVMF.fd \ $logger_setting \ - --mac_seed $mac_seed \ $vm_name the bus hierarchy would be: diff --git a/doc/developer-guides/hld/hv-dev-passthrough.rst b/doc/developer-guides/hld/hv-dev-passthrough.rst index f10353380..d4c516fcc 100644 --- a/doc/developer-guides/hld/hv-dev-passthrough.rst +++ b/doc/developer-guides/hld/hv-dev-passthrough.rst @@ -436,7 +436,7 @@ passthrough and enables PTM on it: acrn-dm -m $mem_size -s 0:0,hostbridge \ -s 3,virtio-blk,user-vm-test.img \ - -s 4,virtio-net,tap0 \ + -s 4,virtio-net,tap=tap0 \ -s 5,virtio-console,@stdio:stdio_port \ -s 6,passthru,a9/00/0,enable_ptm \ --ovmf /usr/share/acrn/bios/OVMF.fd @@ -506,7 +506,7 @@ If supported, follow these steps to enable PTM in the post-launched VM: $ acrn-dm -m $mem_size -s 0:0,hostbridge \ -s 3,virtio-blk,user-vm-test.img \ - -s 4,virtio-net,tap0 \ + -s 4,virtio-net,tap=tap0 \ -s 5,virtio-console,@stdio:stdio_port \ -s 6,passthru,a9/00/0,enable_ptm \ --ovmf /usr/share/acrn/bios/OVMF.fd \ diff --git a/doc/developer-guides/hld/virtio-net.rst b/doc/developer-guides/hld/virtio-net.rst index ec31a02af..6e9fe0b72 100644 --- a/doc/developer-guides/hld/virtio-net.rst +++ b/doc/developer-guides/hld/virtio-net.rst @@ -484,7 +484,7 @@ optional): .. code-block:: none - -s 4,virtio-net,,[mac=] + -s 4,virtio-net,tap=,[mac=] When the User VM is launched, run ``ifconfig`` to check the network. enp0s4r is the virtual NIC created by acrn-dm: @@ -525,15 +525,14 @@ Create a MacVTap interface in the Service VM as shown here: sudo ip link add link eth0 name macvtap0 type macvtap where ``eth0`` is the name of the physical network interface, and -``macvtap0`` is the name of the MacVTap interface being created. (Make -sure the MacVTap interface name includes the keyword ``tap``.) +``macvtap0`` is the name of the MacVTap interface being created. Once the MacVTap interface is created, the User VM can be launched by adding a PCI slot to the Device Model acrn-dm as shown below. .. code-block:: none - -s 4,virtio-net,,[mac=] + -s 4,virtio-net,tap=macvtap0,[mac=] Performance Estimation ====================== diff --git a/doc/tutorials/acrn_on_qemu.rst b/doc/tutorials/acrn_on_qemu.rst index d712a0843..f16b84216 100644 --- a/doc/tutorials/acrn_on_qemu.rst +++ b/doc/tutorials/acrn_on_qemu.rst @@ -273,7 +273,7 @@ Bring Up User VM (L2 Guest) mem_size=1024M acrn-dm -m $mem_size -s 0:0,hostbridge \ -s 3,virtio-blk,~/UserVM.img \ - -s 4,virtio-net,tap0 \ + -s 4,virtio-net,tap=tap0 \ --cpu_affinity 1 \ -s 5,virtio-console,@stdio:stdio_port \ --ovmf ~/OVMF.fd \ diff --git a/doc/tutorials/enable_ivshmem.rst b/doc/tutorials/enable_ivshmem.rst index 1343c8854..79f865321 100644 --- a/doc/tutorials/enable_ivshmem.rst +++ b/doc/tutorials/enable_ivshmem.rst @@ -139,7 +139,7 @@ Linux-based post-launched VMs (VM1 and VM2). -s 5,virtio-console,@stdio:stdio_port \ -s 6,virtio-hyper_dmabuf \ -s 3,virtio-blk,/home/acrn/UserVM1.img \ - -s 4,virtio-net,tap0 \ + -s 4,virtio-net,tap=tap0 \ -s 6,ivshmem,dm:/test,2 \ -s 7,virtio-rnd \ --ovmf /usr/share/acrn/bios/OVMF.fd \ @@ -153,7 +153,7 @@ Linux-based post-launched VMs (VM1 and VM2). acrn-dm -m $mem_size -s 0:0,hostbridge \ -s 3,virtio-blk,/home/acrn/UserVM2.img \ - -s 4,virtio-net,tap0 \ + -s 4,virtio-net,tap=tap0 \ -s 5,ivshmem,dm:/test,2 \ --ovmf /usr/share/acrn/bios/OVMF.fd \ $vm_name @@ -220,7 +220,7 @@ Linux-based VMs (VM0 is a pre-launched VM and VM2 is a post-launched VM). acrn-dm -m $mem_size -s 0:0,hostbridge \ -s 3,virtio-blk,/home/acrn/UserVM2.img \ - -s 4,virtio-net,tap0 \ + -s 4,virtio-net,tap=tap0 \ -s 5,ivshmem,hv:/shm_region_0,2 \ --ovmf /usr/share/acrn/bios/OVMF.fd \ $vm_name diff --git a/doc/tutorials/launch_uos.sh b/doc/tutorials/launch_uos.sh index 830c7e0a7..57811d025 100755 --- a/doc/tutorials/launch_uos.sh +++ b/doc/tutorials/launch_uos.sh @@ -43,7 +43,7 @@ vm_name=vm$1 mac_seed=${mac:9:8}-${vm_name} # create a unique tap device for each VM -tap=tap_$6 +tap=$6 tap_exist=$(ip a | grep "$tap" | awk '{print $1}') if [ "$tap_exist"x != "x" ]; then echo "tap device existed, reuse $tap" @@ -135,11 +135,10 @@ acrn-dm -m $mem_size -c $2 -s 0:0,hostbridge -s 1:0,lpc -l com1,stdio \ -s 6,virtio-hyper_dmabuf \ -s 8,wdt-i6300esb \ -s 3,virtio-blk,/data/$5/$5.img \ - -s 4,virtio-net,$tap \ + -s 4,virtio-net,tap=$tap,mac_seed=$mac_seed \ -s 7,xhci,1-1:1-2:1-3:2-1:2-2:2-3:cap=apl \ -s 9,passthru,0/15/1 \ $boot_cse_option \ - --mac_seed $mac_seed \ $intr_storm_monitor \ $boot_ipu_option \ -B "root=/dev/vda2 rw rootwait maxcpus=$2 nohpet console=hvc0 \ @@ -162,7 +161,7 @@ vm_name=vm$1 mac_seed=${mac:9:8}-${vm_name} # create a unique tap device for each VM -tap=tap_$6 +tap=$6 tap_exist=$(ip a | grep "$tap" | awk '{print $1}') if [ "$tap_exist"x != "x" ]; then echo "tap device existed, reuse $tap" @@ -313,7 +312,7 @@ ACRN project intr_storm_monitor="--intr_monitor 10000,10,1,100" acrn-dm -m $mem_size -c $2 -s 0:0,hostbridge -s 1:0,lpc -l com1,stdio $npk_virt\ - -s 9,virtio-net,$tap \ + -s 9,virtio-net,tap=$tap,mac_seed=$mac_seed \ -s 3,virtio-blk,/data/$5/$5.img \ -s 7,xhci,1-1:1-2:1-3:2-1:2-2:2-3:cap=apl \ -s 8,passthru,0/15/1 \ @@ -322,7 +321,6 @@ intr_storm_monitor="--intr_monitor 10000,10,1,100" -s 11,wdt-i6300esb \ $boot_audio_option \ $boot_cse_option \ - --mac_seed $mac_seed \ -s 27,passthru,0/1b/0 \ -s 24,passthru,0/18/0 \ -s 18,passthru,3/0/0,keep_gsi \ diff --git a/doc/tutorials/using_windows_as_user_vm.rst b/doc/tutorials/using_windows_as_user_vm.rst index 9d5eb0cc9..ef33c647f 100644 --- a/doc/tutorials/using_windows_as_user_vm.rst +++ b/doc/tutorials/using_windows_as_user_vm.rst @@ -105,7 +105,7 @@ Prepare the Script to Create an Image mem_size=4096M acrn-dm -m $mem_size -s 0:0,hostbridge -s 1:0,lpc -l com1,stdio \ -s 2,passthru,0/2/0 \ - -s 8,virtio-net,tap0 \ + -s 8,virtio-net,tap=tap0 \ -s 4,virtio-blk,/home/acrn/work/win10-ltsc.img -s 5,ahci,cd:/home/acrn/work/Windows10.iso \ -s 6,ahci,cd:/home/acrn/work/winvirtio.iso \ @@ -266,7 +266,7 @@ Explanation for acrn-dm Popular Command Lines This is GVT-d to passthrough the VGA controller to Windows. You may need to change 0/2/0 to match the bdf of the VGA controller on your platform. -* ``-s 8,virtio-net,tap0``: +* ``-s 8,virtio-net,tap=tap0``: This is for the network virtualization. * ``-s 3,virtio-input,/dev/input/event4``: diff --git a/doc/user-guides/acrn-dm-parameters.rst b/doc/user-guides/acrn-dm-parameters.rst index 2ca538957..8bf9896c1 100755 --- a/doc/user-guides/acrn-dm-parameters.rst +++ b/doc/user-guides/acrn-dm-parameters.rst @@ -93,19 +93,6 @@ Here are descriptions for each of these ``acrn-dm`` command line parameters: ---- -``--mac_seed `` - Set a platform-unique string as a seed to generate the mac address. Each - VM should have a different "seed_string". The "seed_string" can be - generated by the following method where $(vm_name) contains the name of the - VM you are going to launch. - - .. code-block:: - - mac=$(cat /sys/class/net/e*/address) - seed_string=${mac:9:8}-${vm_name} - ----- - ``-r``, ``--ramdisk `` Set the ramdisk (full path) for the User VM. The maximum length is 1023. The supported ramdisk format depends on your User VM kernel configuration. @@ -467,10 +454,23 @@ arguments used for configuration. Here is a table describing these emulated dev * - ``virtio-net`` - Virtio network type device, parameter should be appended with the format: - ``virtio-net,,[vhost],[mac=]``. - The ``mac`` address is optional, ``device_name`` is the name of the TAP (or MacVTap) device. - It must include the keyword ``tap``. + ``virtio-net,=,[vhost],[mac=],[mac_seed=]``. + The ``mac`` address is optional, ``name`` is the name of the TAP (or MacVTap) device. ``vhost`` specifies vhost backend, otherwise the VBSU backend is used. + ``mac_seed=`` + Set a platform-unique string as a seed to generate the mac address. Each + VM should have a different "seed_string". The "seed_string" can be + generated by the following method where $(vm_name) contains the name of the + VM you are going to launch. + + .. note:: + When both ``mac`` and ``mac_seed`` are set, the latter is ignored + and the MAC address is set to the ``mac`` value. ``mac_seed`` will + only be used when ``mac`` is not set. +.. code-block:: + + mac=$(cat /sys/class/net/e*/address) + seed_string=${mac:9:8}-${vm_name} * - ``passthru`` - Indicates a passthrough device. Use the parameter with the format