From a5bb8b792691fabf9bb61ae5328eb47d7d5da7fb Mon Sep 17 00:00:00 2001
From: Peng Li <lipeng321@huawei.com>
Date: Wed, 19 Sep 2018 18:29:47 +0100
Subject: [PATCH 003/283] net: hns3: Add default irq affinity

mainline inclusion
from mainline-v4.20-rc1
commit 874bff0ba6cf884dde0220bfa8945f164e6da1d1
category: feature
bugzilla: https://gitee.com/src-openeuler/kernel/issues/I8EJ0A

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=874bff0ba6cf884dde0220bfa8945f164e6da1d1

--------------------------------

All irq will float to cpu0 if do not set irq affinity.
This patch adds default irq affinity in hns3 driver, users can
also change the irq affinity in OS.

Signed-off-by: Peng Li <lipeng321@huawei.com>
Signed-off-by: Salil Mehta <salil.mehta@huawei.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Xiaodong Li <lixiaodong67@huawei.com>

 Conflicts:
	drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
---
 drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
index 20703ce86281..1495e972dc89 100644
--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
+++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
@@ -100,6 +100,10 @@ static irqreturn_t hns3_irq_handle(int irq, void *vector)
 	return IRQ_HANDLED;
 }
 
+/* This callback function is used to set affinity changes to the irq affinity
+ * masks when the irq_set_affinity_notifier function is used.
+ */
+
 static void hns3_nic_uninit_irq(struct hns3_nic_priv *priv)
 {
 	struct hns3_enet_tqp_vector *tqp_vectors;
@@ -3673,6 +3677,8 @@ static int hns3_nic_init_vector_data(struct hns3_nic_priv *priv)
 
 	hns3_nic_set_cpumask(priv);
 
+	hns3_nic_set_cpumask(priv);
+
 	for (i = 0; i < priv->vector_num; i++) {
 		tqp_vector = &priv->tqp_vector[i];
 		hns3_vector_gl_rl_init_hw(tqp_vector, priv);
-- 
2.34.1

