net/hns3: fix timing of clearing interrupt source
authorHongbo Zheng <zhenghongbo3@huawei.com>
Sat, 17 Jul 2021 02:02:52 +0000 (10:02 +0800)
committerThomas Monjalon <thomas@monjalon.net>
Fri, 23 Jul 2021 12:20:06 +0000 (14:20 +0200)
commitee930d38ffca82af6c70209be7a8f2b408dc5610
tree0fbb6d2c61b629517c2ece2c94db1f7cf113ee29
parent529017f9e70b2b41a4febf283946183586c3ebb2
net/hns3: fix timing of clearing interrupt source

Currently, the PF/VF does not clear the interrupt source immediately
after receiving the interrupt. As a result, if the second interrupt
task is triggered when processing the first interrupt task, clearing
the interrupt source before exiting will clear the interrupt sources
of the two tasks at the same time. As a result, no interrupt is
triggered for the second task.

Clearing interrupt source immediately after checking event cause
ensures that:
1. Even if two interrupt tasks are triggered at the same time, they can
be processed.
2. If the second task is triggered during the processing of the first
task and the interrupt source is not cleared, the interrupt is reported
after vector0 is enabled.

Fixes: a5475d61fa34 ("net/hns3: support VF")
Fixes: 3988ab0eee52 ("net/hns3: add abnormal interrupt process")
Cc: stable@dpdk.org
Signed-off-by: Hongbo Zheng <zhenghongbo3@huawei.com>
Signed-off-by: Min Hu (Connor) <humin29@huawei.com>
drivers/net/hns3/hns3_ethdev.c
drivers/net/hns3/hns3_ethdev_vf.c