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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 55F29C43602 for ; Tue, 30 Jun 2026 10:59:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=zVcUQdwaM8qyVs3S066Z6bUF9JdLFQ241GRmQEjh5pA=; b=s+cNkJWcQucCzG LKpEP7WJfzC7yQwD2nkFLHu7lXzGdhAK3S/YcLAT6GirXJuOt3FXgE4Vvwv1cj3LzKQHWoZWJVFcW uEzo2NkCPNMVm9zvyTLl/ELMXz49ONJEQc0lZEA/xfMwcG0asEIvquJGhqRyi4ZOBATz/0GzQb5bp p4P2R2tSlHv4Tt65N2QWZOKsPZKZZMrvatOx71lr5DnvmN8/3CMpM0j2Q3tQYvIENM2nyGBW4H/2I KX531NhtZnOst8rH6DW5MALSB0aayKsFdg9SwMDd3I4XRhb29HoYWIjlhgfS33VhR9nnF2tCkgae2 Ril+8t2wtF9u7pj/pnZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.99.1 #2 (Red Hat Linux)) id 1weWBn-0000000GkCu-059e; Tue, 30 Jun 2026 10:59:39 +0000 Received: from sea.source.kernel.org ([172.234.252.31]) by bombadil.infradead.org with esmtps (Exim 4.99.1 #2 (Red Hat Linux)) id 1weWBm-0000000GkC1-1JXh; Tue, 30 Jun 2026 10:59:38 +0000 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id DD18941711; Tue, 30 Jun 2026 10:59:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 403D61F00A3D; Tue, 30 Jun 2026 10:59:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1782817177; bh=KN3v4O8jkhd6Mt2HpgZaziumJD8qk36FkI+IylasYd4=; h=From:Date:Subject:References:In-Reply-To:To:Cc; b=MXQEF3aHWSiWNFSvYXHU4R7tW6cLU800PWaoSIs368VJxA7phfv+Es8c+cLkEeAW6 N+cXvy7GWxnDbC1bFm9jgfCrZuJ7NcmOzPRxV0f8rFe0NonrUKVi/oDpm1r0R9GiMH cFOmtV0Vf+osCftv3+z9BekM2fYxe3pkef2/XzhRaonSJCjH2k1BUQb+abz3ksERB5 ID+PK5GmcE2FHvH8VaVrrDkXHHS9PnbWWtmKluZc/es6TuUdTPfONxggTOYT41WBK/ yoD9s2qt4xuVYdBtBHU1XDZGLStlv3wqrZawLDg0DkelNXb1Y5TLnaXGaGmtkKIZNf utF9NJfRkg01A== From: "Mike Rapoport (Microsoft)" Date: Tue, 30 Jun 2026 13:59:21 +0300 Subject: [PATCH net-next 2/8] bnx2x: use kzalloc() to allocate mac filtering list MIME-Version: 1.0 Message-Id: <20260630-b4-drivers-net-v1-2-672162a91f37@kernel.org> References: <20260630-b4-drivers-net-v1-0-672162a91f37@kernel.org> In-Reply-To: <20260630-b4-drivers-net-v1-0-672162a91f37@kernel.org> To: Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Brian Norris , Edward Cree , Francesco Dolcini , Manish Chopra , Mike Rapoport , Przemek Kitszel , Sudarsana Kalluru , Tony Nguyen , b43-dev@lists.infradead.org, intel-wired-lan@lists.osuosl.org, libertas-dev@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-net-drivers@amd.com, linux-wireless@vger.kernel.org, netdev@vger.kernel.org X-Mailer: b4 0.15.2 X-BeenThere: b43-dev@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: b43/b43legacy Linux driver discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "b43-dev" Errors-To: b43-dev-bounces+b43-dev=archiver.kernel.org@lists.infradead.org bnx2x_mcast_enqueue_cmd() allocates memory for mac filtering list using __get_free_pages(). This memory can be allocated with kzalloc() as there's nothing special about it to go directly to the page allocator. kmalloc() provides a better API that does not require ugly casts and kfree() does not need to know the size of the freed object. Performance difference between kmalloc() and __get_free_pages() is not measurable as both allocators take an object/page from a per-CPU list for fast path allocations. For the slow path the performance is anyway determined by the amount of reclaim involved rather than by what allocator is used. Replace use of __get_free_page() with kzalloc() and free_page() with kfree(). Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com Signed-off-by: Mike Rapoport (Microsoft) --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c index 07a908a2c72f..d560524d317d 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "bnx2x.h" #include "bnx2x_cmn.h" #include "bnx2x_sp.h" @@ -2664,7 +2665,7 @@ static void bnx2x_free_groups(struct list_head *mcast_group_list) struct bnx2x_mcast_elem_group, mcast_group_link); list_del(¤t_mcast_group->mcast_group_link); - free_page((unsigned long)current_mcast_group); + kfree(current_mcast_group); } } @@ -2713,8 +2714,7 @@ static int bnx2x_mcast_enqueue_cmd(struct bnx2x *bp, total_elems = BNX2X_MCAST_BINS_NUM; } while (total_elems > 0) { - elem_group = (struct bnx2x_mcast_elem_group *) - __get_free_page(GFP_ATOMIC | __GFP_ZERO); + elem_group = kzalloc(PAGE_SIZE, GFP_ATOMIC); if (!elem_group) { bnx2x_free_groups(&new_cmd->group_head); kfree(new_cmd); -- 2.53.0 _______________________________________________ b43-dev mailing list b43-dev@lists.infradead.org http://lists.infradead.org/mailman/listinfo/b43-dev