• Yonglong Liu's avatar
    net: hns: fix soft lockup when there is not enough memory · 11235a3d
    Yonglong Liu authored
    [ Upstream commit 49edd6a2 ]
    
    When there is not enough memory and napi_alloc_skb() return NULL,
    the HNS driver will print error message, and than try again, if
    the memory is not enough for a while, huge error message and the
    retry operation will cause soft lockup.
    
    When napi_alloc_skb() return NULL because of no memory, we can
    get a warn_alloc() call trace, so this patch deletes the error
    message. We already use polling mode to handle irq, but the
    retry operation will render the polling weight inactive, this
    patch just return budget when the rx is not completed to avoid
    dead loop.
    
    Fixes: 36eedfde ("net: hns: Optimize hns_nic_common_poll for better performance")
    Fixes: b5996f11 ("net: add Hisilicon Network Subsystem basic ethernet support")
    Signed-off-by: default avatarYonglong Liu <liuyonglong@huawei.com>
    Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    11235a3d
hns_enet.c 62.1 KB