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 smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (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 65C6AC02194 for ; Fri, 7 Feb 2025 02:33:59 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 14DAF4290F; Fri, 7 Feb 2025 02:33:59 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id t6naCgBNXiqZ; Fri, 7 Feb 2025 02:33:58 +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 smtp4.osuosl.org 3D54842912 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1738895638; bh=VgwCxQUNcDT5oug4p7vGxpIxwv78fpBiTo2oabxf+mI=; h=Date:From:To:Cc:In-Reply-To:References:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=r0t2J7PaPl+S43zNjaJ8pu/EN87fOx8QmNbvcynfQNYdCGq5FrDka+yzPIHmduY+R Dc9FP4GhzcqqCliWkS3bytw40f52sJS+/HoocMI1elxjgK3hKzkhRyhPgK7ASbGqLl /TKQMTEYKrdto2tGtWwpYeGnJ5COZburp4rjSt2UiBEbxLjsY/PXubC7kLOhMIsqKV xgzULm39nm1kxCd8KtQbzI46rnhWQxLjg+Uk2qQshOPXWyje3w0rOzYcV9S8QXOIKg slIU7NADxIS1nATv7S0XsYrc4c84ZHDybF+/14cVrqXohV+OHhp0Ajc+qe5hcGuQV2 yKX7okV8PPr1g== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp4.osuosl.org (Postfix) with ESMTP id 3D54842912; Fri, 7 Feb 2025 02:33:58 +0000 (UTC) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists1.osuosl.org (Postfix) with ESMTP id 889BFE4 for ; Fri, 7 Feb 2025 02:33:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 774D342912 for ; Fri, 7 Feb 2025 02:33:56 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id 1_Lx44oRehWD for ; Fri, 7 Feb 2025 02:33:55 +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 smtp4.osuosl.org AA5C54290F DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org AA5C54290F Received: from nyc.source.kernel.org (nyc.source.kernel.org [IPv6:2604:1380:45d1:ec00::3]) by smtp4.osuosl.org (Postfix) with ESMTPS id AA5C54290F for ; Fri, 7 Feb 2025 02:33:55 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id BC344A44440; Fri, 7 Feb 2025 02:32:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7A292C4CEDD; Fri, 7 Feb 2025 02:33:53 +0000 (UTC) Date: Thu, 6 Feb 2025 18:33:52 -0800 From: Jakub Kicinski To: Ahmed Zaki Cc: Joe Damato , , , , , , , , , , , , , , , Message-ID: <20250206183352.4cecc85e@kernel.org> In-Reply-To: <8270a43c-61f8-446d-8701-4fbd13a72e32@intel.com> References: <20250204220622.156061-1-ahmed.zaki@intel.com> <20250204220622.156061-3-ahmed.zaki@intel.com> <8270a43c-61f8-446d-8701-4fbd13a72e32@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=1738895634; bh=GdDbyGIzviXjTeSXk/FPXDQ2vguVeuJkFIC2V1e/OoQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=pcwn6q13hRXYMLVPzLkpUE3XNdu5FK8aSZaVdBXIT3SlnQ3hEFO/9VHDf2myjE9RZ NmYaM32lmEPEMtDRzpHbnYDR5zaTNEkYR6XHJEq1hyWkkBAS4s32vF05Mwg8fcxA2Z etsT1WQzHfZA1fAAXpGGVr4/b9M+92Nqu9wx7jAh2M4/9187ovosBft3hEzg9TFk21 iUe4gjPaJAid6Rn8P/9p6e67kLK1RMtKD0tLyFUxuvECO3PyO61FzY8A0jN1lBoA97 v+o7KW8WwIH+vSIe/VYfHGx8flmtqQcnBwb3qXjkUMCmhbnp3w7dGQDCM6VrgrAtN1 eyie2xQ1JAwuw== X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dmarc=pass (p=quarantine dis=none) header.from=kernel.org X-Mailman-Original-Authentication-Results: smtp4.osuosl.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=pcwn6q13 Subject: Re: [Intel-wired-lan] [PATCH net-next v7 2/5] 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 Wed, 5 Feb 2025 08:20:20 -0700 Ahmed Zaki wrote: > >> + if (napi->dev->rx_cpu_rmap_auto) { > >> rc = napi_irq_cpu_rmap_add(napi, irq); > >> if (rc) > >> netdev_warn(napi->dev, "Unable to update ARFS map (%d)\n", > >> rc); > >> + } else if (napi->config && napi->dev->irq_affinity_auto) { > >> + napi->notify.notify = netif_napi_irq_notify; > >> + napi->notify.release = netif_napi_affinity_release; > >> + > >> + rc = irq_set_affinity_notifier(irq, &napi->notify); > >> + if (rc) > >> + netdev_warn(napi->dev, "Unable to set IRQ notifier (%d)\n", > >> + rc); > >> } > > > > Should there be a WARN_ON or WARN_ON_ONCE in here somewhere if the > > driver calls netif_napi_set_irq_locked but did not link NAPI config > > with a call to netif_napi_add_config? > > > > It seems like in that case the driver is buggy and a warning might > > be helpful. > > > > I think that is a good idea, if there is a new version I can add this in > the second part of the if: > > > if (WARN_ON_ONCE(!napi->config)) > return; To be clear, this will make it illegal to set IRQ on a NAPI instance before it's listed. Probably for the best if we also have auto-remove in netif_napi_del().