]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - queue-4.4/net-hns-use-napi_poll_weight-for-hns-driver.patch
4.4-stable patches
[thirdparty/kernel/stable-queue.git] / queue-4.4 / net-hns-use-napi_poll_weight-for-hns-driver.patch
1 From b0c028e3b215537b30a37d137ec71b84641a44bb Mon Sep 17 00:00:00 2001
2 From: Yonglong Liu <liuyonglong@huawei.com>
3 Date: Thu, 4 Apr 2019 16:46:43 +0800
4 Subject: net: hns: Use NAPI_POLL_WEIGHT for hns driver
5
6 [ Upstream commit acb1ce15a61154aa501891d67ebf79bc9ea26818 ]
7
8 When the HNS driver loaded, always have an error print:
9 "netif_napi_add() called with weight 256"
10
11 This is because the kernel checks the NAPI polling weights
12 requested by drivers and it prints an error message if a driver
13 requests a weight bigger than 64.
14
15 So use NAPI_POLL_WEIGHT to fix it.
16
17 Signed-off-by: Yonglong Liu <liuyonglong@huawei.com>
18 Signed-off-by: Peng Li <lipeng321@huawei.com>
19 Signed-off-by: David S. Miller <davem@davemloft.net>
20 Signed-off-by: Sasha Levin <sashal@kernel.org>
21 ---
22 drivers/net/ethernet/hisilicon/hns/hns_enet.c | 7 ++-----
23 1 file changed, 2 insertions(+), 5 deletions(-)
24
25 diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
26 index 2fa54b0b0679..6d649e7b45a9 100644
27 --- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
28 +++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
29 @@ -28,9 +28,6 @@
30
31 #define SERVICE_TIMER_HZ (1 * HZ)
32
33 -#define NIC_TX_CLEAN_MAX_NUM 256
34 -#define NIC_RX_CLEAN_MAX_NUM 64
35 -
36 #define RCB_IRQ_NOT_INITED 0
37 #define RCB_IRQ_INITED 1
38
39 @@ -1408,7 +1405,7 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv)
40 rd->fini_process = hns_nic_tx_fini_pro;
41
42 netif_napi_add(priv->netdev, &rd->napi,
43 - hns_nic_common_poll, NIC_TX_CLEAN_MAX_NUM);
44 + hns_nic_common_poll, NAPI_POLL_WEIGHT);
45 rd->ring->irq_init_flag = RCB_IRQ_NOT_INITED;
46 }
47 for (i = h->q_num; i < h->q_num * 2; i++) {
48 @@ -1420,7 +1417,7 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv)
49 rd->fini_process = hns_nic_rx_fini_pro;
50
51 netif_napi_add(priv->netdev, &rd->napi,
52 - hns_nic_common_poll, NIC_RX_CLEAN_MAX_NUM);
53 + hns_nic_common_poll, NAPI_POLL_WEIGHT);
54 rd->ring->irq_init_flag = RCB_IRQ_NOT_INITED;
55 }
56
57 --
58 2.20.1
59