Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2353331pxb; Mon, 20 Sep 2021 19:51:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwtbE/bLuxr4qr6sLG97Ejd3NitggjoGSNSpWL+vXhPYqnURuJgFEE5EfgVuv8EPGOOApAS X-Received: by 2002:a17:906:6b1a:: with SMTP id q26mr8073798ejr.185.1632192685202; Mon, 20 Sep 2021 19:51:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632192685; cv=none; d=google.com; s=arc-20160816; b=vyHm6H3bsiScz3vGhdVRO6eNd37S1L1qbACvAa2h5dorpin0cwjhlrzFs0OCiVxceG LCLtAfqhZJg0Fa7hMJp3/r3303Nd3dMLYdThQHcSFiQko0qj/s4zPqkwqPSNStFq6ZF5 nBODoYwn1DJwFPIi5MByOVrAZbWcaRmb0O2lrLqOu0Yn4f+eagS9n7OLhx5KHWsbMXic ZgUMw841adgzcu34O5wfQs8ZnHPDc8u+2O8JeJhljsvcdBgzkv2hGENt2YWsBvm1065M MCcX9iWjwZZvcbB5zn8T+xN3q8lRY1tqrB8YqKT2eRFAc9uurHbeVvEXYNAQuPLAmq84 VBPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=NUWe4fXNCzEEV8+hZDOvPYzL9VnZY27MdjRx5eV0tU0=; b=APpZcNvNzjffl6/qEnq0XPfqQzP/KIhr1vcOAE+ZvZudqOYuRocVTGlQwTGJa3VoUl brsFVFFFSXNN4acIuus3ciqXdjsZy+VqMBx0re2Nt4ZZJGGPgGqROF3K8Of3tfgfsbh1 iwOYnZI57EuqxOAhWKU6WvF4K7Abz845BtQky2+TNqTQ+iRES05sI5NaBqf0pdvEsPWE eAjsQneTbaotl5uijV1xlU79sbqCISB9fr/21wuo82QKiZRWAP/IN3+vL/B4d1mu+Za8 1VlVYTRnRTZdJ4VCYWKoOziQ3/KEU5lAbe+0eiNdb2CGdIMRESumErST3sYN/O/PsDVv PGFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="BAC1vT/O"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v6si17857672ejh.227.2021.09.20.19.51.02; Mon, 20 Sep 2021 19:51:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="BAC1vT/O"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1383788AbhITSpv (ORCPT + 99 others); Mon, 20 Sep 2021 14:45:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:56444 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1382711AbhITSmR (ORCPT ); Mon, 20 Sep 2021 14:42:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 3C0C160ED7; Mon, 20 Sep 2021 17:31:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632159098; bh=nahmwN+1vmBJpkw0w1mb+Bp/zccUUYudua2x62yBPBM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BAC1vT/OWIwzBh0FBIIStvEQ6R4mEOUl9cwLl89nseYGE8MmtSfIcAP19bssVofaP xHtXW8hbV3mzq2iv8fQSmpXlVbVsWTbLCX50egtSPn7X/JBH15pw0N9sexI+eckF4F UwhLPGhGOSzjb34CAsFdhNbZdk6ljGc6AFgMjBxs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yufeng Mo , Guangbin Huang , "David S. Miller" Subject: [PATCH 5.14 076/168] net: hns3: change affinity_mask to numa node range Date: Mon, 20 Sep 2021 18:43:34 +0200 Message-Id: <20210920163924.139379470@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210920163921.633181900@linuxfoundation.org> References: <20210920163921.633181900@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yufeng Mo commit 1dc839ec09d3ab2a4156dc98328b8bc3586f2b70 upstream. 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: 0812545487ec ("net: hns3: add interrupt affinity support for misc interrupt") Signed-off-by: Yufeng Mo Signed-off-by: Guangbin Huang Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) --- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c @@ -1528,9 +1528,10 @@ static void hclge_init_kdump_kernel_conf static int hclge_configure(struct hclge_dev *hdev) { struct hnae3_ae_dev *ae_dev = pci_get_drvdata(hdev->pdev); + const struct cpumask *cpumask = cpu_online_mask; struct hclge_cfg cfg; unsigned int i; - int ret; + int node, ret; ret = hclge_get_cfg(hdev, &cfg); if (ret) @@ -1595,11 +1596,12 @@ static int hclge_configure(struct hclge_ hclge_init_kdump_kernel_config(hdev); - /* Set the init affinity based on pci func number */ - i = cpumask_weight(cpumask_of_node(dev_to_node(&hdev->pdev->dev))); - i = i ? PCI_FUNC(hdev->pdev->devfn) % i : 0; - cpumask_set_cpu(cpumask_local_spread(i, dev_to_node(&hdev->pdev->dev)), - &hdev->affinity_mask); + /* Set the affinity based on numa node */ + node = dev_to_node(&hdev->pdev->dev); + if (node != NUMA_NO_NODE) + cpumask = cpumask_of_node(node); + + cpumask_copy(&hdev->affinity_mask, cpumask); return ret; }