aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSheng Li <lisheng011@huawei.com>2016-03-24 07:08:04 -0400
committerDavid S. Miller <davem@davemloft.net>2016-03-24 14:33:07 -0400
commit4b34aa412c1213912608742b4d016f616b23d9e2 (patch)
treec6855e04eb3a8b6dfc35c462aa412f015116e18d
parent1c3bae6e475fed5c570ac16fef2afe743c477886 (diff)
net: hns: optimizate irq proccess for HNS V2
In hns V1, common_poll should check and clean fbd pkts, because it can not pend irq to clean them if there is no new pkt comes in. But hns V2 hw fixes this bug, and will pend irq itself to do this. So, for hns V2, we set ring_data->fini_process to NULL. Signed-off-by: Sheng Li <lisheng011@huawei.com> Signed-off-by: Yisen Zhuang <Yisen.Zhuang@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/hisilicon/hns/hns_enet.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
index f0c9a41a7443..66d1652ffbed 100644
--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
@@ -956,8 +956,8 @@ static int hns_nic_common_poll(struct napi_struct *napi, int budget)
956 napi_complete(napi); 956 napi_complete(napi);
957 ring_data->ring->q->handle->dev->ops->toggle_ring_irq( 957 ring_data->ring->q->handle->dev->ops->toggle_ring_irq(
958 ring_data->ring, 0); 958 ring_data->ring, 0);
959 959 if (ring_data->fini_process)
960 ring_data->fini_process(ring_data); 960 ring_data->fini_process(ring_data);
961 return 0; 961 return 0;
962 } 962 }
963 963
@@ -1720,6 +1720,7 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv)
1720{ 1720{
1721 struct hnae_handle *h = priv->ae_handle; 1721 struct hnae_handle *h = priv->ae_handle;
1722 struct hns_nic_ring_data *rd; 1722 struct hns_nic_ring_data *rd;
1723 bool is_ver1 = AE_IS_VER1(priv->enet_ver);
1723 int i; 1724 int i;
1724 1725
1725 if (h->q_num > NIC_MAX_Q_PER_VF) { 1726 if (h->q_num > NIC_MAX_Q_PER_VF) {
@@ -1737,7 +1738,7 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv)
1737 rd->queue_index = i; 1738 rd->queue_index = i;
1738 rd->ring = &h->qs[i]->tx_ring; 1739 rd->ring = &h->qs[i]->tx_ring;
1739 rd->poll_one = hns_nic_tx_poll_one; 1740 rd->poll_one = hns_nic_tx_poll_one;
1740 rd->fini_process = hns_nic_tx_fini_pro; 1741 rd->fini_process = is_ver1 ? hns_nic_tx_fini_pro : NULL;
1741 1742
1742 netif_napi_add(priv->netdev, &rd->napi, 1743 netif_napi_add(priv->netdev, &rd->napi,
1743 hns_nic_common_poll, NIC_TX_CLEAN_MAX_NUM); 1744 hns_nic_common_poll, NIC_TX_CLEAN_MAX_NUM);
@@ -1749,7 +1750,7 @@ static int hns_nic_init_ring_data(struct hns_nic_priv *priv)
1749 rd->ring = &h->qs[i - h->q_num]->rx_ring; 1750 rd->ring = &h->qs[i - h->q_num]->rx_ring;
1750 rd->poll_one = hns_nic_rx_poll_one; 1751 rd->poll_one = hns_nic_rx_poll_one;
1751 rd->ex_process = hns_nic_rx_up_pro; 1752 rd->ex_process = hns_nic_rx_up_pro;
1752 rd->fini_process = hns_nic_rx_fini_pro; 1753 rd->fini_process = is_ver1 ? hns_nic_rx_fini_pro : NULL;
1753 1754
1754 netif_napi_add(priv->netdev, &rd->napi, 1755 netif_napi_add(priv->netdev, &rd->napi,
1755 hns_nic_common_poll, NIC_RX_CLEAN_MAX_NUM); 1756 hns_nic_common_poll, NIC_RX_CLEAN_MAX_NUM);