summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
diff options
context:
space:
mode:
authorJie Wang <wangjie125@huawei.com>2024-06-05 10:20:58 +0300
committerDavid S. Miller <davem@davemloft.net>2024-06-07 14:20:28 +0300
commit968fde83841a8c23558dfbd0a0c69d636db52b55 (patch)
tree48d34b4cbc01bf25c0ed72ca619ec151d05e0cae /drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
parent12cda920212a49fa22d9e8b9492ac4ea013310a4 (diff)
downloadlinux-968fde83841a8c23558dfbd0a0c69d636db52b55.tar.xz
net: hns3: add cond_resched() to hns3 ring buffer init process
Currently hns3 ring buffer init process would hold cpu too long with big Tx/Rx ring depth. This could cause soft lockup. So this patch adds cond_resched() to the process. Then cpu can break to run other tasks instead of busy looping. Fixes: a723fb8efe29 ("net: hns3: refine for set ring parameters") Signed-off-by: Jie Wang <wangjie125@huawei.com> Signed-off-by: Jijie Shao <shaojijie@huawei.com> Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns3/hns3_enet.h')
-rw-r--r--drivers/net/ethernet/hisilicon/hns3/hns3_enet.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
index acd756b0c7c9..d36c4ed16d8d 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
@@ -214,6 +214,8 @@ enum hns3_nic_state {
#define HNS3_CQ_MODE_EQE 1U
#define HNS3_CQ_MODE_CQE 0U
+#define HNS3_RESCHED_BD_NUM 1024
+
enum hns3_pkt_l2t_type {
HNS3_L2_TYPE_UNICAST,
HNS3_L2_TYPE_MULTICAST,