Received: by 2002:a05:7412:8598:b0:f9:33c2:5753 with SMTP id n24csp126688rdh; Mon, 18 Dec 2023 13:51:22 -0800 (PST) X-Google-Smtp-Source: AGHT+IFbdrWHnJgLtKWuZuCR9ihnBaR7TBi961941ogEWDb8lZZ1j91mWrV2WtQFiw5zWSxSSShZ X-Received: by 2002:a50:f603:0:b0:553:812e:f5a9 with SMTP id c3-20020a50f603000000b00553812ef5a9mr336570edn.59.1702936281998; Mon, 18 Dec 2023 13:51:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702936281; cv=none; d=google.com; s=arc-20160816; b=Iy5VVVKIHPBipynfShhsBpRRHb3IuzqvoXINvezBhNPZ0xG5pdyUfZ0XU5sVrb/G5M uoFIQ/EeRkLOI5A/ToO9X2UvXIP5O348YypdLIioWsTXPCTfKCgisWA/km7qA7MFiuIp xPO0wPLXTj5/auRb6JaA0O0anFhXROgu1CCVe7Dw4zfP4ZgKbvZyGfCGagsmR+m4TCQH ZQnecuULqmNJl/zbk7z7J5X5EDXFcmZyVKLcvPAZjcWfTTPeHXzTPdJWZB2tO26HBzxj TS/3UeI9JC2cVMw9mj2+pv59FfI4lo9fVvFMBsQBMVeo2D5/L8Y1KopYRc35LuRa4qhw zw4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=hsIQRoDMyAO/1DgxQjK7hg35wfAQDmgiayboWw066aQ=; fh=6OlrOjW385gxDWH03gPtGqaPLxdo84ee3bv5OTifauI=; b=FwJGbdSvW4At+gASwo/4qoUWBIMng0s5Gf+hAPopMtrKSZM3heTGRMSD2hAussJfSz mB5YTz7Z2x3SmAAIlgcF2j8SbV2YbyXdy/OXUCagiR5KTw/6UA/8KzVr98V7Q1BRFX31 GvhoxP4rMgAdSbGg+MpkgKViluwkoGSxp8SlCLaShbX1g+w2jJyOfGVSd+5skqgsaRuz kUH3AodQp9m0fELcttdBIcAN0CS9Z1Pprx8R1l50cx6UPduggjKQ/Sxm9YWDQtqAp1uw Pq1PzYu3fvgpy8d5IEO0y8Mst9dvvvvcHAxWrjLnTQny5+CEDlN8y/H8Pr4TAkXxmEyo H0kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Gp17vnOo; spf=pass (google.com: domain of linux-kernel+bounces-4413-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4413-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id z25-20020a50cd19000000b005520f2d43bcsi5398480edi.99.2023.12.18.13.51.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 13:51:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4413-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Gp17vnOo; spf=pass (google.com: domain of linux-kernel+bounces-4413-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4413-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3507B1F24D28 for ; Mon, 18 Dec 2023 21:44:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E88674E01; Mon, 18 Dec 2023 21:44:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Gp17vnOo" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9E00273467; Mon, 18 Dec 2023 21:44:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f48.google.com with SMTP id 98e67ed59e1d1-28659348677so2561511a91.0; Mon, 18 Dec 2023 13:44:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702935882; x=1703540682; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=hsIQRoDMyAO/1DgxQjK7hg35wfAQDmgiayboWw066aQ=; b=Gp17vnOoU0YRBcRwYY6sIP/lzFDxecnFZCWWG5n4lkj9+u5aik8Cm+Jo3Ziho//TT0 f+Gh7Dez8xhAy9zSZm0EcvYg2FZ3nhMXWfB4t4WAJaFE8heuC+Fu7VA7hyDQH7aalEaf pQXZxR5ebfnsdRUxdGofrGEpKr8S1mLgSqCx1+QVdUYTfqgbCdcewCUE8kppbRSuE6G1 U+xy9EWkA6ylgiX8RSzkOMVhGrxT3DzTX9KJAtUZs1NFa3D9jVJi2t5F2RVwz7RDygds bN94SRKmlC4SKzfyH0ltOll2xQ8Bq0bwgv2FpSq5STEM87+Dbjb0Wcdw7uv3oPJa+H4f dR2w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702935882; x=1703540682; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hsIQRoDMyAO/1DgxQjK7hg35wfAQDmgiayboWw066aQ=; b=VxgVNXkMo2TLMG3Ok+l/qOkVx0RU18EAx0B/yxBGxcxdujr6dq4os1zdrfcLaCo/21 b9bfDTZFO/uGy8QLEW8zVLL2Z8DNWjV4z9uuAWeVTqLga2JatSc6y1LH7PyP5NtB74XT MkHsWfZMZ5VFNy4vuhAjCpNErqM3L1u7r6CBHWNHkaGwCGgHEmNRNOTDidaZB/6m2Mns Aeraax46AVJA5fJUQaCqIRvQ95JGAixJj0DXXILDLKIM3Jw4Vn1d63dS66FxC1QM6HQF 8lP60Ez1T1gApZVzfkkpCwS1JcRuVxmWODvb7zfgegA6Tr12nlZD7uAkPpqHXXakQmtS JoJw== X-Gm-Message-State: AOJu0YyJKNVkJjDmvkpq71V8OgPvm6ax6y6gMQ2TfpH0GqB/iWN2FnKy hoLSuyGWHKAFZXkj6uoiHZY= X-Received: by 2002:a17:90a:f3ca:b0:28b:664a:807d with SMTP id ha10-20020a17090af3ca00b0028b664a807dmr77347pjb.25.1702935881851; Mon, 18 Dec 2023 13:44:41 -0800 (PST) Received: from localhost ([216.228.127.130]) by smtp.gmail.com with ESMTPSA id x14-20020a170902820e00b001d2ffeac9d3sm8253339pln.186.2023.12.18.13.44.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 13:44:41 -0800 (PST) Date: Mon, 18 Dec 2023 13:42:25 -0800 From: Yury Norov To: Jacob Keller Cc: Souradeep Chakrabarti , kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org, decui@microsoft.com, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, longli@microsoft.com, leon@kernel.org, cai.huoqing@linux.dev, ssengar@linux.microsoft.com, vkuznets@redhat.com, tglx@linutronix.de, linux-hyperv@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, schakrabarti@microsoft.com, paulros@microsoft.com Subject: Re: [PATCH 3/3] net: mana: add a function to spread IRQs per CPUs Message-ID: References: <20231217213214.1905481-1-yury.norov@gmail.com> <20231217213214.1905481-4-yury.norov@gmail.com> <9ba04aef-ba13-4366-8709-ea1808dd4270@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9ba04aef-ba13-4366-8709-ea1808dd4270@intel.com> On Mon, Dec 18, 2023 at 01:17:53PM -0800, Jacob Keller wrote: > > > On 12/17/2023 1:32 PM, Yury Norov wrote: > > +static __maybe_unused int irq_setup(unsigned int *irqs, unsigned int len, int node) > > +{ > > + const struct cpumask *next, *prev = cpu_none_mask; > > + cpumask_var_t cpus __free(free_cpumask_var); > > + int cpu, weight; > > + > > + if (!alloc_cpumask_var(&cpus, GFP_KERNEL)) > > + return -ENOMEM; > > + > > + rcu_read_lock(); > > + for_each_numa_hop_mask(next, node) { > > + weight = cpumask_weight_andnot(next, prev); > > + while (weight-- > 0) { > > + cpumask_andnot(cpus, next, prev); > > + for_each_cpu(cpu, cpus) { > > + if (len-- == 0) > > + goto done; > > + irq_set_affinity_and_hint(*irqs++, topology_sibling_cpumask(cpu)); > > + cpumask_andnot(cpus, cpus, topology_sibling_cpumask(cpu)); > > + } > > + } > > + prev = next; > > + } > > +done: > > + rcu_read_unlock(); > > + return 0; > > +} > > + > > You're adding a function here but its not called and even marked as > __maybe_unused? I expect that Souradeep would build his driver improvement on top of this function. cpumask API is somewhat tricky to use it properly here, so this is an attempt help him, instead of moving back and forth on review. Sorry, I had to be more explicit. Thanks, Yury