OSDN Git Service

net: hns: fix soft lockup when there is not enough memory
authorYonglong Liu <liuyonglong@huawei.com>
Thu, 16 Jan 2020 07:41:17 +0000 (15:41 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jan 2020 07:21:35 +0000 (08:21 +0100)
commit11235a3d7bfcb19a1bb60092e282d8da5567f30f
treec390a5bf6358fe9ecd0408cf52b458723ab4a172
parent0eb8f098a2126f6ed09e4c1ee3bfcfe64eaab7d1
net: hns: fix soft lockup when there is not enough memory

[ Upstream commit 49edd6a2c456150870ddcef5b7ed11b21d849e13 ]

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: 36eedfde1a36 ("net: hns: Optimize hns_nic_common_poll for better performance")
Fixes: b5996f11ea54 ("net: add Hisilicon Network Subsystem basic ethernet support")
Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/hisilicon/hns/hns_enet.c