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 6CECAE77188 for ; Fri, 20 Dec 2024 19:37:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 22D256068F; Fri, 20 Dec 2024 19:37:19 +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 IzGcctx7haM1; Fri, 20 Dec 2024 19:37:17 +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 981166062F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1734723437; bh=DxCgbcxG9iiemGr+83BLVgwHNm1vd+LlGc4jTU3X3RM=; h=Date:From:To:Cc:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Pv4g1cLjJJwoUBk1oG03Nq4/67uxOE8Uct0nJxd+c6N6mTJskY3NIz815x6WcvjyC PvLXs9P/v0HBHJHE+hiOmzozGVn7yhEDGBOAIEaFKSOiiTICdZDn8EgMzByeKnUjDK CoFTD6vrhh46XLPF477g7gSIf05h9HaWpcVXVK3li0LyROJTci4X941w3zS/pCiAVs dvOzWMEYUwsaf5RiViWQrzGE3mj5Y7C9JC3vyT1Oqv0HtjqZctXt18/ApoOpqDBb/S dLPrc949jCeYG/D0AfcgsTDjxdq4IG5fk9FkckAwhJqMFypLS3SNevMQNKg1wGNNHu 3n0j8y2SV2wjw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id 981166062F; Fri, 20 Dec 2024 19:37:17 +0000 (UTC) Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by lists1.osuosl.org (Postfix) with ESMTP id 90152730 for ; Fri, 20 Dec 2024 19:37:15 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id 7053F40119 for ; Fri, 20 Dec 2024 19:37:15 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id NKWofCgDeilh for ; Fri, 20 Dec 2024 19:37:14 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=139.178.84.217; helo=dfw.source.kernel.org; envelope-from=kuba@kernel.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp2.osuosl.org 835EA400EA DKIM-Filter: OpenDKIM Filter v2.11.0 smtp2.osuosl.org 835EA400EA Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by smtp2.osuosl.org (Postfix) with ESMTPS id 835EA400EA for ; Fri, 20 Dec 2024 19:37:14 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 6CA265C694A; Fri, 20 Dec 2024 19:36:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A37EAC4CED4; Fri, 20 Dec 2024 19:37:12 +0000 (UTC) Date: Fri, 20 Dec 2024 11:37:11 -0800 From: Jakub Kicinski To: Ahmed Zaki Cc: , , , , , , , , , , , , Message-ID: <20241220113711.5b09140b@kernel.org> In-Reply-To: <35441a41-d543-4e7b-b0dc-537062d32c9c@intel.com> References: <20241218165843.744647-1-ahmed.zaki@intel.com> <20241218165843.744647-5-ahmed.zaki@intel.com> <20241219194237.31822cba@kernel.org> <20241220092356.69c9aa1e@kernel.org> <35441a41-d543-4e7b-b0dc-537062d32c9c@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=1734723433; bh=TxNjdNBPDUPVWyiLgYG3IUbsLDUHysJGXU6IvUYBqfs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=SPxXkZoXUAsFtT61toQ1KGeUeopbO9yXrucq73cl0zPU+stXjVI9tkdWJH/mEpA5X huOp48KKEGHc53ze02VUA3hyY+ScjAd0SMKKH8PIvsIdwQtMmC8sR0EZ5sure4oeoc QmS0QbTagaZD2YCYDmhIwMgbyphG7oNg4MDVcshEuTCGZyohyPGQnxi+GmIG+IhkyW q5O+jdWczFcu7WHF+4f1om2zIjJblE19Pb0JklraseJ4UHPSk4aXVo2vs70lxEoyiD M75iuM44cMtM9R1KzfYU+Wu2sR59tu+aw63TaKoLfZPDFhSuR8fs+eGnhChUmyuI38 gByTcGED5wB0w== X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp2.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=SPxXkZoX Subject: Re: [Intel-wired-lan] [PATCH net-next v2 4/8] 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 Fri, 20 Dec 2024 12:15:33 -0700 Ahmed Zaki wrote: > > I don't understand what you're trying to say, could you rephrase? > > Sure. After this patch, we have (simplified): > > void netif_napi_set_irq(struct napi_struct *napi, int irq, unsigned long > flags) > { > struct irq_glue *glue = NULL; > int rc; > > napi->irq = irq; > > #ifdef CONFIG_RFS_ACCEL > if (napi->dev->rx_cpu_rmap && flags & NAPIF_IRQ_ARFS_RMAP) { > rc = irq_cpu_rmap_add(napi->dev->rx_cpu_rmap, irq, napi, > netif_irq_cpu_rmap_notify); > . > . > . > } > #endif > > if (flags & NAPIF_IRQ_AFFINITY) { > glue = kzalloc(sizeof(*glue), GFP_KERNEL); > if (!glue) > return; > glue->notify.notify = netif_irq_cpu_rmap_notify; > glue->notify.release = netif_napi_affinity_release; > . > . > } > } > > > Both branches assign the new cb function "netif_irq_cpu_rmap_notify()" > as the new IRQ notifier, but the first branch calls irq_cpu_rmap_add() > where the notifier is embedded in "struct irq_glue". So the cb function > needs to assume the notifier is inside irq_glue, so the second "if" > branch needs to do the same. First off, I'm still a bit confused why you think the flags should be per NAPI call and not set at init time, once. Perhaps rename netif_enable_cpu_rmap() suggested earlier to something more generic (netif_enable_irq_tracking()?) and pass the flags there? Or is there a driver which wants to vary the flags per NAPI instance? Then you can probably register a single unified handler, and inside that handler check if the device wanted to have rmap or just affinity?