From mboxrd@z Thu Jan 1 00:00:00 1970 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 smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B2977C021A0 for ; Sat, 15 Feb 2025 17:58:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 78E1C60B0D; Sat, 15 Feb 2025 17:58:39 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id MJ_2P-CVshcQ; Sat, 15 Feb 2025 17:58:39 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.142; helo=lists1.osuosl.org; envelope-from=intel-wired-lan-bounces@osuosl.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org E399E6085C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1739642318; bh=KYdkkh/9SXs1CsOP9oNqZPcqy5Wi9i0YrY5bXFD2+LU=; h=Date:From:To:Cc:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=CMrGch3/WlE6HNozNw7XxTf8nL452T63hz6LI3tY79YHvHqQfzD6DCNqUvy3CNW3u sRAbWXGKmbQtRwHHuOLTDYTACehIz5zH5XNvbWb3+fZmKRK6SbTv5uixlgvmJ/+ezK md9ilYZj5bnMS5c8tWT/m8RI9hYN3NzAl2uwKXgVFARpKfBMgFR0gv07npI7aGHDpS +n7vN3711c/J12FQqTWaUiRFTdTXCOQTqXwzcyE/6rPcnyALFAhS6fPQ4k6lBgRZX5 +Ie5+dOAH0B2j0QZrPdRKo+5llFB3bqdBWKqras5kx/peh+nm2RlgB5ZNmxd9Q0cDN TdLFYp0nxw3gQ== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id E399E6085C; Sat, 15 Feb 2025 17:58:38 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by lists1.osuosl.org (Postfix) with ESMTP id 30A75DE for ; Sat, 15 Feb 2025 17:58:38 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 11944831AC for ; Sat, 15 Feb 2025 17:58:38 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id rMsYiPwVRn-9 for ; Sat, 15 Feb 2025 17:58:37 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2604:1380:45d1:ec00::3; helo=nyc.source.kernel.org; envelope-from=kuba@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 73E3280BC4 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 73E3280BC4 Received: from nyc.source.kernel.org (nyc.source.kernel.org [IPv6:2604:1380:45d1:ec00::3]) by smtp1.osuosl.org (Postfix) with ESMTPS id 73E3280BC4 for ; Sat, 15 Feb 2025 17:58:37 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id 02066A407CD; Sat, 15 Feb 2025 17:56:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 21F73C4CEDF; Sat, 15 Feb 2025 17:58:35 +0000 (UTC) Date: Sat, 15 Feb 2025 09:58:34 -0800 From: Jakub Kicinski To: Ahmed Zaki Cc: netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, andrew+netdev@lunn.ch, edumazet@google.com, horms@kernel.org, pabeni@redhat.com, davem@davemloft.net, michael.chan@broadcom.com, tariqt@nvidia.com, anthony.l.nguyen@intel.com, przemyslaw.kitszel@intel.com, jdamato@fastly.com, shayd@nvidia.com, akpm@linux-foundation.org, shayagr@amazon.com, kalesh-anakkur.purayil@broadcom.com, pavan.chebbi@broadcom.com Message-ID: <20250215095834.6cfc923f@kernel.org> In-Reply-To: <20250211210657.428439-4-ahmed.zaki@intel.com> References: <20250211210657.428439-1-ahmed.zaki@intel.com> <20250211210657.428439-4-ahmed.zaki@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1739642315; bh=MhdHAwfVerP/+KdwSgCSiIHb8HB1mk3tyt3VInWBKL4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=FcU+8KPGSUOtq2thnW5VdOci5oOm9vfHnuH3lZ1f1d4MFMXCTaFAhzxO1vPR5fCZN J5U3sjysFMOpXZpRwocq0lCaisHVT7kt/fNHzYbD1dvoagp+F/WDQg3P3mswmJ7y6h kHbQr2JCDBDzC//JEG2RClR2V3HHRm4wSW5B1I+KrxveDZOwpWMe8DroNmFUzApCtS 8uiQTQFK0HE0HU6f8UPEEFnS4Y1bQmm1/sV0Fo7QDMfN9h8eUWK8ADIdFOrc7tWL8R 4rcMGWw9cpA83JjgwBMY5LYbwoBjLoxy086TaOQrConypxP6HA/jSEjdaHEdn4BZrw 1lSfo/+f8xVeg== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=FcU+8KPG Subject: Re: [Intel-wired-lan] [PATCH net-next v8 3/6] net: napi: add CPU affinity to napi_config X-BeenThere: intel-wired-lan@osuosl.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Intel Wired Ethernet Linux Kernel Driver Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-wired-lan-bounces@osuosl.org Sender: "Intel-wired-lan" On Tue, 11 Feb 2025 14:06:54 -0700 Ahmed Zaki wrote: > @@ -11575,9 +11615,9 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, > void (*setup)(struct net_device *), > unsigned int txqs, unsigned int rxqs) > { > + unsigned int maxqs, i, numa; > struct net_device *dev; > size_t napi_config_sz; > - unsigned int maxqs; > > BUG_ON(strlen(name) >= sizeof(dev->name)); > > @@ -11679,6 +11719,11 @@ struct net_device *alloc_netdev_mqs(int sizeof_priv, const char *name, > if (!dev->napi_config) > goto free_all; > > + numa = dev_to_node(&dev->dev); Does this work? dev->dev is the "software" device, IOW the netdev itself. The HW dev is dev->dev.parent but it won't be set at this stage, we'd need to move the init to register, or maybe netif_enable_cpu_rmap() / netif_set_affinity_auto() ? > + for (i = 0; i < maxqs; i++) > + cpumask_set_cpu(cpumask_local_spread(i, numa), > + &dev->napi_config[i].affinity_mask);