Commit 1dc839ec authored by Yufeng Mo's avatar Yufeng Mo Committed by David S. Miller

net: hns3: change affinity_mask to numa node range

Currently, affinity_mask is set to a single cpu. As a result,
irqbalance becomes invalid in SUBSET or EXACT mode. To solve
this problem, change affinity_mask to numa node range. In this
way, irqbalance can be performed on the cpu of the numa node.

Fixes: 08125454 ("net: hns3: add interrupt affinity support for misc interrupt")
Signed-off-by: default avatarYufeng Mo <moyufeng@huawei.com>
Signed-off-by: default avatarGuangbin Huang <huangguangbin2@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d18e8118
...@@ -1528,9 +1528,10 @@ static void hclge_init_kdump_kernel_config(struct hclge_dev *hdev) ...@@ -1528,9 +1528,10 @@ static void hclge_init_kdump_kernel_config(struct hclge_dev *hdev)
static int hclge_configure(struct hclge_dev *hdev) static int hclge_configure(struct hclge_dev *hdev)
{ {
struct hnae3_ae_dev *ae_dev = pci_get_drvdata(hdev->pdev); struct hnae3_ae_dev *ae_dev = pci_get_drvdata(hdev->pdev);
const struct cpumask *cpumask = cpu_online_mask;
struct hclge_cfg cfg; struct hclge_cfg cfg;
unsigned int i; unsigned int i;
int ret; int node, ret;
ret = hclge_get_cfg(hdev, &cfg); ret = hclge_get_cfg(hdev, &cfg);
if (ret) if (ret)
...@@ -1595,11 +1596,12 @@ static int hclge_configure(struct hclge_dev *hdev) ...@@ -1595,11 +1596,12 @@ static int hclge_configure(struct hclge_dev *hdev)
hclge_init_kdump_kernel_config(hdev); hclge_init_kdump_kernel_config(hdev);
/* Set the init affinity based on pci func number */ /* Set the affinity based on numa node */
i = cpumask_weight(cpumask_of_node(dev_to_node(&hdev->pdev->dev))); node = dev_to_node(&hdev->pdev->dev);
i = i ? PCI_FUNC(hdev->pdev->devfn) % i : 0; if (node != NUMA_NO_NODE)
cpumask_set_cpu(cpumask_local_spread(i, dev_to_node(&hdev->pdev->dev)), cpumask = cpumask_of_node(node);
&hdev->affinity_mask);
cpumask_copy(&hdev->affinity_mask, cpumask);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment