Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1817219pxb; Mon, 13 Sep 2021 06:14:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwYwjzq56mkmN3qQjyg4ahbjw+kXBZ8VioCpwQsUnn0ixbSMWPiHqE7hJKqr4YsQD+73t45 X-Received: by 2002:a50:998c:: with SMTP id m12mr13519220edb.327.1631538895017; Mon, 13 Sep 2021 06:14:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631538895; cv=none; d=google.com; s=arc-20160816; b=cvoKssTCDstMeuKOLhZLe5rlKrhTxJGpnqxqxV/xCvq8ssbi8VzegaN7J6VUhZzQPu NWcGcvzHbzLoyCIllhZN6OVUgV444AIl+qtVAVo2nDhSeanZs+8xPeqgJncgWDM20DMG Hm6B8rL+xZG0yvxNxlgV5cInGcMf95qjb8X4Sxw/jGbTpn1tj14tyO8PgOPY3j4BNasA Msq0iG1HQb/6B8snyJVxZU/uZsPlt0T2e3hJRjxO2ITHuOUDL5/CyUj7uM434uWnnK4g dUEsDdU3Z8ilSLgDNXQxbiKk0Isk9zfUSoMwBsY5R/1GOZro8bt787NnzYzhwt68uaoZ +/nA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=IyUQqSpzkyP9ZItz6KK+VTyAed701x3rrwfQm2pCXWs=; b=Upu8aW/qSWhWn3XVUP9pBj6l7y5vsAZUDnHTac396bFxUzmyIXt7cy42en1nk5anBr kvL2hlJOgom4ePPeMXISkEOJ7BzLRfk2d3frl9+/FdKSxYdDQ50JrBPhysJCb7eQ6XPa R8/IWU+kN49c5uW9nHuFNGw/hmfa0k3/m3BcLsSOvkMAoMgL7D3KfXJi1FFJLwaicNmZ WAEvIHa18pbzik7D+V499cQAnnOJwB9Y4AHErtU6TiXtnYNCRSm6+NEPY6KueaPZZi91 n8Ttu1SCcsHUrrYTUtTWSr9bO0Vrs8SuEDW0kAtLlyLNcvBjNc+Qn/JkY84V0SIcO8h1 S9Ng== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x5si7263241ejf.530.2021.09.13.06.14.23; Mon, 13 Sep 2021 06:14:55 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238258AbhIMNN5 (ORCPT + 99 others); Mon, 13 Sep 2021 09:13:57 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:9425 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238516AbhIMNNu (ORCPT ); Mon, 13 Sep 2021 09:13:50 -0400 Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4H7Rc41JhLz8yVj; Mon, 13 Sep 2021 21:08:04 +0800 (CST) Received: from kwepemm600016.china.huawei.com (7.193.23.20) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 13 Sep 2021 21:12:29 +0800 Received: from localhost.localdomain (10.67.165.24) by kwepemm600016.china.huawei.com (7.193.23.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.8; Mon, 13 Sep 2021 21:12:28 +0800 From: Guangbin Huang To: , CC: , , , Subject: [PATCH net 3/6] net: hns3: change affinity_mask to numa node range Date: Mon, 13 Sep 2021 21:08:22 +0800 Message-ID: <20210913130825.27025-4-huangguangbin2@huawei.com> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210913130825.27025-1-huangguangbin2@huawei.com> References: <20210913130825.27025-1-huangguangbin2@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.67.165.24] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600016.china.huawei.com (7.193.23.20) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yufeng Mo 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 --- .../ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c index e55ba2e511b1..aed97c934bfb 100644 --- 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_config(struct hclge_dev *hdev) 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_dev *hdev) 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; } -- 2.33.0