From patchwork Mon Jan 13 17:10:40 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ahmed Zaki X-Patchwork-Id: 13937806 X-Patchwork-Delegate: kuba@kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AF6AE4D8CE for ; Mon, 13 Jan 2025 17:11:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736788289; cv=none; b=R93j9iIfxEUIabrHPUJFDHxF8wOCPyKkBJdr3lpuQ9db87Eynby81FDRi7Ocne8t+AvMWHmWFvjq2SOuZkEemMqPYat/2CN1ka00FRpb4mPigqhl1bsF7bot/UerpqPNjzHCWH0nVskQP9hHcC0oj9X8DrusJ6XKZTnIS0w8Pto= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736788289; c=relaxed/simple; bh=mvOOocLbzDTCGa2s6y/5no/OkUrgQwfF+aAaCDsse70=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Wi30dmZFNUYpFTcXKFS/cBRNbiesNFEz3+o574be4F4wAOzZIsxUbiAYOHxXdv/jbSAiRubnhkLeO8gsyNHTrTrhLJRdsW1TTbMH2qb6Hs+TmrRaY0g7W22TYfSmYI7M18gmvILwAzVy20YfQSdWb/VsLUR3yFlxcpzZsUtul1I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=fglkkB3K; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="fglkkB3K" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1736788288; x=1768324288; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=mvOOocLbzDTCGa2s6y/5no/OkUrgQwfF+aAaCDsse70=; b=fglkkB3KTIVVX7F/PVkfkRfPqvE4+stkdn5ZgWIcI0Ua82ttES5GAADv bU3bMZX1+otZ6TgVOa7j+FS+EnXE18b7G3ExlsAyo5b727d09eL/tN7dB kv4ap0cxltmMd+YheKKUa78VdctMsmMQxWFxi/luefpoxyPy1FOkJgrwQ FkLW8N+yKbvReoqcJ3AIsYhCYM/AAjvpeA4Z+4Sceyj6+kMuNXaG8vwtf 8ZAodoUpeLZEyfBibjuOdhQZoS1lj/WV8SA0ZkZ1F+68QUP9eG6GrM++Y lST5W/yXleIfx08OuTN8nRCLMtDsEj6lc5GLRA8OSZHQKlVZGYeBxbH59 Q==; X-CSE-ConnectionGUID: QS2v4dcKQZi1kokt5WEgeg== X-CSE-MsgGUID: Ppwilg2YQiyW2DjJ4UXDLA== X-IronPort-AV: E=McAfee;i="6700,10204,11314"; a="36748893" X-IronPort-AV: E=Sophos;i="6.12,310,1728975600"; d="scan'208";a="36748893" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2025 09:11:28 -0800 X-CSE-ConnectionGUID: ocZFwm8WQASPcDzPKcLYkQ== X-CSE-MsgGUID: xMy+9T7aRCqu6uvq0vEjvw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.12,310,1728975600"; d="scan'208";a="104499728" Received: from jdoman-mobl3.amr.corp.intel.com (HELO azaki-desk1.intel.com) ([10.125.108.26]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jan 2025 09:11:20 -0800 From: Ahmed Zaki To: netdev@vger.kernel.org Cc: intel-wired-lan@lists.osuosl.org, andrew+netdev@lunn.ch, edumazet@google.com, kuba@kernel.org, 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, yury.norov@gmail.com, darinzon@amazon.com, Ahmed Zaki Subject: [PATCH net-next v5 4/6] bnxt: use napi's irq affinity Date: Mon, 13 Jan 2025 10:10:40 -0700 Message-ID: <20250113171042.158123-5-ahmed.zaki@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250113171042.158123-1-ahmed.zaki@intel.com> References: <20250113171042.158123-1-ahmed.zaki@intel.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Delegate: kuba@kernel.org Delete the driver CPU affinity info and use the core's napi config instead. Signed-off-by: Ahmed Zaki --- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 25 +++-------------------- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 2 -- 2 files changed, 3 insertions(+), 24 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 1f50bc715038..7b8b42adc76d 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -11221,14 +11221,8 @@ static void bnxt_free_irq(struct bnxt *bp) int map_idx = bnxt_cp_num_to_irq_num(bp, i); irq = &bp->irq_tbl[map_idx]; - if (irq->requested) { - if (irq->have_cpumask) { - irq_update_affinity_hint(irq->vector, NULL); - free_cpumask_var(irq->cpu_mask); - irq->have_cpumask = 0; - } + if (irq->requested) free_irq(irq->vector, bp->bnapi[i]); - } irq->requested = 0; } @@ -11257,21 +11251,6 @@ static int bnxt_request_irq(struct bnxt *bp) netif_napi_set_irq(&bp->bnapi[i]->napi, irq->vector); irq->requested = 1; - - if (zalloc_cpumask_var(&irq->cpu_mask, GFP_KERNEL)) { - int numa_node = dev_to_node(&bp->pdev->dev); - - irq->have_cpumask = 1; - cpumask_set_cpu(cpumask_local_spread(i, numa_node), - irq->cpu_mask); - rc = irq_update_affinity_hint(irq->vector, irq->cpu_mask); - if (rc) { - netdev_warn(bp->dev, - "Update affinity hint failed, IRQ = %d\n", - irq->vector); - break; - } - } } return rc; } @@ -16200,6 +16179,8 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) dev->xdp_features = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT | NETDEV_XDP_ACT_RX_SG; + netif_enable_irq_affinity(dev); + #ifdef CONFIG_BNXT_SRIOV init_waitqueue_head(&bp->sriov_cfg_wait); #endif diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h index 094c9e95b463..7be2f90d0c05 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h @@ -1228,9 +1228,7 @@ struct bnxt_irq { irq_handler_t handler; unsigned int vector; u8 requested:1; - u8 have_cpumask:1; char name[IFNAMSIZ + BNXT_IRQ_NAME_EXTRA]; - cpumask_var_t cpu_mask; }; #define HWRM_RING_ALLOC_TX 0x1