From patchwork Wed Nov 9 20:04:42 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Simon Horman X-Patchwork-Id: 13038013 X-Patchwork-Delegate: kuba@kernel.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA5CDC43217 for ; Wed, 9 Nov 2022 20:06:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229759AbiKIUGS (ORCPT ); Wed, 9 Nov 2022 15:06:18 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbiKIUGO (ORCPT ); Wed, 9 Nov 2022 15:06:14 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on20700.outbound.protection.outlook.com [IPv6:2a01:111:f400:7eae::700]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF7592F01A for ; Wed, 9 Nov 2022 12:06:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Zr6EWj5rhwvNPOF8YurKxqMQGIUFpjJBhr3uB7T2Jb2/yYz5ZYag7lpdmqrakHGs8V1O8nlK6KpVu23HB8JzzZfI0Ciz2oW0VhicZlubIzs7ywYk8iOf2mLpMHaHdk9BnKxFtXA74akarWfzWkzDIYI2QDg16DVIPIrK75dCXyJHO095MnV4K+7sHf5skduVkHO8rvNvAUO8XDCiuqRUE57ou+PAnRkb2gJ0q052+KEDUuoAzIBq4pkllJ0+v53y4oL3DdCiO/+8H4qpL7HvYDQ30Mq5pE5gkSb4oRyv+NBd9YKKRLRp+mWV+GzYIYnkWZ8C6nvFOQ2DJgZ10ZTt3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=70aOoTzCIe7q44b00Ze99BRqrs+BZatjVrOJdibD0aM=; b=GxflxiAzH4eG4BcLXYz49eJnZ1dsyQFG85sgXR5mg1VevPen0/ZBVgTS03SZYWDYXmJYlkI98NimUqedeCA5fN+yJpefI7E86CmyRfLqTLVVcqc+/KYfmilJw7nnTCmvjH6oA2AMkLQYM8bqhXyPpiUzusrYveK4wUFq5/r9iNHqsxnNQZEo3GurO56ZUY+ZltJUhjpLbcme1TEhDcerLNQp0yefWzQCcuG1G4CRH6cxgmVlYxCq9OVCclakHK7AEDeFnUtBOyCOUNkcNYJzW21jpQO7+o3cwmpbbMZGBXS/TWVjDjSrq2B1wlSlNL+pb99gUbZyIcYK9O1HzXlu/w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=corigine.com; dmarc=pass action=none header.from=corigine.com; dkim=pass header.d=corigine.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=corigine.onmicrosoft.com; s=selector2-corigine-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=70aOoTzCIe7q44b00Ze99BRqrs+BZatjVrOJdibD0aM=; b=d5oE1d33WRck0fI/whGybHIOm3BaTGWu5ttTwLMYU/40nazeNceFYlJmqWY7hSuYq6nzF/q732HT2Fju+e4Fj/R0o4S0B41zvGkgJu4ncGutybwSMMWH6RTnKBL4LKMhZdeJJUrmVbHXSitfHLCQxuIqgSILZD4uwlyDTpscIhc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=corigine.com; Received: from PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) by SJ0PR13MB5570.namprd13.prod.outlook.com (2603:10b6:a03:420::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5791.25; Wed, 9 Nov 2022 20:05:37 +0000 Received: from PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::483b:9e84:fadc:da30]) by PH0PR13MB4842.namprd13.prod.outlook.com ([fe80::483b:9e84:fadc:da30%8]) with mapi id 15.20.5791.027; Wed, 9 Nov 2022 20:05:37 +0000 From: Simon Horman To: David Miller , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, oss-drivers@corigine.com, Yinjun Zhang , Louis Peens , =?utf-8?q?Niklas_S=C3=B6derlund?= , Simon Horman Subject: [PATCH net-next] nfp: take numa node into account when setting irq affinity Date: Wed, 9 Nov 2022 15:04:42 -0500 Message-Id: <20221109200442.143589-1-simon.horman@corigine.com> X-Mailer: git-send-email 2.30.2 X-ClientProxiedBy: MN2PR18CA0004.namprd18.prod.outlook.com (2603:10b6:208:23c::9) To PH0PR13MB4842.namprd13.prod.outlook.com (2603:10b6:510:78::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PH0PR13MB4842:EE_|SJ0PR13MB5570:EE_ X-MS-Office365-Filtering-Correlation-Id: dc768578-0833-48e6-7f64-08dac28dc492 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Sd3L+A0AXL5DT1VmjFu2aBX2/MoKtCRnDMYljaeKAhi5IGYuIsBiz4F9gCju5L2tgbBAXyGoIdZp22n6Y+Au0W/Zk4GsBsUgIirmEn6PrP1sOCCtK+8DaGv7IOoEu0nu//dj8xhy9A4gjPteHKUKIsKUE5R194kV8Fa6ODX9fuW6ZERgWOMU+F2K1zXQsfDrC9rjkaJVVE2d5ljk4eM8f20vPnBruxkpCnc3aTYov/meW9I9Ew+9qmUKl9oSJayqkYwU0SegPXe3A7+7gxMnZ8y+alSprqX6ZzKPndpax7k4QODPqlpWBP+m0dPJAcvesgqdj6Xc3Gm2xlpd+vIr+0JrM3mT1Ni2TgAJNaWRi/OU49f+Z51AJfwVOWX9BuUEriXVKLE5F9XeC9f/7q/hDSAGJCWw4SyUunFqD6GcOPCPzwpjo+Xb/1ItNWS7MqsQPtl/4LcJFuSWUku5kRXpfY59NYYc+f0nTu+ssmPasEbreHW2VmfNrTf/a5epHC4T3Aiw7mVdcw7mVMS27mLMY8J8+k6vvQRoPjGh11KvmpdiVPFWOJfaX99Xs2Hif+4Qw2CxdOFT1uCFn8wKGShRFSg3inPmVTEfk2rVkbp9kNEuWcY6jIKyczlYgOBBYP94/iHlLrNTLHg7fbUnzH+lrdPZnpWrdF7i0mwkgtUQ2BC7Cyb4C29OK3vOKcEyTI/DP3XwrhipntP3a9FSSEwYYXdX4dwu8+grvDlA+91iVFdPC85HorMioZ/dNL2gL8vXnceVoHQaPTZKdPQ+80yFmg== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PH0PR13MB4842.namprd13.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230022)(4636009)(136003)(376002)(366004)(346002)(396003)(39840400004)(451199015)(478600001)(316002)(5660300002)(36756003)(2906002)(8936002)(6486002)(66946007)(66556008)(110136005)(44832011)(83380400001)(4326008)(66476007)(6666004)(38350700002)(6506007)(107886003)(86362001)(38100700002)(52116002)(1076003)(26005)(186003)(6512007)(54906003)(2616005)(41300700001)(8676002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Dg5dYH9Ot+FJN8bySXkYqYGsHKng?= =?utf-8?q?NXrj7HiZTEYn5O6aZhk5ZsWcCDAHMbrcWvflcOGwnkoR6MP1RzdaUQcN1SMaTJh80?= =?utf-8?q?A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S6FwIkBUdxv7QKVVgw9P9J/8TrGaMKd2jZjHJ2jJVBnyz6BxJEpt6KGZvZI1LS?= =?utf-8?q?GNLO376UUNAOizxb5drZoxrPa938c6PIRgXlAgOgabT0VwWjg/b133+v4yV3HNXlM?= =?utf-8?q?fa8fFlxsvQXewVW3G2ecFeO9ZaAcZMLPA5fdO92glvxaq0cEyRyEIqAly1bKl0V2G?= =?utf-8?q?fTbR4mJKjH1Mss0DiRqti2m5fY/4JTENVz/QspuCR9u0afzLEPn72T8Kz8zugw9hM?= =?utf-8?q?p9ZRJUaE6o2G7mqDsTze1XkVX/MsUQgQv/RYOjak0kwndnlXRMvj+yjtp9HjFsr27?= =?utf-8?q?uSfAifn9ozRQdpWtSgqp3/6EBOFKOeHOxDpJKgCioOpZELSfwrszsLy5nBfjCVox9?= =?utf-8?q?Ur8aL7yf6RXhDDW48HazKuBBzMpqgXmhEyGlFaqZ2l73IOHCrAYpPWpbz4MOQqwzr?= =?utf-8?q?qbHsC2jzdxYzINcKvdrfKyxYMvEGVY1jla9pxP9Pk1TlKM7sboFzyXaRa4u58hpJ7?= =?utf-8?q?wDc5jVj91zU5JBbQ3pCtzLxVuaUZ0bts6Z3PtHmq+vz/bqxJYviyu4D0EuF5+yCGQ?= =?utf-8?q?P2dd6m0HqLthGVnKECKEfVFJSnAanz6NeA=3D=3D?= X-OriginatorOrg: corigine.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc768578-0833-48e6-7f64-08dac28dc492 X-MS-Exchange-CrossTenant-AuthSource: PH0PR13MB4842.namprd13.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Nov 2022 20:05:37.2490 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: fe128f2c-073b-4c20-818e-7246a585940c X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lbG2STsZ3QS8Pzv5EeWRegTu+l/gwbvW/a48rPIBIp37Zd7mxpm6/TwIBZp8MgogtSi97G6ZPbK35QAQE+FIKA3ZynPlF0CP983Y6Fb+ea8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR13MB5570 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Yinjun Zhang Set irq affinity to cpus that belong to the same numa node with NIC device first. Signed-off-by: Yinjun Zhang Reviewed-by: Louis Peens Reviewed-by: Niklas Söderlund Signed-off-by: Simon Horman --- drivers/net/ethernet/netronome/nfp/nfp_net_common.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c index 8c1a870bc0e5..184ffae2ac94 100644 --- a/drivers/net/ethernet/netronome/nfp/nfp_net_common.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_common.c @@ -735,8 +735,9 @@ static unsigned int nfp_net_calc_fl_bufsz_xsk(struct nfp_net_dp *dp) */ static void nfp_net_vecs_init(struct nfp_net *nn) { + int numa_node = dev_to_node(&nn->pdev->dev); struct nfp_net_r_vector *r_vec; - int r; + unsigned int r; nn->lsc_handler = nfp_net_irq_lsc; nn->exn_handler = nfp_net_irq_exn; @@ -762,7 +763,7 @@ static void nfp_net_vecs_init(struct nfp_net *nn) tasklet_disable(&r_vec->tasklet); } - cpumask_set_cpu(r, &r_vec->affinity_mask); + cpumask_set_cpu(cpumask_local_spread(r, numa_node), &r_vec->affinity_mask); } }