Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp667373rwb; Thu, 18 Aug 2022 10:03:22 -0700 (PDT) X-Google-Smtp-Source: AA6agR5SR/zNaxFz9gXucLz1jKkK5VVsok1+3l+HP6LUEcD7IRoO2Ar492KMly/566Ix5i1ERfeY X-Received: by 2002:a17:902:ce84:b0:16f:81d2:60c with SMTP id f4-20020a170902ce8400b0016f81d2060cmr3417328plg.57.1660842201797; Thu, 18 Aug 2022 10:03:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660842201; cv=none; d=google.com; s=arc-20160816; b=FIUmepeGgrw06NA+r4nqXzW0p4qEiYjM5llPygcg0m7FIeL7D0Dzdlt+W45dekS2By QWdPFu66BfUykD9bhgdfbaefmyxNKmtpng+/jTu8ZmQc6G7BQcH9/oO92cd4y0B6NIOd YZfDNyGYapATg1aYwWKeDZVqUn4Bprkwqz6sh4N+6q0fnue7M7BbkshaB4hqScgK8WN0 cifIlQeoY47aMdJ8OQRLlOJAQbM5oXHjESonicilGlAP4ecqS+Ky2Hyx5GdaDXQZvptV Vcb4Hbi0rfLjL58aiYT1Ev+B7ewnW5WT7j//vZCeuYlyRdiGQAZCaT3uc1t6jWs/NcHx uQcQ== 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=ywTMuS9huvM7zHWOxR6GjSmCdhb3SJi0oS2399XlZwU=; b=DjrEV0DIFCTfu6NrukWobl1f+3hKWXEEAgAIXbKiMTC/Dm82INSwskPyMD+QMF68pP l0MFpv3PziyICYnsv/9wRQWtT3+uq9OPDrSL9sIsbZ0IAAaS1la8XeIZ6MzfPk/zA4yP MfFLhTZ9LTOoo/G/JAUi46Uyt8NC2uavik4oxGX0fVhNdrSuPnTvPJjUaAz0Yyy3CMWd KXD+0Xc8yBw5ESgJuy+MkFfjp5kzB7TbDzGbAErG6Wcx63NaQTQv1gWs8UAvuA51mCkz VbaYfKoMuPf7d0YetbmE8lv+UvJBl3DxtOm239emkCY1eqPb2CKm57ei99IeAitDab6k i/fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=D79UzXcH; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r83-20020a632b56000000b0041d00d9a342si1751445pgr.757.2022.08.18.10.02.59; Thu, 18 Aug 2022 10:03:21 -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=D79UzXcH; 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 S1344999AbiHRQpv (ORCPT + 99 others); Thu, 18 Aug 2022 12:45:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344970AbiHRQpk (ORCPT ); Thu, 18 Aug 2022 12:45:40 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3768DBA9DE for ; Thu, 18 Aug 2022 09:45:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1660841139; 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=ywTMuS9huvM7zHWOxR6GjSmCdhb3SJi0oS2399XlZwU=; b=D79UzXcHA7YAvj+O6XmGbxReWxL3xzxKhKp4R1Otbgv3Vk0hzPNBMuqN31CGYRJP7yuA9O zACkadpB8NGMmU2zR7QR0IApc5W0tZbfu3v6BDDLCUWTp3UGei2Qd8UTT6lkE1pcgti59t XKspMVZbLvwgjoOvQnlIZWpgNZ86klM= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-150-O2yAGzsONhWu88cVU_6gYA-1; Thu, 18 Aug 2022 12:45:38 -0400 X-MC-Unique: O2yAGzsONhWu88cVU_6gYA-1 Received: by mail-wm1-f69.google.com with SMTP id b4-20020a05600c4e0400b003a5a96f1756so2978270wmq.0 for ; Thu, 18 Aug 2022 09:45:38 -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; bh=ywTMuS9huvM7zHWOxR6GjSmCdhb3SJi0oS2399XlZwU=; b=Bdu+zTNDiQ0f/kzqQ5JQ+MyzN1FQk6uqgtqXzRzYr2yzznNa5AbuMMCYNVg1jaFfEt +h6BeeujS47PqRtGpmPgpqaJJ5hN8scq/U9xg1mR3QA8zmj/fFDHeJfGc0biIMfMaMqK iyA6MCrgqgvuqzC+Bspwvj9ykXyqryRba425byeYG5JUxO/vk7Yfz7NYPXoxD3JvsTTV uaKdE68WSyxW28c4k+KzbCn/8tU3WDf3cga/cXdK+uAjm8Ayy0M7hcAM14bpu9sFIcfx qXiEKXYifizEP6+kRBe+xyGA4ayuZV68kMrm61OLkg5DsZNRjYBG7IwGWJ/3iQeRFG1T Y+qg== X-Gm-Message-State: ACgBeo3LcstHmJj9r1T5bOgPjbaBlSbJXPyQ3B8XvN+Q0BBUoz129S72 see2KGcJjPVSmc7YNow9wOI42fIqYKU2nTvg7vykw/4CP8JpjpvECeKaRFdwjbDFD1ACyklRI4r iaXgh8KT/9M5+eo7wRbCJkBV6 X-Received: by 2002:a05:6000:1f08:b0:21f:bbe:252c with SMTP id bv8-20020a0560001f0800b0021f0bbe252cmr2104341wrb.340.1660841137316; Thu, 18 Aug 2022 09:45:37 -0700 (PDT) X-Received: by 2002:a05:6000:1f08:b0:21f:bbe:252c with SMTP id bv8-20020a0560001f0800b0021f0bbe252cmr2104328wrb.340.1660841137167; Thu, 18 Aug 2022 09:45:37 -0700 (PDT) Received: from vschneid.remote.csb ([185.11.37.247]) by smtp.gmail.com with ESMTPSA id d7-20020a05600c3ac700b003a5ad7f6de2sm2465458wms.15.2022.08.18.09.45.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 09:45:36 -0700 (PDT) From: Valentin Schneider To: netdev@vger.kernel.org, linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Saeed Mahameed , Leon Romanovsky , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yury Norov , Andy Shevchenko , Rasmus Villemoes , Ingo Molnar , Peter Zijlstra , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Mel Gorman , Greg Kroah-Hartman , Barry Song , Heiko Carstens , Tony Luck , Jonathan Cameron , Gal Pressman , Tariq Toukan Subject: [PATCH v2 5/5] SHOWCASE: net/mlx5e: Leverage for_each_numa_hop_cpu() Date: Thu, 18 Aug 2022 17:45:22 +0100 Message-Id: <20220818164522.1087673-3-vschneid@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220818164522.1087673-1-vschneid@redhat.com> References: <20220817175812.671843-1-vschneid@redhat.com> <20220818164522.1087673-1-vschneid@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org Not-signed-off-by: Valentin Schneider --- drivers/net/ethernet/mellanox/mlx5/core/eq.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/eq.c b/drivers/net/ethernet/mellanox/mlx5/core/eq.c index 229728c80233..0a5432903edd 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/eq.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/eq.c @@ -812,6 +812,7 @@ static int comp_irqs_request(struct mlx5_core_dev *dev) int ncomp_eqs = table->num_comp_eqs; u16 *cpus; int ret; + int cpu; int i; ncomp_eqs = table->num_comp_eqs; @@ -830,8 +831,15 @@ 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); + + rcu_read_lock(); + for_each_numa_hop_cpus(cpu, dev->priv.numa_node) { + cpus[i] = cpu; + if (++i == ncomp_eqs) + goto spread_done; + } +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