doc: change the parameter of virtio-net

Remove device name requirement for “tap” and "vmnet", change the
parameter format like:
"-s 4,virtio-net,tap/vmnet=dev_name".
change mac_seed to virtio-net sub-parameter
As a parameter of acrn-dm,the mac_seed is only used for virtio-net.
So this patch change it to the sub-parameter of virtio-net.
The final format is:
-s 4,virtio-net,tap/vmnet=dev_name,mac_seed=XXXX

Tracked-On: #6690
Signed-off-by: Chenli Wei chenli.wei@linux.intel.com
This commit is contained in:
Chenli Wei 2022-03-21 09:58:25 +08:00 committed by David Kinder
parent f5b021b1b5
commit 7dec39a9e8
9 changed files with 34 additions and 38 deletions

View File

@ -110,7 +110,7 @@ Here's an example showing how to run a VM with:
-s 1:0,lpc -l com1,stdio \ -s 1:0,lpc -l com1,stdio \
-s 5,virtio-console,@pty:pty_port \ -s 5,virtio-console,@pty:pty_port \
-s 3,virtio-blk,/home/acrn/UserVM.img \ -s 3,virtio-blk,/home/acrn/UserVM.img \
-s 4,virtio-net,tap_LaaG \ -s 4,virtio-net,tap=LaaG \
--acpidev_pt MSFT0101,00 \ --acpidev_pt MSFT0101,00 \
--intr_monitor 10000,10,1,100 \ --intr_monitor 10000,10,1,100 \
-B "root=/dev/vda2 rw rootwait maxcpus=3 nohpet console=hvc0 \ -B "root=/dev/vda2 rw rootwait maxcpus=3 nohpet console=hvc0 \
@ -773,7 +773,7 @@ example:
-s 1:0,lpc -l com1,stdio \ -s 1:0,lpc -l com1,stdio \
-s 5,virtio-console,@pty:pty_port \ -s 5,virtio-console,@pty:pty_port \
-s 3,virtio-blk,/home/acrn/UserVM.img \ -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 \ -B "root=/dev/vda2 rw rootwait maxcpus=3 nohpet console=hvc0 \
console=ttyS0 no_timer_check ignore_loglevel log_buf_len=16M \ console=ttyS0 no_timer_check ignore_loglevel log_buf_len=16M \
consoleblank=0 tsc=reliable \ consoleblank=0 tsc=reliable \

View File

@ -21,11 +21,10 @@ command line input. Using this command line, as an example::
-s 5,virtio-console,@stdio:stdio_port \ -s 5,virtio-console,@stdio:stdio_port \
-s 6,virtio-hyper_dmabuf \ -s 6,virtio-hyper_dmabuf \
-s 3,virtio-blk,/home/acrn/UserVM.img \ -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 \ -s 7,virtio-rnd \
--ovmf /usr/share/acrn/bios/OVMF.fd \ --ovmf /usr/share/acrn/bios/OVMF.fd \
$logger_setting \ $logger_setting \
--mac_seed $mac_seed \
$vm_name $vm_name
the bus hierarchy would be: the bus hierarchy would be:

View File

@ -436,7 +436,7 @@ passthrough and enables PTM on it:
acrn-dm -m $mem_size -s 0:0,hostbridge \ acrn-dm -m $mem_size -s 0:0,hostbridge \
-s 3,virtio-blk,user-vm-test.img \ -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 5,virtio-console,@stdio:stdio_port \
-s 6,passthru,a9/00/0,enable_ptm \ -s 6,passthru,a9/00/0,enable_ptm \
--ovmf /usr/share/acrn/bios/OVMF.fd --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 \ $ acrn-dm -m $mem_size -s 0:0,hostbridge \
-s 3,virtio-blk,user-vm-test.img \ -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 5,virtio-console,@stdio:stdio_port \
-s 6,passthru,a9/00/0,enable_ptm \ -s 6,passthru,a9/00/0,enable_ptm \
--ovmf /usr/share/acrn/bios/OVMF.fd \ --ovmf /usr/share/acrn/bios/OVMF.fd \

View File

@ -484,7 +484,7 @@ optional):
.. code-block:: none .. code-block:: none
-s 4,virtio-net,<tap_name>,[mac=<XX:XX:XX:XX:XX:XX>] -s 4,virtio-net,tap=<name>,[mac=<XX:XX:XX:XX:XX:XX>]
When the User VM is launched, run ``ifconfig`` to check the network. enp0s4r When the User VM is launched, run ``ifconfig`` to check the network. enp0s4r
is the virtual NIC created by acrn-dm: 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 sudo ip link add link eth0 name macvtap0 type macvtap
where ``eth0`` is the name of the physical network interface, and where ``eth0`` is the name of the physical network interface, and
``macvtap0`` is the name of the MacVTap interface being created. (Make ``macvtap0`` is the name of the MacVTap interface being created.
sure the MacVTap interface name includes the keyword ``tap``.)
Once the MacVTap interface is created, the User VM can be launched by adding 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. a PCI slot to the Device Model acrn-dm as shown below.
.. code-block:: none .. code-block:: none
-s 4,virtio-net,<macvtap_name>,[mac=<XX:XX:XX:XX:XX:XX>] -s 4,virtio-net,tap=macvtap0,[mac=<XX:XX:XX:XX:XX:XX>]
Performance Estimation Performance Estimation
====================== ======================

View File

@ -273,7 +273,7 @@ Bring Up User VM (L2 Guest)
mem_size=1024M mem_size=1024M
acrn-dm -m $mem_size -s 0:0,hostbridge \ acrn-dm -m $mem_size -s 0:0,hostbridge \
-s 3,virtio-blk,~/UserVM.img \ -s 3,virtio-blk,~/UserVM.img \
-s 4,virtio-net,tap0 \ -s 4,virtio-net,tap=tap0 \
--cpu_affinity 1 \ --cpu_affinity 1 \
-s 5,virtio-console,@stdio:stdio_port \ -s 5,virtio-console,@stdio:stdio_port \
--ovmf ~/OVMF.fd \ --ovmf ~/OVMF.fd \

View File

@ -139,7 +139,7 @@ Linux-based post-launched VMs (VM1 and VM2).
-s 5,virtio-console,@stdio:stdio_port \ -s 5,virtio-console,@stdio:stdio_port \
-s 6,virtio-hyper_dmabuf \ -s 6,virtio-hyper_dmabuf \
-s 3,virtio-blk,/home/acrn/UserVM1.img \ -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 6,ivshmem,dm:/test,2 \
-s 7,virtio-rnd \ -s 7,virtio-rnd \
--ovmf /usr/share/acrn/bios/OVMF.fd \ --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 \ acrn-dm -m $mem_size -s 0:0,hostbridge \
-s 3,virtio-blk,/home/acrn/UserVM2.img \ -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 \ -s 5,ivshmem,dm:/test,2 \
--ovmf /usr/share/acrn/bios/OVMF.fd \ --ovmf /usr/share/acrn/bios/OVMF.fd \
$vm_name $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 \ acrn-dm -m $mem_size -s 0:0,hostbridge \
-s 3,virtio-blk,/home/acrn/UserVM2.img \ -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 \ -s 5,ivshmem,hv:/shm_region_0,2 \
--ovmf /usr/share/acrn/bios/OVMF.fd \ --ovmf /usr/share/acrn/bios/OVMF.fd \
$vm_name $vm_name

View File

@ -43,7 +43,7 @@ vm_name=vm$1
mac_seed=${mac:9:8}-${vm_name} mac_seed=${mac:9:8}-${vm_name}
# create a unique tap device for each VM # create a unique tap device for each VM
tap=tap_$6 tap=$6
tap_exist=$(ip a | grep "$tap" | awk '{print $1}') tap_exist=$(ip a | grep "$tap" | awk '{print $1}')
if [ "$tap_exist"x != "x" ]; then if [ "$tap_exist"x != "x" ]; then
echo "tap device existed, reuse $tap" 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 6,virtio-hyper_dmabuf \
-s 8,wdt-i6300esb \ -s 8,wdt-i6300esb \
-s 3,virtio-blk,/data/$5/$5.img \ -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 7,xhci,1-1:1-2:1-3:2-1:2-2:2-3:cap=apl \
-s 9,passthru,0/15/1 \ -s 9,passthru,0/15/1 \
$boot_cse_option \ $boot_cse_option \
--mac_seed $mac_seed \
$intr_storm_monitor \ $intr_storm_monitor \
$boot_ipu_option \ $boot_ipu_option \
-B "root=/dev/vda2 rw rootwait maxcpus=$2 nohpet console=hvc0 \ -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} mac_seed=${mac:9:8}-${vm_name}
# create a unique tap device for each VM # create a unique tap device for each VM
tap=tap_$6 tap=$6
tap_exist=$(ip a | grep "$tap" | awk '{print $1}') tap_exist=$(ip a | grep "$tap" | awk '{print $1}')
if [ "$tap_exist"x != "x" ]; then if [ "$tap_exist"x != "x" ]; then
echo "tap device existed, reuse $tap" echo "tap device existed, reuse $tap"
@ -313,7 +312,7 @@ ACRN project
intr_storm_monitor="--intr_monitor 10000,10,1,100" 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\ 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 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 7,xhci,1-1:1-2:1-3:2-1:2-2:2-3:cap=apl \
-s 8,passthru,0/15/1 \ -s 8,passthru,0/15/1 \
@ -322,7 +321,6 @@ intr_storm_monitor="--intr_monitor 10000,10,1,100"
-s 11,wdt-i6300esb \ -s 11,wdt-i6300esb \
$boot_audio_option \ $boot_audio_option \
$boot_cse_option \ $boot_cse_option \
--mac_seed $mac_seed \
-s 27,passthru,0/1b/0 \ -s 27,passthru,0/1b/0 \
-s 24,passthru,0/18/0 \ -s 24,passthru,0/18/0 \
-s 18,passthru,3/0/0,keep_gsi \ -s 18,passthru,3/0/0,keep_gsi \

View File

@ -105,7 +105,7 @@ Prepare the Script to Create an Image
mem_size=4096M mem_size=4096M
acrn-dm -m $mem_size -s 0:0,hostbridge -s 1:0,lpc -l com1,stdio \ acrn-dm -m $mem_size -s 0:0,hostbridge -s 1:0,lpc -l com1,stdio \
-s 2,passthru,0/2/0 \ -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 4,virtio-blk,/home/acrn/work/win10-ltsc.img
-s 5,ahci,cd:/home/acrn/work/Windows10.iso \ -s 5,ahci,cd:/home/acrn/work/Windows10.iso \
-s 6,ahci,cd:/home/acrn/work/winvirtio.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. 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. 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. This is for the network virtualization.
* ``-s 3,virtio-input,/dev/input/event4``: * ``-s 3,virtio-input,/dev/input/event4``:

View File

@ -93,19 +93,6 @@ Here are descriptions for each of these ``acrn-dm`` command line parameters:
---- ----
``--mac_seed <seed_string>``
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 <ramdisk_image_path>`` ``-r``, ``--ramdisk <ramdisk_image_path>``
Set the ramdisk (full path) for the User VM. The maximum length is 1023. 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. 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-net``
- Virtio network type device, parameter should be appended with the format: - Virtio network type device, parameter should be appended with the format:
``virtio-net,<device_name>,[vhost],[mac=<XX:XX:XX:XX:XX:XX>]``. ``virtio-net,<device_type>=<name>,[vhost],[mac=<XX:XX:XX:XX:XX:XX>],[mac_seed=<seed_string>]``.
The ``mac`` address is optional, ``device_name`` is the name of the TAP (or MacVTap) device. The ``mac`` address is optional, ``name`` is the name of the TAP (or MacVTap) device.
It must include the keyword ``tap``.
``vhost`` specifies vhost backend, otherwise the VBSU backend is used. ``vhost`` specifies vhost backend, otherwise the VBSU backend is used.
``mac_seed=<seed_string>``
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`` * - ``passthru``
- Indicates a passthrough device. Use the parameter with the format - Indicates a passthrough device. Use the parameter with the format