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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8233BC6FD1F for ; Wed, 22 Mar 2023 03:46:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230106AbjCVDqh (ORCPT ); Tue, 21 Mar 2023 23:46:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229544AbjCVDqg (ORCPT ); Tue, 21 Mar 2023 23:46:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B7D82E805 for ; Tue, 21 Mar 2023 20:46:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E1CD961D84 for ; Wed, 22 Mar 2023 03:46:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DEA14C433EF; Wed, 22 Mar 2023 03:46:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1679456793; bh=QlaQrbPGFcgBRKYgeExjpzuNuTb6iYFH6Rfp+gPt07g=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GisENaYm1EdLImli57xBrBMH+RpI6BUIin4045+aJUVzC/qF0cnx5porygFAGbJk+ hUYAWRQX8y0bxhk4+ancdwX1rQcqEFfWB0gyauWRtj4Rid39QRpvdArk5umWEIEeqx yDojc3GzaMTIFR9eZC7quZRH5/H4p0rG5+lGeykzk7fsHwkc86fMxIUanKSm/sQTBj Iu5lc9DMFLO3zTZMYRbK5iDlH00RoUlriKvOCxUu+k+nL8EROJaRymSNapkWa3OmJt 0YjtB3PUko527LWV4ld5S1cZt5Vj98Hk6ZsfVm+qc9xn4hpamz4KmyvQrDlok7IZMG PPi5sreGziY4A== Date: Tue, 21 Mar 2023 20:46:31 -0700 From: Jakub Kicinski To: Saeed Mahameed Cc: "David S. Miller" , Paolo Abeni , Eric Dumazet , Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Eli Cohen Subject: Re: [net-next 03/14] lib: cpu_rmap: Add irq_cpu_rmap_remove to complement irq_cpu_rmap_add Message-ID: <20230321204631.0f8bc64e@kernel.org> In-Reply-To: <20230320175144.153187-4-saeed@kernel.org> References: <20230320175144.153187-1-saeed@kernel.org> <20230320175144.153187-4-saeed@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Mon, 20 Mar 2023 10:51:33 -0700 Saeed Mahameed wrote: > From: Eli Cohen > > Add a function to complement irq_cpu_rmap_add(). It removes the irq from > the reverse mapping by setting the notifier to NULL. Poor commit message. You should mention that glue is released and cleared via the kref. BTW who can hold the kref? What are the chances that user will call: irq_cpu_rmap_remove() irq_cpu_rmap_add() and the latter will fail because glue was held? > diff --git a/include/linux/cpu_rmap.h b/include/linux/cpu_rmap.h > index 0ec745e6cd36..58284f1f3a58 100644 > --- a/include/linux/cpu_rmap.h > +++ b/include/linux/cpu_rmap.h > @@ -60,6 +60,8 @@ static inline struct cpu_rmap *alloc_irq_cpu_rmap(unsigned int size) > } > extern void free_irq_cpu_rmap(struct cpu_rmap *rmap); > > +extern int irq_cpu_rmap_remove(struct cpu_rmap *rmap, int irq); > extern int irq_cpu_rmap_add(struct cpu_rmap *rmap, int irq); > > + use checkpatch, please :(