ACK: [PATCH 1/1] net: hns: Use NAPI_POLL_WEIGHT for hns driver

Connor Kuehl connor.kuehl at canonical.com
Tue May 28 21:31:27 UTC 2019


On 5/27/19 6:01 AM, Ike Panhc wrote:
> From: Yonglong Liu <liuyonglong at huawei.com>
> 
> BugLink: https://bugs.launchpad.net/bugs/1830587
> 
> When the HNS driver loaded, always have an error print:
> "netif_napi_add() called with weight 256"
> 
> This is because the kernel checks the NAPI polling weights
> requested by drivers and it prints an error message if a driver
> requests a weight bigger than 64.
> 
> So use NAPI_POLL_WEIGHT to fix it.
> 
> Signed-off-by: Yonglong Liu <liuyonglong at huawei.com>
> Signed-off-by: Peng Li <lipeng321 at huawei.com>
> Signed-off-by: David S. Miller <davem at davemloft.net>
> (cherry picked from commit acb1ce15a61154aa501891d67ebf79bc9ea26818)
> Signed-off-by: Ike Panhc <ike.pan at canonical.com>

Acked-by: Connor Kuehl <connor.kuehl at canonical.com>

> ---
>  drivers/net/ethernet/hisilicon/hns/hns_enet.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
> index 60e7d7ae3787..914e50aca268 100644
> --- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
> +++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
> @@ -29,9 +29,6 @@
>  
>  #define SERVICE_TIMER_HZ (1 * HZ)
>  
> -#define NIC_TX_CLEAN_MAX_NUM 256
> -#define NIC_RX_CLEAN_MAX_NUM 64
> -
>  #define RCB_IRQ_NOT_INITED 0
>  #define RCB_IRQ_INITED 1
>  #define HNS_BUFFER_SIZE_2048 2048
> @@ -2152,7 +2149,7 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv)
>  			hns_nic_tx_fini_pro_v2;
>  
>  		netif_napi_add(priv->netdev, &rd->napi,
> -			       hns_nic_common_poll, NIC_TX_CLEAN_MAX_NUM);
> +			       hns_nic_common_poll, NAPI_POLL_WEIGHT);
>  		rd->ring->irq_init_flag = RCB_IRQ_NOT_INITED;
>  	}
>  	for (i = h->q_num; i < h->q_num * 2; i++) {
> @@ -2165,7 +2162,7 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv)
>  			hns_nic_rx_fini_pro_v2;
>  
>  		netif_napi_add(priv->netdev, &rd->napi,
> -			       hns_nic_common_poll, NIC_RX_CLEAN_MAX_NUM);
> +			       hns_nic_common_poll, NAPI_POLL_WEIGHT);
>  		rd->ring->irq_init_flag = RCB_IRQ_NOT_INITED;
>  	}
>  
> 


-- 
Connor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pEpkey.asc
Type: application/pgp-keys
Size: 5950 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20190528/1bbf0534/attachment-0001.key>


More information about the kernel-team mailing list