-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
rhel-9.4
-
None
-
Low
-
rhel-sst-virtualization
-
ssg_virtualization
-
5
-
QE ack
-
False
-
-
None
-
Red Hat Enterprise Linux
-
None
-
None
-
None
-
-
x86_64
-
Linux
-
None
What were you trying to do that didn't work?
The migration will fail if the migratable VF's migration function is disabled after it is bond to mlx_vfio_pci driver
Please provide the package NVR for which bug is seen:
host:
qemu-kvm-8.2.0-6.el9.x86_64
5.14.0-426.el9.x86_64
How reproducible:
100%
Steps to reproduce
1. set up the mlx PF in switchdev mode
# devlink dev eswitch set pci/0000:e1:00.0 mode switchdev # devlink dev eswitch show pci/0000:e1:00.0
2.create a mlx VF
# echo 1 > /sys/bus/pci/devices/0000\:e1\:00.0/sriov_numvfs
3. unbind the VF
# echo 0000:e1:00.1 > /sys/bus/pci/drivers/mlx5_core/unbind
4. enable the mlx VF's migration function
# devlink port function set pci/0000:e1:00.0/1 migratable enable # devlink port show pci/0000:e1:00.0/1
5. bind mlx VF to mlx_vfio_pci driver
# virsh nodedev-detach pci_0000_e1_00_1
6. disable the mlx VF's migration function
# devlink port function set pci/0000:e1:00.0/1 migratable disable
7. start a VM with the mlx VF (managed='no')
<hostdev mode='subsystem' type='pci' managed='no'> <driver name='vfio'/> <source> <address domain='0x0000' bus='0xe1' slot='0x00' function='0x1'/> </source> </hostdev>
8. migrate the VM
# virsh managedsave rhel94 error: Failed to save domain 'rhel94' state error: operation failed: job 'domain save' unexpectedly failed
9. check the qemu-kvm log
# cat /var/log/libvirt/qemu/rhel94.log ... 0000:e1:00.1: Failed setting device state to RUNNING_P2P, err: Invalid argument. Recover state is ERROR. Resetting device 0000:e1:00.1: Failed setting device state to RUNNING_P2P, err: Invalid argument. Recover state is ERROR. Resetting device 0000:e1:00.1: Failed setting device state to STOP, err: Invalid argument. Recover state is ERROR. Resetting device 2024-02-29T09:54:57.285215Z qemu-kvm: 0000:e1:00.1: Failed setting device state to STOP_COPY, err: Invalid argument. Setting device in recover state STOP 2024-02-29T09:54:57.285861Z qemu-kvm: 0000:e1:00.1: Failed setting device in recover state, err: Invalid argument. Resetting device 0000:e1:00.1: Failed setting device state to RUNNING_P2P, err: Invalid argument. Recover state is ERROR. Resetting device
Expected results
The mlx vf migration should be blocked and can not be started
Actual results
The mlx vf migration starts and fails