From patchwork Mon Feb 20 06:14:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 59263 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp1155610wrn; Sun, 19 Feb 2023 22:19:19 -0800 (PST) X-Google-Smtp-Source: AK7set9gs44ND5C2eHLT31c+bHX2DugpZC7+HiSoAQKANH49EIV/+bsb0Q34jz/b7Zqziu7il0Rv X-Received: by 2002:a17:902:ea11:b0:19a:b6b1:ca82 with SMTP id s17-20020a170902ea1100b0019ab6b1ca82mr402019plg.10.1676873959451; Sun, 19 Feb 2023 22:19:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676873959; cv=none; d=google.com; s=arc-20160816; b=uPZEWhaFUg6ruSLIQ5XIhJRs+qycA+isAZ4orpdwPDK2ihjAmIpNSEKV53v/fwzdhQ eKf+55naz/8TC4LKxm3Ihdx/ZuR8t2EX+mCgAGnazxp7i/zkkGUl0VQnT26LDDL2e5xT YrFAk/GHD0JZ4ki6DxuUikCBRqJqkfOmm0O+/l2Fz8333gb+JYbg0wwgHdC/kfsXkafG kqLcjkHsyuJ5NjFqgbg6oP92ZyTIX7XgFZVaNwNuLJWZoX9PIwpGn6GBxMqFLyrYntEW baM6WSlxr0mhmKkMsutH4/feXMnm/TkKjaRxt7Urzt4l0ow+OoxLrIFfNu2RY0thcOwY vkhQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=F5QmM0BPuDa3BvdpI+9gQdwEGI6Mwt4LYNwV7xnQ9hc=; b=i5BtFI5mKlGAuGSxhti/TETmcKuo8G85Seh0LQn6o/yJF/ZcP7cpy0+eYsyJnfoCO1 0bnkpkLxHRB9zJSvHDSrbaR87bfjVwm7xDh3FTwsWCQs/02DTqYcKwoP27DxdmbtP2vk /z7RTIhG2J1n8suGet1/xUf1S6Y9v3msgaMaUZpZKKN2kAICoaGXsu/+xmARypsdHTez HSKh524uwUIxbJDw8NSFPfeRjciw5lOHXqUGlpIMmi+ePLi9eiEiRCptpiv1WUi7y5zg T4q3H6gao7IwyFXhTZLzS4f2ihU/JY2otq2YbQrJ3nzGgXRJhozM9GWwFySsjhdFQGce uRVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Xz9rd/k+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k4-20020a170902c40400b0019a6cce2068si1411784plk.172.2023.02.19.22.19.06; Sun, 19 Feb 2023 22:19:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Xz9rd/k+"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229591AbjBTGRJ (ORCPT + 99 others); Mon, 20 Feb 2023 01:17:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229930AbjBTGRB (ORCPT ); Mon, 20 Feb 2023 01:17:01 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 07B1AE3BF; Sun, 19 Feb 2023 22:16:58 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 9C90DB80AD5; Mon, 20 Feb 2023 06:16:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 25AD5C4339C; Mon, 20 Feb 2023 06:16:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1676873816; bh=pMGv4SyPGRfo0WP/fzR89zfuG2L3rq94hSEQU95SGQM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xz9rd/k+vqLfQfG/5nnow/aShk3NQ8eDrOW34XYBtLHFhdGA1kdJo+GxeIusTkfy0 6lG4xJUXdfoWby51siTH5ZznVke79q1P9/grJL1kBt3npKisp77mmxorbw7YKTT1Yh mhZaTXVOQhfhpVFgwKIfZPTCajUy9IUPWLJp1FhFtTmYJLleIPIEpqzhjIcPw9qUzr lfirAOiDUWAo/0Hjguk/PnIA2+hw6PMAkgBGWwlCFUjM5ll8h7yJkxG3K3OISU6G05 k4XPVH46ywBz+OZpKSmL0ahW2NApCDG7ekhylN6GDmufqnjsYBIx6rNZ5WA8oHVfR9 4DdDs0yJrQ3Dg== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet Cc: Saeed Mahameed , netdev@vger.kernel.org, Tariq Toukan , Eli Cohen , Ben Hutchings , Andrew Morton , David Decotigny , linux-kernel@vger.kernel.org Subject: [PATCH net-next 03/14] lib: cpu_rmap: Add irq_cpu_rmap_remove to complement irq_cpu_rmap_add Date: Sun, 19 Feb 2023 22:14:31 -0800 Message-Id: <20230220061442.403092-4-saeed@kernel.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230220061442.403092-1-saeed@kernel.org> References: <20230220061442.403092-1-saeed@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758329788983112763?= X-GMAIL-MSGID: =?utf-8?q?1758329788983112763?= 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. CC: Ben Hutchings CC: Andrew Morton CC: David Decotigny CC: Eric Dumazet CC: linux-kernel@vger.kernel.org Signed-off-by: Eli Cohen Signed-off-by: Saeed Mahameed --- include/linux/cpu_rmap.h | 2 ++ lib/cpu_rmap.c | 11 +++++++++++ 2 files changed, 13 insertions(+) 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); + #endif /* __LINUX_CPU_RMAP_H */ diff --git a/lib/cpu_rmap.c b/lib/cpu_rmap.c index e95d018e01c2..7c67e9382845 100644 --- a/lib/cpu_rmap.c +++ b/lib/cpu_rmap.c @@ -285,6 +285,17 @@ static void irq_cpu_rmap_release(struct kref *ref) kfree(glue); } +/** + * irq_cpu_rmap_remove - remove an IRQ from a CPU affinity reverse-map + * @rmap: The reverse-map + * @irq: The IRQ number + */ +int irq_cpu_rmap_remove(struct cpu_rmap *rmap, int irq) +{ + return irq_set_affinity_notifier(irq, NULL); +} +EXPORT_SYMBOL(irq_cpu_rmap_remove); + /** * irq_cpu_rmap_add - add an IRQ to a CPU affinity reverse-map * @rmap: The reverse-map