From: Huazhong Tan <tanhuazhong@huawei.com>
To: <davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<salil.mehta@huawei.com>, <yisen.zhuang@huawei.com>,
<linuxarm@huawei.com>, Yunsheng Lin <linyunsheng@huawei.com>,
Huazhong Tan <tanhuazhong@huawei.com>
Subject: [Patch net-next 01/12] net: hns3: add xps setting support for hns3 driver
Date: Sat, 23 Feb 2019 17:22:08 +0800 [thread overview]
Message-ID: <1550913739-13232-2-git-send-email-tanhuazhong@huawei.com> (raw)
In-Reply-To: <1550913739-13232-1-git-send-email-tanhuazhong@huawei.com>
From: Yunsheng Lin <linyunsheng@huawei.com>
This patch adds xps setting support for hns3 driver based on
the interrupt affinity info.
Signed-off-by: Yunsheng Lin <linyunsheng@huawei.com>
Signed-off-by: Huazhong Tan <tanhuazhong@huawei.com>
---
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 40b1722..d75977c 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -378,6 +378,29 @@ static int hns3_nic_net_up(struct net_device *netdev)
return ret;
}
+static void hns3_config_xps(struct hns3_nic_priv *priv)
+{
+ int i;
+
+ for (i = 0; i < priv->vector_num; i++) {
+ struct hns3_enet_tqp_vector *tqp_vector = &priv->tqp_vector[i];
+ struct hns3_enet_ring *ring = tqp_vector->tx_group.ring;
+
+ while (ring) {
+ int ret;
+
+ ret = netif_set_xps_queue(priv->netdev,
+ &tqp_vector->affinity_mask,
+ ring->tqp->tqp_index);
+ if (ret)
+ netdev_warn(priv->netdev,
+ "set xps queue failed: %d", ret);
+
+ ring = ring->next;
+ }
+ }
+}
+
static int hns3_nic_net_open(struct net_device *netdev)
{
struct hns3_nic_priv *priv = netdev_priv(netdev);
@@ -410,6 +433,7 @@ static int hns3_nic_net_open(struct net_device *netdev)
if (h->ae_algo->ops->set_timer_task)
h->ae_algo->ops->set_timer_task(priv->ae_handle, true);
+ hns3_config_xps(priv);
return 0;
}
--
2.7.4
next prev parent reply other threads:[~2019-02-23 9:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-23 9:22 [Patch net-next 00/12] code optimizations & bugfixes for HNS3 driver Huazhong Tan
2019-02-23 9:22 ` Huazhong Tan [this message]
2019-02-23 9:22 ` [Patch net-next 02/12] net: hns3: avoid mult + div op in critical data path Huazhong Tan
2019-02-23 9:22 ` [Patch net-next 03/12] net: hns3: limit some variable scope " Huazhong Tan
2019-02-23 9:22 ` [Patch net-next 04/12] net: hns3: remove some ops in struct hns3_nic_ops Huazhong Tan
2019-02-23 9:22 ` [Patch net-next 05/12] net: hns3: add unlikely for error handling in data path Huazhong Tan
2019-02-23 9:22 ` [Patch net-next 06/12] net: hns3: replace hnae3_set_bit and hnae3_set_field " Huazhong Tan
2019-02-23 9:22 ` [Patch net-next 07/12] net: hns3: remove hnae3_get_bit " Huazhong Tan
2019-02-23 9:22 ` [Patch net-next 08/12] net: hns3: add support to config depth for tx|rx ring separately Huazhong Tan
2019-02-23 9:22 ` [Patch net-next 09/12] net: hns3: enable VF VLAN filter for each VF when initializing Huazhong Tan
2019-02-23 9:22 ` [Patch net-next 10/12] net: hns3: fix get VF RSS issue Huazhong Tan
2019-02-23 9:22 ` [Patch net-next 11/12] net: hns3: fix setting of the hns reset_type for rdma hw errors Huazhong Tan
2019-02-23 9:22 ` [Patch net-next 12/12] net: hns3: fix improper error handling for hns3_client_start Huazhong Tan
2019-02-25 6:10 ` [Patch net-next 00/12] code optimizations & bugfixes for HNS3 driver David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1550913739-13232-2-git-send-email-tanhuazhong@huawei.com \
--to=tanhuazhong@huawei.com \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=linyunsheng@huawei.com \
--cc=netdev@vger.kernel.org \
--cc=salil.mehta@huawei.com \
--cc=yisen.zhuang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox