Hi,

I'm observing intermittent failures when enabling the HNS3 network port in VM 
using
QEMU with the mainline kernel.

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
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?

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

Thanks
Jinqian

Reply via email to