net: hns3: fix an interrupt residual problem
authorYonglong Liu <liuyonglong@huawei.com>
Wed, 30 Apr 2025 09:30:50 +0000 (17:30 +0800)
committerJakub Kicinski <kuba@kernel.org>
Thu, 1 May 2025 14:19:48 +0000 (07:19 -0700)
commit8e6b9c6ea5a55045eed6526d8ee49e93192d1a58
treeb3334cb104e9a0444fe40adf3da599c2d47f58b9
parentef2383d078edcbe3055032436b16cdf206f26de2
net: hns3: fix an interrupt residual problem

When a VF is passthrough to a VM, and the VM is killed, the reported
interrupt may not been handled, it will remain, and won't be clear by
the nic engine even with a flr or tqp reset. When the VM restart, the
interrupt of the first vector may be dropped by the second enable_irq
in vfio, see the issue below:
https://gitlab.com/qemu-project/qemu/-/issues/2884#note_2423361621

We notice that the vfio has always behaved this way, and the interrupt
is a residue of the nic engine, so we fix the problem by moving the
vector enable process out of the enable_irq loop.

Fixes: 08a100689d4b ("net: hns3: re-organize vector handle")
Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: Jijie Shao <shaojijie@huawei.com>
Link: https://patch.msgid.link/20250430093052.2400464-3-shaojijie@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c