summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
diff options
context:
space:
mode:
authorLin Yun Sheng <linyunsheng@huawei.com>2017-08-02 17:57:37 +0800
committerDavid S. Miller <davem@davemloft.net>2017-08-03 09:21:14 -0700
commitb8c17f7088310e7ee34ca61929f737045adfd449 (patch)
tree6f032b03020e149255963affbe2a6549fbde30e3 /drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
parente9e6c2329a518d43a4734b26349bb19d8dfd7e6b (diff)
net: hns: Add self-adaptive interrupt coalesce support in hns driver
When deal with low and high throughput, it is hard to achiece both high performance and low latency. In order to achiece that, this patch calculates the rx rate, and adjust the interrupt coalesce parameter accordingly. Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com> Tested-by: Weiwei Deng <dengweiwei@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/hisilicon/hns/hns_ethtool.c')
-rw-r--r--drivers/net/ethernet/hisilicon/hns/hns_ethtool.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
index 78cb20c67aa6..7ea7f8a4aa2a 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_ethtool.c
@@ -735,8 +735,8 @@ static int hns_get_coalesce(struct net_device *net_dev,
ops = priv->ae_handle->dev->ops;
- ec->use_adaptive_rx_coalesce = 1;
- ec->use_adaptive_tx_coalesce = 1;
+ ec->use_adaptive_rx_coalesce = priv->ae_handle->coal_adapt_en;
+ ec->use_adaptive_tx_coalesce = priv->ae_handle->coal_adapt_en;
if ((!ops->get_coalesce_usecs) ||
(!ops->get_max_coalesced_frames))
@@ -787,6 +787,9 @@ static int hns_set_coalesce(struct net_device *net_dev,
(!ops->set_coalesce_frames))
return -ESRCH;
+ if (ec->use_adaptive_rx_coalesce != priv->ae_handle->coal_adapt_en)
+ priv->ae_handle->coal_adapt_en = ec->use_adaptive_rx_coalesce;
+
rc1 = ops->set_coalesce_usecs(priv->ae_handle,
ec->rx_coalesce_usecs);