Skip to contentSkip to conversation

Questions about vfio-pci

DISCUSSION yangjinqian via 1 participant 1 message Mar 27, 2025

lore
Share & tools
lore
#0 lore raw
Quoted 12 lines

Hello Jinqian

Quoted 6 lines · yangjinqian via

Hi,

I'm observing intermittent failures when enabling the HNS3 network port in VM using

QEMU with the mainline kernel.

Quoted 10 lines

Would you mind opening a gitlab issue with more details on the context, host, guest, HW ?

https://gitlab.com/qemu-project/qemu/-/issues/

Thanks,

C.

Hi, Cédric

I've added the details to the gitlab issue.

https://gitlab.com/qemu-project/qemu/-/issues/2884

thanks,
Jinqian

Quoted 56 lines
Quoted 37 lines

HNS3 drive in kernel:

static int hns3_nic_net_up(struct net_device *netdev)

{

......

       /* enable the vectors */

       for (i = 0; i < vector_num; i++)

{

napi_enable(napi);

             enable_irq(vector_irq);

             hns3_mask_vector_irq(tqp_vector, 1);

       }

......

}

When the VM has two vCPUs, the guest HNS3 driver performs two sequential

enable_irq operations (vector_num=2). The enable_irq will trap into KVM for interrupt

configuration and exit to QEMU for PCI device emulation. When emulating interrupt

Quoted 8 lines

enabling in QEMU, vfio_[intx/msi/msix]_enable calls vfio_disable_interrupts to disable

all interrupts on the vdev.

The questions are:

1.Why does the vfio-pci disable all interrupts of the device before enabling

irqs?

Quoted 7 lines

2.Is this a normal vfio-pci process or a problem?

Thanks

Jinqian

Would