]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
net: hns3: fix napi_disable not return problem
authorHuazhong Tan <tanhuazhong@huawei.com>
Tue, 18 Dec 2018 11:37:50 +0000 (19:37 +0800)
committerKleber Sacilotto de Souza <kleber.souza@canonical.com>
Mon, 14 Jan 2019 09:28:55 +0000 (09:28 +0000)
BugLink: https://bugs.launchpad.net/bugs/1810457
While doing DOWN, the calling of napi_disable() may not return, since the
napi_complete() in the hns3_nic_common_poll() will never be called when
HNS3_NIC_STATE_DOWN is set. So we need to call napi_complete() before
checking HNS3_NIC_STETE_DOWN.

Fixes: ff0699e04b97 ("net: hns3: stop napi polling when HNS3_NIC_STATE_DOWN is set")
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit 531eba0fe2b5172ed0ab1cc6a311b2b6b9e6b402)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c

index 5a663cf8f0b735f1eeef1e655bc3e5d511dc5436..ca8aa8efb86e5373a8337883f5a65b4bf97ded30 100644 (file)
@@ -2898,8 +2898,8 @@ static int hns3_nic_common_poll(struct napi_struct *napi, int budget)
        if (!clean_complete)
                return budget;
 
-       if (likely(!test_bit(HNS3_NIC_STATE_DOWN, &priv->state)) &&
-           napi_complete(napi)) {
+       if (napi_complete(napi) &&
+           likely(!test_bit(HNS3_NIC_STATE_DOWN, &priv->state))) {
                hns3_update_new_int_gl(tqp_vector);
                hns3_mask_vector_irq(tqp_vector, 1);
        }