[v5,3/3] net/mlx5e: Improve remote NUMA preferences used for the IRQ affinity hints
Message ID | 20221021121927.2893692-4-vschneid@redhat.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp668544wrr; Fri, 21 Oct 2022 05:27:11 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5SPAGfsc7QcXjp9h6/GxB+EUfPcGsJzF/YaX+wU7kv/2KZtxm9iYgGzww+pbuX/TxkZgYG X-Received: by 2002:a05:6402:344:b0:461:7d4:9c9 with SMTP id r4-20020a056402034400b0046107d409c9mr6441973edw.141.1666355230147; Fri, 21 Oct 2022 05:27:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666355230; cv=none; d=google.com; s=arc-20160816; b=P8cl/7UHRcm+31Nc/SKE7r8cpOdp79kbnUtYPQ+t2EAvOiKM5fD/Y8C7GtZZ3JKAMO ynrgD/d4yeWURtpvBB4ee1anDTDUwXgsmLWflQr35Ka82y2ZwX2jiNwDjfHKak5FHA5h Xft0NzMK3UYW7K7MU51I9WII0isuPSEzxDiJkhzA2uQw2YhLjU8PBHx8r+/XIeBOfKe7 4jQND1ZiVjMWrIp1/xbkv27z177Rhk+icMZoe4KVxVdHnF8UnCKSF2TMwIzGiiLc2cOX LWzIDerCTQOogMnyONUbimlRrkHNgqC6ZGlTFpl3M8mriuZR2d9JCtuny64NbchRZprK u59g== 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 :dkim-signature; bh=ZYlWfxuEPmlfQeeKWpV12eLhLo6VY3G4HTuhxhAOQI8=; b=nUUMR+WSEoDJ5EzSLHnN/j3F7wwQJvmiMVZYkz4itnZzNj/1sjBIpty2a0NmKA0HeF os3S4fMzB3lx3Ge/oJ6U4rz1gtjeI7NdDHTrMRmju0zSmzSs3fBOU4Cvwy4rVrax/+6i NYUnfzb1vjSzT2AAk7WyYZs+OwXgqcezQ0iBcD+dNKJTSoFVsek8ebT8U4RXerTKsJqM uDBfEKfkW2mqEwbp8nqXYY+kCZvke0vG9Rcr+QMe3HfxSdq09Iyw81R4kO68OY+LHkQS NVj4pT/kJFpDp8YZveDXtudyqdDhJg2el0jMoeyi6JMqRUSZWZObSSuyD8WCskXCzMRs iEAQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JHWee2tZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nb21-20020a1709071c9500b007832bdf1856si20013520ejc.740.2022.10.21.05.26.43; Fri, 21 Oct 2022 05:27:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JHWee2tZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230180AbiJUMUL (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Fri, 21 Oct 2022 08:20:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45244 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229742AbiJUMUF (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 21 Oct 2022 08:20:05 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1D92B4CA2C for <linux-kernel@vger.kernel.org>; Fri, 21 Oct 2022 05:19:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666354792; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZYlWfxuEPmlfQeeKWpV12eLhLo6VY3G4HTuhxhAOQI8=; b=JHWee2tZQ+dXZ2Gvoz41KdCl3oQCToXQCIokvySec7fQbDMO8wlHQww+YCTkO75h/mqV1J wBgm0bOI6OTCPm0AXFr6CI+OJXR7XfPFJp7Dos5UcTcohzJdcpq9mkQMIC922y9hoqhDBr PdKe53MgpuNjCGEEEn0wYMOY52R7gzM= Received: from mail-qv1-f71.google.com (mail-qv1-f71.google.com [209.85.219.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-475-aimfTxy6OsKW8-948YNZ1w-1; Fri, 21 Oct 2022 08:19:51 -0400 X-MC-Unique: aimfTxy6OsKW8-948YNZ1w-1 Received: by mail-qv1-f71.google.com with SMTP id x2-20020a0cff22000000b004bb07bf7557so1501597qvt.11 for <linux-kernel@vger.kernel.org>; Fri, 21 Oct 2022 05:19:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZYlWfxuEPmlfQeeKWpV12eLhLo6VY3G4HTuhxhAOQI8=; b=OGRTowHroCwz5VUQT/4MyhN/wZpor41BXsZAeZCyY/58/YSFI275pdhJRw/DWArs1C nN0ft6rlA+0Hgp1ImS2IlCCCgHAI5vhHYBmxc8enXXa11422eVPNsqTDxznuuCiJgcW6 Qxa1dLa30UerNq8tfLxDC9RtGQrrmHVm508AGOZJYZSJZkDXiXcD9I9kgdjpjmGbzaHA A8qgrYWRrawkM/u0oO1rs/wV+7dHFakKA7MZMiJoe1T1PkFxBPD3sGnjjxAkEOkpNaWs 0AuZc02NioOgnM6PEXw1w18flMpSrwGWq+W12R4g8rP3tltmce8zQiSwJlCfa7cKxLbw taPA== X-Gm-Message-State: ACrzQf2dq2eYcWW7v9OaJjIOBPZo8Q2L4Jl8lbf0tVYy0bAVdxsnPXtn 0twF+Zj8ulLW388Q3mdWIQUTBUHYRb9Xv8Jk3uGtLiRTeRX9SvfUkfDKGfn6oli6fK4mKk/ooXp O6oNdPROHjvpNdFM8kx9BRDBb X-Received: by 2002:a05:620a:1a9c:b0:6ee:8edc:ab47 with SMTP id bl28-20020a05620a1a9c00b006ee8edcab47mr13502033qkb.575.1666354790577; Fri, 21 Oct 2022 05:19:50 -0700 (PDT) X-Received: by 2002:a05:620a:1a9c:b0:6ee:8edc:ab47 with SMTP id bl28-20020a05620a1a9c00b006ee8edcab47mr13501984qkb.575.1666354790037; Fri, 21 Oct 2022 05:19:50 -0700 (PDT) Received: from vschneid.remote.csb ([149.71.65.94]) by smtp.gmail.com with ESMTPSA id i9-20020ac85c09000000b0039a610a04b1sm8043410qti.37.2022.10.21.05.19.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Oct 2022 05:19:49 -0700 (PDT) From: Valentin Schneider <vschneid@redhat.com> To: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Tariq Toukan <tariqt@nvidia.com>, Saeed Mahameed <saeedm@nvidia.com>, Leon Romanovsky <leon@kernel.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Yury Norov <yury.norov@gmail.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Rasmus Villemoes <linux@rasmusvillemoes.dk>, Ingo Molnar <mingo@kernel.org>, Peter Zijlstra <peterz@infradead.org>, Vincent Guittot <vincent.guittot@linaro.org>, Dietmar Eggemann <dietmar.eggemann@arm.com>, Steven Rostedt <rostedt@goodmis.org>, Mel Gorman <mgorman@suse.de>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Heiko Carstens <hca@linux.ibm.com>, Tony Luck <tony.luck@intel.com>, Jonathan Cameron <Jonathan.Cameron@huawei.com>, Gal Pressman <gal@nvidia.com>, Jesse Brandeburg <jesse.brandeburg@intel.com> Subject: [PATCH v5 3/3] net/mlx5e: Improve remote NUMA preferences used for the IRQ affinity hints Date: Fri, 21 Oct 2022 13:19:27 +0100 Message-Id: <20221021121927.2893692-4-vschneid@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20221021121927.2893692-1-vschneid@redhat.com> References: <20221021121927.2893692-1-vschneid@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747300101614317372?= X-GMAIL-MSGID: =?utf-8?q?1747300101614317372?= |
Series |
sched, net: NUMA-aware CPU spreading interface
|
|
Commit Message
Valentin Schneider
Oct. 21, 2022, 12:19 p.m. UTC
From: Tariq Toukan <tariqt@nvidia.com> In the IRQ affinity hints, replace the binary NUMA preference (local / remote) with the improved for_each_numa_hop_cpu() API that minds the actual distances, so that remote NUMAs with short distance are preferred over farther ones. This has significant performance implications when using NUMA-aware allocated memory (follow [1] and derivatives for example). [1] drivers/net/ethernet/mellanox/mlx5/core/en_main.c :: mlx5e_open_channel() int cpu = cpumask_first(mlx5_comp_irq_get_affinity_mask(priv->mdev, ix)); Performance tests: TCP multi-stream, using 16 iperf3 instances pinned to 16 cores (with aRFS on). Active cores: 64,65,72,73,80,81,88,89,96,97,104,105,112,113,120,121 +-------------------------+-----------+------------------+------------------+ | | BW (Gbps) | TX side CPU util | RX side CPU util | +-------------------------+-----------+------------------+------------------+ | Baseline | 52.3 | 6.4 % | 17.9 % | +-------------------------+-----------+------------------+------------------+ | Applied on TX side only | 52.6 | 5.2 % | 18.5 % | +-------------------------+-----------+------------------+------------------+ | Applied on RX side only | 94.9 | 11.9 % | 27.2 % | +-------------------------+-----------+------------------+------------------+ | Applied on both sides | 95.1 | 8.4 % | 27.3 % | +-------------------------+-----------+------------------+------------------+ Bottleneck in RX side is released, reached linerate (~1.8x speedup). ~30% less cpu util on TX. * CPU util on active cores only. Setups details (similar for both sides): NIC: ConnectX6-DX dual port, 100 Gbps each. Single port used in the tests. $ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 256 On-line CPU(s) list: 0-255 Thread(s) per core: 2 Core(s) per socket: 64 Socket(s): 2 NUMA node(s): 16 Vendor ID: AuthenticAMD CPU family: 25 Model: 1 Model name: AMD EPYC 7763 64-Core Processor Stepping: 1 CPU MHz: 2594.804 BogoMIPS: 4890.73 Virtualization: AMD-V L1d cache: 32K L1i cache: 32K L2 cache: 512K L3 cache: 32768K NUMA node0 CPU(s): 0-7,128-135 NUMA node1 CPU(s): 8-15,136-143 NUMA node2 CPU(s): 16-23,144-151 NUMA node3 CPU(s): 24-31,152-159 NUMA node4 CPU(s): 32-39,160-167 NUMA node5 CPU(s): 40-47,168-175 NUMA node6 CPU(s): 48-55,176-183 NUMA node7 CPU(s): 56-63,184-191 NUMA node8 CPU(s): 64-71,192-199 NUMA node9 CPU(s): 72-79,200-207 NUMA node10 CPU(s): 80-87,208-215 NUMA node11 CPU(s): 88-95,216-223 NUMA node12 CPU(s): 96-103,224-231 NUMA node13 CPU(s): 104-111,232-239 NUMA node14 CPU(s): 112-119,240-247 NUMA node15 CPU(s): 120-127,248-255 .. $ numactl -H .. node distances: node 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 0: 10 11 11 11 12 12 12 12 32 32 32 32 32 32 32 32 1: 11 10 11 11 12 12 12 12 32 32 32 32 32 32 32 32 2: 11 11 10 11 12 12 12 12 32 32 32 32 32 32 32 32 3: 11 11 11 10 12 12 12 12 32 32 32 32 32 32 32 32 4: 12 12 12 12 10 11 11 11 32 32 32 32 32 32 32 32 5: 12 12 12 12 11 10 11 11 32 32 32 32 32 32 32 32 6: 12 12 12 12 11 11 10 11 32 32 32 32 32 32 32 32 7: 12 12 12 12 11 11 11 10 32 32 32 32 32 32 32 32 8: 32 32 32 32 32 32 32 32 10 11 11 11 12 12 12 12 9: 32 32 32 32 32 32 32 32 11 10 11 11 12 12 12 12 10: 32 32 32 32 32 32 32 32 11 11 10 11 12 12 12 12 11: 32 32 32 32 32 32 32 32 11 11 11 10 12 12 12 12 12: 32 32 32 32 32 32 32 32 12 12 12 12 10 11 11 11 13: 32 32 32 32 32 32 32 32 12 12 12 12 11 10 11 11 14: 32 32 32 32 32 32 32 32 12 12 12 12 11 11 10 11 15: 32 32 32 32 32 32 32 32 12 12 12 12 11 11 11 10 $ cat /sys/class/net/ens5f0/device/numa_node 14 Affinity hints (127 IRQs): Before: 331: 00000000,00000000,00000000,00000000,00010000,00000000,00000000,00000000 332: 00000000,00000000,00000000,00000000,00020000,00000000,00000000,00000000 333: 00000000,00000000,00000000,00000000,00040000,00000000,00000000,00000000 334: 00000000,00000000,00000000,00000000,00080000,00000000,00000000,00000000 335: 00000000,00000000,00000000,00000000,00100000,00000000,00000000,00000000 336: 00000000,00000000,00000000,00000000,00200000,00000000,00000000,00000000 337: 00000000,00000000,00000000,00000000,00400000,00000000,00000000,00000000 338: 00000000,00000000,00000000,00000000,00800000,00000000,00000000,00000000 339: 00010000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 340: 00020000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 341: 00040000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 342: 00080000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 343: 00100000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 344: 00200000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 345: 00400000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 346: 00800000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 347: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001 348: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000002 349: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000004 350: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000008 351: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000010 352: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000020 353: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000040 354: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000080 355: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000100 356: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000200 357: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000400 358: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000800 359: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00001000 360: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00002000 361: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00004000 362: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00008000 363: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00010000 364: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00020000 365: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00040000 366: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00080000 367: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00100000 368: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00200000 369: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00400000 370: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00800000 371: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,01000000 372: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,02000000 373: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,04000000 374: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,08000000 375: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,10000000 376: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,20000000 377: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,40000000 378: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,80000000 379: 00000000,00000000,00000000,00000000,00000000,00000000,00000001,00000000 380: 00000000,00000000,00000000,00000000,00000000,00000000,00000002,00000000 381: 00000000,00000000,00000000,00000000,00000000,00000000,00000004,00000000 382: 00000000,00000000,00000000,00000000,00000000,00000000,00000008,00000000 383: 00000000,00000000,00000000,00000000,00000000,00000000,00000010,00000000 384: 00000000,00000000,00000000,00000000,00000000,00000000,00000020,00000000 385: 00000000,00000000,00000000,00000000,00000000,00000000,00000040,00000000 386: 00000000,00000000,00000000,00000000,00000000,00000000,00000080,00000000 387: 00000000,00000000,00000000,00000000,00000000,00000000,00000100,00000000 388: 00000000,00000000,00000000,00000000,00000000,00000000,00000200,00000000 389: 00000000,00000000,00000000,00000000,00000000,00000000,00000400,00000000 390: 00000000,00000000,00000000,00000000,00000000,00000000,00000800,00000000 391: 00000000,00000000,00000000,00000000,00000000,00000000,00001000,00000000 392: 00000000,00000000,00000000,00000000,00000000,00000000,00002000,00000000 393: 00000000,00000000,00000000,00000000,00000000,00000000,00004000,00000000 394: 00000000,00000000,00000000,00000000,00000000,00000000,00008000,00000000 395: 00000000,00000000,00000000,00000000,00000000,00000000,00010000,00000000 396: 00000000,00000000,00000000,00000000,00000000,00000000,00020000,00000000 397: 00000000,00000000,00000000,00000000,00000000,00000000,00040000,00000000 398: 00000000,00000000,00000000,00000000,00000000,00000000,00080000,00000000 399: 00000000,00000000,00000000,00000000,00000000,00000000,00100000,00000000 400: 00000000,00000000,00000000,00000000,00000000,00000000,00200000,00000000 401: 00000000,00000000,00000000,00000000,00000000,00000000,00400000,00000000 402: 00000000,00000000,00000000,00000000,00000000,00000000,00800000,00000000 403: 00000000,00000000,00000000,00000000,00000000,00000000,01000000,00000000 404: 00000000,00000000,00000000,00000000,00000000,00000000,02000000,00000000 405: 00000000,00000000,00000000,00000000,00000000,00000000,04000000,00000000 406: 00000000,00000000,00000000,00000000,00000000,00000000,08000000,00000000 407: 00000000,00000000,00000000,00000000,00000000,00000000,10000000,00000000 408: 00000000,00000000,00000000,00000000,00000000,00000000,20000000,00000000 409: 00000000,00000000,00000000,00000000,00000000,00000000,40000000,00000000 410: 00000000,00000000,00000000,00000000,00000000,00000000,80000000,00000000 411: 00000000,00000000,00000000,00000000,00000000,00000001,00000000,00000000 412: 00000000,00000000,00000000,00000000,00000000,00000002,00000000,00000000 413: 00000000,00000000,00000000,00000000,00000000,00000004,00000000,00000000 414: 00000000,00000000,00000000,00000000,00000000,00000008,00000000,00000000 415: 00000000,00000000,00000000,00000000,00000000,00000010,00000000,00000000 416: 00000000,00000000,00000000,00000000,00000000,00000020,00000000,00000000 417: 00000000,00000000,00000000,00000000,00000000,00000040,00000000,00000000 418: 00000000,00000000,00000000,00000000,00000000,00000080,00000000,00000000 419: 00000000,00000000,00000000,00000000,00000000,00000100,00000000,00000000 420: 00000000,00000000,00000000,00000000,00000000,00000200,00000000,00000000 421: 00000000,00000000,00000000,00000000,00000000,00000400,00000000,00000000 422: 00000000,00000000,00000000,00000000,00000000,00000800,00000000,00000000 423: 00000000,00000000,00000000,00000000,00000000,00001000,00000000,00000000 424: 00000000,00000000,00000000,00000000,00000000,00002000,00000000,00000000 425: 00000000,00000000,00000000,00000000,00000000,00004000,00000000,00000000 426: 00000000,00000000,00000000,00000000,00000000,00008000,00000000,00000000 427: 00000000,00000000,00000000,00000000,00000000,00010000,00000000,00000000 428: 00000000,00000000,00000000,00000000,00000000,00020000,00000000,00000000 429: 00000000,00000000,00000000,00000000,00000000,00040000,00000000,00000000 430: 00000000,00000000,00000000,00000000,00000000,00080000,00000000,00000000 431: 00000000,00000000,00000000,00000000,00000000,00100000,00000000,00000000 432: 00000000,00000000,00000000,00000000,00000000,00200000,00000000,00000000 433: 00000000,00000000,00000000,00000000,00000000,00400000,00000000,00000000 434: 00000000,00000000,00000000,00000000,00000000,00800000,00000000,00000000 435: 00000000,00000000,00000000,00000000,00000000,01000000,00000000,00000000 436: 00000000,00000000,00000000,00000000,00000000,02000000,00000000,00000000 437: 00000000,00000000,00000000,00000000,00000000,04000000,00000000,00000000 438: 00000000,00000000,00000000,00000000,00000000,08000000,00000000,00000000 439: 00000000,00000000,00000000,00000000,00000000,10000000,00000000,00000000 440: 00000000,00000000,00000000,00000000,00000000,20000000,00000000,00000000 441: 00000000,00000000,00000000,00000000,00000000,40000000,00000000,00000000 442: 00000000,00000000,00000000,00000000,00000000,80000000,00000000,00000000 443: 00000000,00000000,00000000,00000000,00000001,00000000,00000000,00000000 444: 00000000,00000000,00000000,00000000,00000002,00000000,00000000,00000000 445: 00000000,00000000,00000000,00000000,00000004,00000000,00000000,00000000 446: 00000000,00000000,00000000,00000000,00000008,00000000,00000000,00000000 447: 00000000,00000000,00000000,00000000,00000010,00000000,00000000,00000000 448: 00000000,00000000,00000000,00000000,00000020,00000000,00000000,00000000 449: 00000000,00000000,00000000,00000000,00000040,00000000,00000000,00000000 450: 00000000,00000000,00000000,00000000,00000080,00000000,00000000,00000000 451: 00000000,00000000,00000000,00000000,00000100,00000000,00000000,00000000 452: 00000000,00000000,00000000,00000000,00000200,00000000,00000000,00000000 453: 00000000,00000000,00000000,00000000,00000400,00000000,00000000,00000000 454: 00000000,00000000,00000000,00000000,00000800,00000000,00000000,00000000 455: 00000000,00000000,00000000,00000000,00001000,00000000,00000000,00000000 456: 00000000,00000000,00000000,00000000,00002000,00000000,00000000,00000000 457: 00000000,00000000,00000000,00000000,00004000,00000000,00000000,00000000 After: 331: 00000000,00000000,00000000,00000000,00010000,00000000,00000000,00000000 332: 00000000,00000000,00000000,00000000,00020000,00000000,00000000,00000000 333: 00000000,00000000,00000000,00000000,00040000,00000000,00000000,00000000 334: 00000000,00000000,00000000,00000000,00080000,00000000,00000000,00000000 335: 00000000,00000000,00000000,00000000,00100000,00000000,00000000,00000000 336: 00000000,00000000,00000000,00000000,00200000,00000000,00000000,00000000 337: 00000000,00000000,00000000,00000000,00400000,00000000,00000000,00000000 338: 00000000,00000000,00000000,00000000,00800000,00000000,00000000,00000000 339: 00010000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 340: 00020000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 341: 00040000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 342: 00080000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 343: 00100000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 344: 00200000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 345: 00400000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 346: 00800000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 347: 00000000,00000000,00000000,00000000,00000001,00000000,00000000,00000000 348: 00000000,00000000,00000000,00000000,00000002,00000000,00000000,00000000 349: 00000000,00000000,00000000,00000000,00000004,00000000,00000000,00000000 350: 00000000,00000000,00000000,00000000,00000008,00000000,00000000,00000000 351: 00000000,00000000,00000000,00000000,00000010,00000000,00000000,00000000 352: 00000000,00000000,00000000,00000000,00000020,00000000,00000000,00000000 353: 00000000,00000000,00000000,00000000,00000040,00000000,00000000,00000000 354: 00000000,00000000,00000000,00000000,00000080,00000000,00000000,00000000 355: 00000000,00000000,00000000,00000000,00000100,00000000,00000000,00000000 356: 00000000,00000000,00000000,00000000,00000200,00000000,00000000,00000000 357: 00000000,00000000,00000000,00000000,00000400,00000000,00000000,00000000 358: 00000000,00000000,00000000,00000000,00000800,00000000,00000000,00000000 359: 00000000,00000000,00000000,00000000,00001000,00000000,00000000,00000000 360: 00000000,00000000,00000000,00000000,00002000,00000000,00000000,00000000 361: 00000000,00000000,00000000,00000000,00004000,00000000,00000000,00000000 362: 00000000,00000000,00000000,00000000,00008000,00000000,00000000,00000000 363: 00000000,00000000,00000000,00000000,01000000,00000000,00000000,00000000 364: 00000000,00000000,00000000,00000000,02000000,00000000,00000000,00000000 365: 00000000,00000000,00000000,00000000,04000000,00000000,00000000,00000000 366: 00000000,00000000,00000000,00000000,08000000,00000000,00000000,00000000 367: 00000000,00000000,00000000,00000000,10000000,00000000,00000000,00000000 368: 00000000,00000000,00000000,00000000,20000000,00000000,00000000,00000000 369: 00000000,00000000,00000000,00000000,40000000,00000000,00000000,00000000 370: 00000000,00000000,00000000,00000000,80000000,00000000,00000000,00000000 371: 00000001,00000000,00000000,00000000,00000000,00000000,00000000,00000000 372: 00000002,00000000,00000000,00000000,00000000,00000000,00000000,00000000 373: 00000004,00000000,00000000,00000000,00000000,00000000,00000000,00000000 374: 00000008,00000000,00000000,00000000,00000000,00000000,00000000,00000000 375: 00000010,00000000,00000000,00000000,00000000,00000000,00000000,00000000 376: 00000020,00000000,00000000,00000000,00000000,00000000,00000000,00000000 377: 00000040,00000000,00000000,00000000,00000000,00000000,00000000,00000000 378: 00000080,00000000,00000000,00000000,00000000,00000000,00000000,00000000 379: 00000100,00000000,00000000,00000000,00000000,00000000,00000000,00000000 380: 00000200,00000000,00000000,00000000,00000000,00000000,00000000,00000000 381: 00000400,00000000,00000000,00000000,00000000,00000000,00000000,00000000 382: 00000800,00000000,00000000,00000000,00000000,00000000,00000000,00000000 383: 00001000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 384: 00002000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 385: 00004000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 386: 00008000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 387: 01000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 388: 02000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 389: 04000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 390: 08000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 391: 10000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 392: 20000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 393: 40000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 394: 80000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 395: 00000000,00000000,00000000,00000000,00000000,00000001,00000000,00000000 396: 00000000,00000000,00000000,00000000,00000000,00000002,00000000,00000000 397: 00000000,00000000,00000000,00000000,00000000,00000004,00000000,00000000 398: 00000000,00000000,00000000,00000000,00000000,00000008,00000000,00000000 399: 00000000,00000000,00000000,00000000,00000000,00000010,00000000,00000000 400: 00000000,00000000,00000000,00000000,00000000,00000020,00000000,00000000 401: 00000000,00000000,00000000,00000000,00000000,00000040,00000000,00000000 402: 00000000,00000000,00000000,00000000,00000000,00000080,00000000,00000000 403: 00000000,00000000,00000000,00000000,00000000,00000100,00000000,00000000 404: 00000000,00000000,00000000,00000000,00000000,00000200,00000000,00000000 405: 00000000,00000000,00000000,00000000,00000000,00000400,00000000,00000000 406: 00000000,00000000,00000000,00000000,00000000,00000800,00000000,00000000 407: 00000000,00000000,00000000,00000000,00000000,00001000,00000000,00000000 408: 00000000,00000000,00000000,00000000,00000000,00002000,00000000,00000000 409: 00000000,00000000,00000000,00000000,00000000,00004000,00000000,00000000 410: 00000000,00000000,00000000,00000000,00000000,00008000,00000000,00000000 411: 00000000,00000000,00000000,00000000,00000000,00010000,00000000,00000000 412: 00000000,00000000,00000000,00000000,00000000,00020000,00000000,00000000 413: 00000000,00000000,00000000,00000000,00000000,00040000,00000000,00000000 414: 00000000,00000000,00000000,00000000,00000000,00080000,00000000,00000000 415: 00000000,00000000,00000000,00000000,00000000,00100000,00000000,00000000 416: 00000000,00000000,00000000,00000000,00000000,00200000,00000000,00000000 417: 00000000,00000000,00000000,00000000,00000000,00400000,00000000,00000000 418: 00000000,00000000,00000000,00000000,00000000,00800000,00000000,00000000 419: 00000000,00000000,00000000,00000000,00000000,01000000,00000000,00000000 420: 00000000,00000000,00000000,00000000,00000000,02000000,00000000,00000000 421: 00000000,00000000,00000000,00000000,00000000,04000000,00000000,00000000 422: 00000000,00000000,00000000,00000000,00000000,08000000,00000000,00000000 423: 00000000,00000000,00000000,00000000,00000000,10000000,00000000,00000000 424: 00000000,00000000,00000000,00000000,00000000,20000000,00000000,00000000 425: 00000000,00000000,00000000,00000000,00000000,40000000,00000000,00000000 426: 00000000,00000000,00000000,00000000,00000000,80000000,00000000,00000000 427: 00000000,00000001,00000000,00000000,00000000,00000000,00000000,00000000 428: 00000000,00000002,00000000,00000000,00000000,00000000,00000000,00000000 429: 00000000,00000004,00000000,00000000,00000000,00000000,00000000,00000000 430: 00000000,00000008,00000000,00000000,00000000,00000000,00000000,00000000 431: 00000000,00000010,00000000,00000000,00000000,00000000,00000000,00000000 432: 00000000,00000020,00000000,00000000,00000000,00000000,00000000,00000000 433: 00000000,00000040,00000000,00000000,00000000,00000000,00000000,00000000 434: 00000000,00000080,00000000,00000000,00000000,00000000,00000000,00000000 435: 00000000,00000100,00000000,00000000,00000000,00000000,00000000,00000000 436: 00000000,00000200,00000000,00000000,00000000,00000000,00000000,00000000 437: 00000000,00000400,00000000,00000000,00000000,00000000,00000000,00000000 438: 00000000,00000800,00000000,00000000,00000000,00000000,00000000,00000000 439: 00000000,00001000,00000000,00000000,00000000,00000000,00000000,00000000 440: 00000000,00002000,00000000,00000000,00000000,00000000,00000000,00000000 441: 00000000,00004000,00000000,00000000,00000000,00000000,00000000,00000000 442: 00000000,00008000,00000000,00000000,00000000,00000000,00000000,00000000 443: 00000000,00010000,00000000,00000000,00000000,00000000,00000000,00000000 444: 00000000,00020000,00000000,00000000,00000000,00000000,00000000,00000000 445: 00000000,00040000,00000000,00000000,00000000,00000000,00000000,00000000 446: 00000000,00080000,00000000,00000000,00000000,00000000,00000000,00000000 447: 00000000,00100000,00000000,00000000,00000000,00000000,00000000,00000000 448: 00000000,00200000,00000000,00000000,00000000,00000000,00000000,00000000 449: 00000000,00400000,00000000,00000000,00000000,00000000,00000000,00000000 450: 00000000,00800000,00000000,00000000,00000000,00000000,00000000,00000000 451: 00000000,01000000,00000000,00000000,00000000,00000000,00000000,00000000 452: 00000000,02000000,00000000,00000000,00000000,00000000,00000000,00000000 453: 00000000,04000000,00000000,00000000,00000000,00000000,00000000,00000000 454: 00000000,08000000,00000000,00000000,00000000,00000000,00000000,00000000 455: 00000000,10000000,00000000,00000000,00000000,00000000,00000000,00000000 456: 00000000,20000000,00000000,00000000,00000000,00000000,00000000,00000000 457: 00000000,40000000,00000000,00000000,00000000,00000000,00000000,00000000 Signed-off-by: Tariq Toukan <tariqt@nvidia.com> [Tweaked API use] Signed-off-by: Valentin Schneider <vschneid@redhat.com> --- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-)
Comments
On 10/21/2022 3:19 PM, Valentin Schneider wrote: > From: Tariq Toukan <tariqt@nvidia.com> > > In the IRQ affinity hints, replace the binary NUMA preference (local / > remote) with the improved for_each_numa_hop_cpu() API that minds the > actual distances, so that remote NUMAs with short distance are preferred > over farther ones. > > This has significant performance implications when using NUMA-aware > allocated memory (follow [1] and derivatives for example). > > [1] > drivers/net/ethernet/mellanox/mlx5/core/en_main.c :: mlx5e_open_channel() > int cpu = cpumask_first(mlx5_comp_irq_get_affinity_mask(priv->mdev, ix)); > > Performance tests: > > TCP multi-stream, using 16 iperf3 instances pinned to 16 cores (with aRFS on). > Active cores: 64,65,72,73,80,81,88,89,96,97,104,105,112,113,120,121 > > +-------------------------+-----------+------------------+------------------+ > | | BW (Gbps) | TX side CPU util | RX side CPU util | > +-------------------------+-----------+------------------+------------------+ > | Baseline | 52.3 | 6.4 % | 17.9 % | > +-------------------------+-----------+------------------+------------------+ > | Applied on TX side only | 52.6 | 5.2 % | 18.5 % | > +-------------------------+-----------+------------------+------------------+ > | Applied on RX side only | 94.9 | 11.9 % | 27.2 % | > +-------------------------+-----------+------------------+------------------+ > | Applied on both sides | 95.1 | 8.4 % | 27.3 % | > +-------------------------+-----------+------------------+------------------+ > > Bottleneck in RX side is released, reached linerate (~1.8x speedup). > ~30% less cpu util on TX. > > * CPU util on active cores only. > > Setups details (similar for both sides): > > NIC: ConnectX6-DX dual port, 100 Gbps each. > Single port used in the tests. > > $ lscpu > Architecture: x86_64 > CPU op-mode(s): 32-bit, 64-bit > Byte Order: Little Endian > CPU(s): 256 > On-line CPU(s) list: 0-255 > Thread(s) per core: 2 > Core(s) per socket: 64 > Socket(s): 2 > NUMA node(s): 16 > Vendor ID: AuthenticAMD > CPU family: 25 > Model: 1 > Model name: AMD EPYC 7763 64-Core Processor > Stepping: 1 > CPU MHz: 2594.804 > BogoMIPS: 4890.73 > Virtualization: AMD-V > L1d cache: 32K > L1i cache: 32K > L2 cache: 512K > L3 cache: 32768K > NUMA node0 CPU(s): 0-7,128-135 > NUMA node1 CPU(s): 8-15,136-143 > NUMA node2 CPU(s): 16-23,144-151 > NUMA node3 CPU(s): 24-31,152-159 > NUMA node4 CPU(s): 32-39,160-167 > NUMA node5 CPU(s): 40-47,168-175 > NUMA node6 CPU(s): 48-55,176-183 > NUMA node7 CPU(s): 56-63,184-191 > NUMA node8 CPU(s): 64-71,192-199 > NUMA node9 CPU(s): 72-79,200-207 > NUMA node10 CPU(s): 80-87,208-215 > NUMA node11 CPU(s): 88-95,216-223 > NUMA node12 CPU(s): 96-103,224-231 > NUMA node13 CPU(s): 104-111,232-239 > NUMA node14 CPU(s): 112-119,240-247 > NUMA node15 CPU(s): 120-127,248-255 > .. ... > > Signed-off-by: Tariq Toukan <tariqt@nvidia.com> > [Tweaked API use] Thanks for your modification. It looks good to me. Signed-off-by: Tariq Toukan <tariqt@nvidia.com> > Signed-off-by: Valentin Schneider <vschneid@redhat.com> > --- > drivers/net/ethernet/mellanox/mlx5/core/eq.c | 18 ++++++++++++++++-- > 1 file changed, 16 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c > index a0242dc15741c..7acbeb3d51846 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c > @@ -812,9 +812,12 @@ static void comp_irqs_release(struct mlx5_core_dev *dev) > static int comp_irqs_request(struct mlx5_core_dev *dev) > { > struct mlx5_eq_table *table = dev->priv.eq_table; > + const struct cpumask *prev = cpu_none_mask; > + const struct cpumask *mask; > int ncomp_eqs = table->num_comp_eqs; > u16 *cpus; > int ret; > + int cpu; > int i; > > ncomp_eqs = table->num_comp_eqs; > @@ -833,8 +836,19 @@ static int comp_irqs_request(struct mlx5_core_dev *dev) > ret = -ENOMEM; > goto free_irqs; > } > - for (i = 0; i < ncomp_eqs; i++) > - cpus[i] = cpumask_local_spread(i, dev->priv.numa_node); > + > + i = 0; > + rcu_read_lock(); > + for_each_numa_hop_mask(mask, dev->priv.numa_node) { > + for_each_cpu_andnot(cpu, mask, prev) { > + cpus[i] = cpu; > + if (++i == ncomp_eqs) > + goto spread_done; > + } > + prev = mask; > + } > +spread_done: > + rcu_read_unlock(); > ret = mlx5_irqs_request_vectors(dev, cpus, ncomp_eqs, table->comp_irqs); > kfree(cpus); > if (ret < 0)
On Fri, Oct 21, 2022 at 01:19:27PM +0100, Valentin Schneider wrote: > From: Tariq Toukan <tariqt@nvidia.com> > > In the IRQ affinity hints, replace the binary NUMA preference (local / > remote) with the improved for_each_numa_hop_cpu() API that minds the > actual distances, so that remote NUMAs with short distance are preferred > over farther ones. > > This has significant performance implications when using NUMA-aware > allocated memory (follow [1] and derivatives for example). > > [1] > drivers/net/ethernet/mellanox/mlx5/core/en_main.c :: mlx5e_open_channel() > int cpu = cpumask_first(mlx5_comp_irq_get_affinity_mask(priv->mdev, ix)); > > Performance tests: > > TCP multi-stream, using 16 iperf3 instances pinned to 16 cores (with aRFS on). > Active cores: 64,65,72,73,80,81,88,89,96,97,104,105,112,113,120,121 > > +-------------------------+-----------+------------------+------------------+ > | | BW (Gbps) | TX side CPU util | RX side CPU util | > +-------------------------+-----------+------------------+------------------+ > | Baseline | 52.3 | 6.4 % | 17.9 % | > +-------------------------+-----------+------------------+------------------+ > | Applied on TX side only | 52.6 | 5.2 % | 18.5 % | > +-------------------------+-----------+------------------+------------------+ > | Applied on RX side only | 94.9 | 11.9 % | 27.2 % | > +-------------------------+-----------+------------------+------------------+ > | Applied on both sides | 95.1 | 8.4 % | 27.3 % | > +-------------------------+-----------+------------------+------------------+ > > Bottleneck in RX side is released, reached linerate (~1.8x speedup). > ~30% less cpu util on TX. > > * CPU util on active cores only. > > Setups details (similar for both sides): > > NIC: ConnectX6-DX dual port, 100 Gbps each. > Single port used in the tests. > > $ lscpu > Architecture: x86_64 > CPU op-mode(s): 32-bit, 64-bit > Byte Order: Little Endian > CPU(s): 256 > On-line CPU(s) list: 0-255 > Thread(s) per core: 2 > Core(s) per socket: 64 > Socket(s): 2 > NUMA node(s): 16 > Vendor ID: AuthenticAMD > CPU family: 25 > Model: 1 > Model name: AMD EPYC 7763 64-Core Processor > Stepping: 1 > CPU MHz: 2594.804 > BogoMIPS: 4890.73 > Virtualization: AMD-V > L1d cache: 32K > L1i cache: 32K > L2 cache: 512K > L3 cache: 32768K > NUMA node0 CPU(s): 0-7,128-135 > NUMA node1 CPU(s): 8-15,136-143 > NUMA node2 CPU(s): 16-23,144-151 > NUMA node3 CPU(s): 24-31,152-159 > NUMA node4 CPU(s): 32-39,160-167 > NUMA node5 CPU(s): 40-47,168-175 > NUMA node6 CPU(s): 48-55,176-183 > NUMA node7 CPU(s): 56-63,184-191 > NUMA node8 CPU(s): 64-71,192-199 > NUMA node9 CPU(s): 72-79,200-207 > NUMA node10 CPU(s): 80-87,208-215 > NUMA node11 CPU(s): 88-95,216-223 > NUMA node12 CPU(s): 96-103,224-231 > NUMA node13 CPU(s): 104-111,232-239 > NUMA node14 CPU(s): 112-119,240-247 > NUMA node15 CPU(s): 120-127,248-255 > .. > > $ numactl -H > .. > node distances: > node 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 > 0: 10 11 11 11 12 12 12 12 32 32 32 32 32 32 32 32 > 1: 11 10 11 11 12 12 12 12 32 32 32 32 32 32 32 32 > 2: 11 11 10 11 12 12 12 12 32 32 32 32 32 32 32 32 > 3: 11 11 11 10 12 12 12 12 32 32 32 32 32 32 32 32 > 4: 12 12 12 12 10 11 11 11 32 32 32 32 32 32 32 32 > 5: 12 12 12 12 11 10 11 11 32 32 32 32 32 32 32 32 > 6: 12 12 12 12 11 11 10 11 32 32 32 32 32 32 32 32 > 7: 12 12 12 12 11 11 11 10 32 32 32 32 32 32 32 32 > 8: 32 32 32 32 32 32 32 32 10 11 11 11 12 12 12 12 > 9: 32 32 32 32 32 32 32 32 11 10 11 11 12 12 12 12 > 10: 32 32 32 32 32 32 32 32 11 11 10 11 12 12 12 12 > 11: 32 32 32 32 32 32 32 32 11 11 11 10 12 12 12 12 > 12: 32 32 32 32 32 32 32 32 12 12 12 12 10 11 11 11 > 13: 32 32 32 32 32 32 32 32 12 12 12 12 11 10 11 11 > 14: 32 32 32 32 32 32 32 32 12 12 12 12 11 11 10 11 > 15: 32 32 32 32 32 32 32 32 12 12 12 12 11 11 11 10 > > $ cat /sys/class/net/ens5f0/device/numa_node > 14 > > Affinity hints (127 IRQs): > Before: > 331: 00000000,00000000,00000000,00000000,00010000,00000000,00000000,00000000 > 332: 00000000,00000000,00000000,00000000,00020000,00000000,00000000,00000000 > 333: 00000000,00000000,00000000,00000000,00040000,00000000,00000000,00000000 > 334: 00000000,00000000,00000000,00000000,00080000,00000000,00000000,00000000 > 335: 00000000,00000000,00000000,00000000,00100000,00000000,00000000,00000000 > 336: 00000000,00000000,00000000,00000000,00200000,00000000,00000000,00000000 > 337: 00000000,00000000,00000000,00000000,00400000,00000000,00000000,00000000 > 338: 00000000,00000000,00000000,00000000,00800000,00000000,00000000,00000000 > 339: 00010000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 340: 00020000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 341: 00040000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 342: 00080000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 343: 00100000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 344: 00200000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 345: 00400000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 346: 00800000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 347: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000001 > 348: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000002 > 349: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000004 > 350: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000008 > 351: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000010 > 352: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000020 > 353: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000040 > 354: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000080 > 355: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000100 > 356: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000200 > 357: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000400 > 358: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00000800 > 359: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00001000 > 360: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00002000 > 361: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00004000 > 362: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00008000 > 363: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00010000 > 364: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00020000 > 365: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00040000 > 366: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00080000 > 367: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00100000 > 368: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00200000 > 369: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00400000 > 370: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,00800000 > 371: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,01000000 > 372: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,02000000 > 373: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,04000000 > 374: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,08000000 > 375: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,10000000 > 376: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,20000000 > 377: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,40000000 > 378: 00000000,00000000,00000000,00000000,00000000,00000000,00000000,80000000 > 379: 00000000,00000000,00000000,00000000,00000000,00000000,00000001,00000000 > 380: 00000000,00000000,00000000,00000000,00000000,00000000,00000002,00000000 > 381: 00000000,00000000,00000000,00000000,00000000,00000000,00000004,00000000 > 382: 00000000,00000000,00000000,00000000,00000000,00000000,00000008,00000000 > 383: 00000000,00000000,00000000,00000000,00000000,00000000,00000010,00000000 > 384: 00000000,00000000,00000000,00000000,00000000,00000000,00000020,00000000 > 385: 00000000,00000000,00000000,00000000,00000000,00000000,00000040,00000000 > 386: 00000000,00000000,00000000,00000000,00000000,00000000,00000080,00000000 > 387: 00000000,00000000,00000000,00000000,00000000,00000000,00000100,00000000 > 388: 00000000,00000000,00000000,00000000,00000000,00000000,00000200,00000000 > 389: 00000000,00000000,00000000,00000000,00000000,00000000,00000400,00000000 > 390: 00000000,00000000,00000000,00000000,00000000,00000000,00000800,00000000 > 391: 00000000,00000000,00000000,00000000,00000000,00000000,00001000,00000000 > 392: 00000000,00000000,00000000,00000000,00000000,00000000,00002000,00000000 > 393: 00000000,00000000,00000000,00000000,00000000,00000000,00004000,00000000 > 394: 00000000,00000000,00000000,00000000,00000000,00000000,00008000,00000000 > 395: 00000000,00000000,00000000,00000000,00000000,00000000,00010000,00000000 > 396: 00000000,00000000,00000000,00000000,00000000,00000000,00020000,00000000 > 397: 00000000,00000000,00000000,00000000,00000000,00000000,00040000,00000000 > 398: 00000000,00000000,00000000,00000000,00000000,00000000,00080000,00000000 > 399: 00000000,00000000,00000000,00000000,00000000,00000000,00100000,00000000 > 400: 00000000,00000000,00000000,00000000,00000000,00000000,00200000,00000000 > 401: 00000000,00000000,00000000,00000000,00000000,00000000,00400000,00000000 > 402: 00000000,00000000,00000000,00000000,00000000,00000000,00800000,00000000 > 403: 00000000,00000000,00000000,00000000,00000000,00000000,01000000,00000000 > 404: 00000000,00000000,00000000,00000000,00000000,00000000,02000000,00000000 > 405: 00000000,00000000,00000000,00000000,00000000,00000000,04000000,00000000 > 406: 00000000,00000000,00000000,00000000,00000000,00000000,08000000,00000000 > 407: 00000000,00000000,00000000,00000000,00000000,00000000,10000000,00000000 > 408: 00000000,00000000,00000000,00000000,00000000,00000000,20000000,00000000 > 409: 00000000,00000000,00000000,00000000,00000000,00000000,40000000,00000000 > 410: 00000000,00000000,00000000,00000000,00000000,00000000,80000000,00000000 > 411: 00000000,00000000,00000000,00000000,00000000,00000001,00000000,00000000 > 412: 00000000,00000000,00000000,00000000,00000000,00000002,00000000,00000000 > 413: 00000000,00000000,00000000,00000000,00000000,00000004,00000000,00000000 > 414: 00000000,00000000,00000000,00000000,00000000,00000008,00000000,00000000 > 415: 00000000,00000000,00000000,00000000,00000000,00000010,00000000,00000000 > 416: 00000000,00000000,00000000,00000000,00000000,00000020,00000000,00000000 > 417: 00000000,00000000,00000000,00000000,00000000,00000040,00000000,00000000 > 418: 00000000,00000000,00000000,00000000,00000000,00000080,00000000,00000000 > 419: 00000000,00000000,00000000,00000000,00000000,00000100,00000000,00000000 > 420: 00000000,00000000,00000000,00000000,00000000,00000200,00000000,00000000 > 421: 00000000,00000000,00000000,00000000,00000000,00000400,00000000,00000000 > 422: 00000000,00000000,00000000,00000000,00000000,00000800,00000000,00000000 > 423: 00000000,00000000,00000000,00000000,00000000,00001000,00000000,00000000 > 424: 00000000,00000000,00000000,00000000,00000000,00002000,00000000,00000000 > 425: 00000000,00000000,00000000,00000000,00000000,00004000,00000000,00000000 > 426: 00000000,00000000,00000000,00000000,00000000,00008000,00000000,00000000 > 427: 00000000,00000000,00000000,00000000,00000000,00010000,00000000,00000000 > 428: 00000000,00000000,00000000,00000000,00000000,00020000,00000000,00000000 > 429: 00000000,00000000,00000000,00000000,00000000,00040000,00000000,00000000 > 430: 00000000,00000000,00000000,00000000,00000000,00080000,00000000,00000000 > 431: 00000000,00000000,00000000,00000000,00000000,00100000,00000000,00000000 > 432: 00000000,00000000,00000000,00000000,00000000,00200000,00000000,00000000 > 433: 00000000,00000000,00000000,00000000,00000000,00400000,00000000,00000000 > 434: 00000000,00000000,00000000,00000000,00000000,00800000,00000000,00000000 > 435: 00000000,00000000,00000000,00000000,00000000,01000000,00000000,00000000 > 436: 00000000,00000000,00000000,00000000,00000000,02000000,00000000,00000000 > 437: 00000000,00000000,00000000,00000000,00000000,04000000,00000000,00000000 > 438: 00000000,00000000,00000000,00000000,00000000,08000000,00000000,00000000 > 439: 00000000,00000000,00000000,00000000,00000000,10000000,00000000,00000000 > 440: 00000000,00000000,00000000,00000000,00000000,20000000,00000000,00000000 > 441: 00000000,00000000,00000000,00000000,00000000,40000000,00000000,00000000 > 442: 00000000,00000000,00000000,00000000,00000000,80000000,00000000,00000000 > 443: 00000000,00000000,00000000,00000000,00000001,00000000,00000000,00000000 > 444: 00000000,00000000,00000000,00000000,00000002,00000000,00000000,00000000 > 445: 00000000,00000000,00000000,00000000,00000004,00000000,00000000,00000000 > 446: 00000000,00000000,00000000,00000000,00000008,00000000,00000000,00000000 > 447: 00000000,00000000,00000000,00000000,00000010,00000000,00000000,00000000 > 448: 00000000,00000000,00000000,00000000,00000020,00000000,00000000,00000000 > 449: 00000000,00000000,00000000,00000000,00000040,00000000,00000000,00000000 > 450: 00000000,00000000,00000000,00000000,00000080,00000000,00000000,00000000 > 451: 00000000,00000000,00000000,00000000,00000100,00000000,00000000,00000000 > 452: 00000000,00000000,00000000,00000000,00000200,00000000,00000000,00000000 > 453: 00000000,00000000,00000000,00000000,00000400,00000000,00000000,00000000 > 454: 00000000,00000000,00000000,00000000,00000800,00000000,00000000,00000000 > 455: 00000000,00000000,00000000,00000000,00001000,00000000,00000000,00000000 > 456: 00000000,00000000,00000000,00000000,00002000,00000000,00000000,00000000 > 457: 00000000,00000000,00000000,00000000,00004000,00000000,00000000,00000000 > > After: > 331: 00000000,00000000,00000000,00000000,00010000,00000000,00000000,00000000 > 332: 00000000,00000000,00000000,00000000,00020000,00000000,00000000,00000000 > 333: 00000000,00000000,00000000,00000000,00040000,00000000,00000000,00000000 > 334: 00000000,00000000,00000000,00000000,00080000,00000000,00000000,00000000 > 335: 00000000,00000000,00000000,00000000,00100000,00000000,00000000,00000000 > 336: 00000000,00000000,00000000,00000000,00200000,00000000,00000000,00000000 > 337: 00000000,00000000,00000000,00000000,00400000,00000000,00000000,00000000 > 338: 00000000,00000000,00000000,00000000,00800000,00000000,00000000,00000000 > 339: 00010000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 340: 00020000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 341: 00040000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 342: 00080000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 343: 00100000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 344: 00200000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 345: 00400000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 346: 00800000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 347: 00000000,00000000,00000000,00000000,00000001,00000000,00000000,00000000 > 348: 00000000,00000000,00000000,00000000,00000002,00000000,00000000,00000000 > 349: 00000000,00000000,00000000,00000000,00000004,00000000,00000000,00000000 > 350: 00000000,00000000,00000000,00000000,00000008,00000000,00000000,00000000 > 351: 00000000,00000000,00000000,00000000,00000010,00000000,00000000,00000000 > 352: 00000000,00000000,00000000,00000000,00000020,00000000,00000000,00000000 > 353: 00000000,00000000,00000000,00000000,00000040,00000000,00000000,00000000 > 354: 00000000,00000000,00000000,00000000,00000080,00000000,00000000,00000000 > 355: 00000000,00000000,00000000,00000000,00000100,00000000,00000000,00000000 > 356: 00000000,00000000,00000000,00000000,00000200,00000000,00000000,00000000 > 357: 00000000,00000000,00000000,00000000,00000400,00000000,00000000,00000000 > 358: 00000000,00000000,00000000,00000000,00000800,00000000,00000000,00000000 > 359: 00000000,00000000,00000000,00000000,00001000,00000000,00000000,00000000 > 360: 00000000,00000000,00000000,00000000,00002000,00000000,00000000,00000000 > 361: 00000000,00000000,00000000,00000000,00004000,00000000,00000000,00000000 > 362: 00000000,00000000,00000000,00000000,00008000,00000000,00000000,00000000 > 363: 00000000,00000000,00000000,00000000,01000000,00000000,00000000,00000000 > 364: 00000000,00000000,00000000,00000000,02000000,00000000,00000000,00000000 > 365: 00000000,00000000,00000000,00000000,04000000,00000000,00000000,00000000 > 366: 00000000,00000000,00000000,00000000,08000000,00000000,00000000,00000000 > 367: 00000000,00000000,00000000,00000000,10000000,00000000,00000000,00000000 > 368: 00000000,00000000,00000000,00000000,20000000,00000000,00000000,00000000 > 369: 00000000,00000000,00000000,00000000,40000000,00000000,00000000,00000000 > 370: 00000000,00000000,00000000,00000000,80000000,00000000,00000000,00000000 > 371: 00000001,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 372: 00000002,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 373: 00000004,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 374: 00000008,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 375: 00000010,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 376: 00000020,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 377: 00000040,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 378: 00000080,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 379: 00000100,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 380: 00000200,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 381: 00000400,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 382: 00000800,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 383: 00001000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 384: 00002000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 385: 00004000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 386: 00008000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 387: 01000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 388: 02000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 389: 04000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 390: 08000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 391: 10000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 392: 20000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 393: 40000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 394: 80000000,00000000,00000000,00000000,00000000,00000000,00000000,00000000 > 395: 00000000,00000000,00000000,00000000,00000000,00000001,00000000,00000000 > 396: 00000000,00000000,00000000,00000000,00000000,00000002,00000000,00000000 > 397: 00000000,00000000,00000000,00000000,00000000,00000004,00000000,00000000 > 398: 00000000,00000000,00000000,00000000,00000000,00000008,00000000,00000000 > 399: 00000000,00000000,00000000,00000000,00000000,00000010,00000000,00000000 > 400: 00000000,00000000,00000000,00000000,00000000,00000020,00000000,00000000 > 401: 00000000,00000000,00000000,00000000,00000000,00000040,00000000,00000000 > 402: 00000000,00000000,00000000,00000000,00000000,00000080,00000000,00000000 > 403: 00000000,00000000,00000000,00000000,00000000,00000100,00000000,00000000 > 404: 00000000,00000000,00000000,00000000,00000000,00000200,00000000,00000000 > 405: 00000000,00000000,00000000,00000000,00000000,00000400,00000000,00000000 > 406: 00000000,00000000,00000000,00000000,00000000,00000800,00000000,00000000 > 407: 00000000,00000000,00000000,00000000,00000000,00001000,00000000,00000000 > 408: 00000000,00000000,00000000,00000000,00000000,00002000,00000000,00000000 > 409: 00000000,00000000,00000000,00000000,00000000,00004000,00000000,00000000 > 410: 00000000,00000000,00000000,00000000,00000000,00008000,00000000,00000000 > 411: 00000000,00000000,00000000,00000000,00000000,00010000,00000000,00000000 > 412: 00000000,00000000,00000000,00000000,00000000,00020000,00000000,00000000 > 413: 00000000,00000000,00000000,00000000,00000000,00040000,00000000,00000000 > 414: 00000000,00000000,00000000,00000000,00000000,00080000,00000000,00000000 > 415: 00000000,00000000,00000000,00000000,00000000,00100000,00000000,00000000 > 416: 00000000,00000000,00000000,00000000,00000000,00200000,00000000,00000000 > 417: 00000000,00000000,00000000,00000000,00000000,00400000,00000000,00000000 > 418: 00000000,00000000,00000000,00000000,00000000,00800000,00000000,00000000 > 419: 00000000,00000000,00000000,00000000,00000000,01000000,00000000,00000000 > 420: 00000000,00000000,00000000,00000000,00000000,02000000,00000000,00000000 > 421: 00000000,00000000,00000000,00000000,00000000,04000000,00000000,00000000 > 422: 00000000,00000000,00000000,00000000,00000000,08000000,00000000,00000000 > 423: 00000000,00000000,00000000,00000000,00000000,10000000,00000000,00000000 > 424: 00000000,00000000,00000000,00000000,00000000,20000000,00000000,00000000 > 425: 00000000,00000000,00000000,00000000,00000000,40000000,00000000,00000000 > 426: 00000000,00000000,00000000,00000000,00000000,80000000,00000000,00000000 > 427: 00000000,00000001,00000000,00000000,00000000,00000000,00000000,00000000 > 428: 00000000,00000002,00000000,00000000,00000000,00000000,00000000,00000000 > 429: 00000000,00000004,00000000,00000000,00000000,00000000,00000000,00000000 > 430: 00000000,00000008,00000000,00000000,00000000,00000000,00000000,00000000 > 431: 00000000,00000010,00000000,00000000,00000000,00000000,00000000,00000000 > 432: 00000000,00000020,00000000,00000000,00000000,00000000,00000000,00000000 > 433: 00000000,00000040,00000000,00000000,00000000,00000000,00000000,00000000 > 434: 00000000,00000080,00000000,00000000,00000000,00000000,00000000,00000000 > 435: 00000000,00000100,00000000,00000000,00000000,00000000,00000000,00000000 > 436: 00000000,00000200,00000000,00000000,00000000,00000000,00000000,00000000 > 437: 00000000,00000400,00000000,00000000,00000000,00000000,00000000,00000000 > 438: 00000000,00000800,00000000,00000000,00000000,00000000,00000000,00000000 > 439: 00000000,00001000,00000000,00000000,00000000,00000000,00000000,00000000 > 440: 00000000,00002000,00000000,00000000,00000000,00000000,00000000,00000000 > 441: 00000000,00004000,00000000,00000000,00000000,00000000,00000000,00000000 > 442: 00000000,00008000,00000000,00000000,00000000,00000000,00000000,00000000 > 443: 00000000,00010000,00000000,00000000,00000000,00000000,00000000,00000000 > 444: 00000000,00020000,00000000,00000000,00000000,00000000,00000000,00000000 > 445: 00000000,00040000,00000000,00000000,00000000,00000000,00000000,00000000 > 446: 00000000,00080000,00000000,00000000,00000000,00000000,00000000,00000000 > 447: 00000000,00100000,00000000,00000000,00000000,00000000,00000000,00000000 > 448: 00000000,00200000,00000000,00000000,00000000,00000000,00000000,00000000 > 449: 00000000,00400000,00000000,00000000,00000000,00000000,00000000,00000000 > 450: 00000000,00800000,00000000,00000000,00000000,00000000,00000000,00000000 > 451: 00000000,01000000,00000000,00000000,00000000,00000000,00000000,00000000 > 452: 00000000,02000000,00000000,00000000,00000000,00000000,00000000,00000000 > 453: 00000000,04000000,00000000,00000000,00000000,00000000,00000000,00000000 > 454: 00000000,08000000,00000000,00000000,00000000,00000000,00000000,00000000 > 455: 00000000,10000000,00000000,00000000,00000000,00000000,00000000,00000000 > 456: 00000000,20000000,00000000,00000000,00000000,00000000,00000000,00000000 > 457: 00000000,40000000,00000000,00000000,00000000,00000000,00000000,00000000 > > Signed-off-by: Tariq Toukan <tariqt@nvidia.com> > [Tweaked API use] > Signed-off-by: Valentin Schneider <vschneid@redhat.com> > --- > drivers/net/ethernet/mellanox/mlx5/core/eq.c | 18 ++++++++++++++++-- > 1 file changed, 16 insertions(+), 2 deletions(-) > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c > index a0242dc15741c..7acbeb3d51846 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c > +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c > @@ -812,9 +812,12 @@ static void comp_irqs_release(struct mlx5_core_dev *dev) > static int comp_irqs_request(struct mlx5_core_dev *dev) > { > struct mlx5_eq_table *table = dev->priv.eq_table; > + const struct cpumask *prev = cpu_none_mask; > + const struct cpumask *mask; > int ncomp_eqs = table->num_comp_eqs; > u16 *cpus; > int ret; > + int cpu; > int i; > > ncomp_eqs = table->num_comp_eqs; > @@ -833,8 +836,19 @@ static int comp_irqs_request(struct mlx5_core_dev *dev) > ret = -ENOMEM; > goto free_irqs; > } > - for (i = 0; i < ncomp_eqs; i++) > - cpus[i] = cpumask_local_spread(i, dev->priv.numa_node); > + > + i = 0; > + rcu_read_lock(); > + for_each_numa_hop_mask(mask, dev->priv.numa_node) { > + for_each_cpu_andnot(cpu, mask, prev) { > + cpus[i] = cpu; > + if (++i == ncomp_eqs) > + goto spread_done; > + } > + prev = mask; > + } I think it was me who suggested splitting the for_each_numa_hop_cpu() from v4 to for_each_cpu_andnot() and for_each_numa_hop_mask() in email from Sep 25. So, for this part: Suggested-by: Yury Norov <yury.norov@gmail.com> I'm also glad to see that anonymous structure disappeared. Nice work. For the series: Reviewed-by: Yury Norov <yury.norov@gmail.com> > +spread_done: > + rcu_read_unlock(); > ret = mlx5_irqs_request_vectors(dev, cpus, ncomp_eqs, table->comp_irqs); > kfree(cpus); > if (ret < 0) > -- > 2.31.1
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c index a0242dc15741c..7acbeb3d51846 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c @@ -812,9 +812,12 @@ static void comp_irqs_release(struct mlx5_core_dev *dev) static int comp_irqs_request(struct mlx5_core_dev *dev) { struct mlx5_eq_table *table = dev->priv.eq_table; + const struct cpumask *prev = cpu_none_mask; + const struct cpumask *mask; int ncomp_eqs = table->num_comp_eqs; u16 *cpus; int ret; + int cpu; int i; ncomp_eqs = table->num_comp_eqs; @@ -833,8 +836,19 @@ static int comp_irqs_request(struct mlx5_core_dev *dev) ret = -ENOMEM; goto free_irqs; } - for (i = 0; i < ncomp_eqs; i++) - cpus[i] = cpumask_local_spread(i, dev->priv.numa_node); + + i = 0; + rcu_read_lock(); + for_each_numa_hop_mask(mask, dev->priv.numa_node) { + for_each_cpu_andnot(cpu, mask, prev) { + cpus[i] = cpu; + if (++i == ncomp_eqs) + goto spread_done; + } + prev = mask; + } +spread_done: + rcu_read_unlock(); ret = mlx5_irqs_request_vectors(dev, cpus, ncomp_eqs, table->comp_irqs); kfree(cpus); if (ret < 0)