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 C9EF0C43458 for ; Wed, 1 Jul 2026 17:01:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 7E24B60E63; Wed, 1 Jul 2026 17:01:42 +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 OJHHrU2unhVb; Wed, 1 Jul 2026 17:01:41 +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 B64616153F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=osuosl.org; s=default; t=1782925301; bh=9CayLh9sn6SyGJSkLYj3J5jM0EP4cWj8SDd1cZ9x18Y=; h=Date:To:Cc:References:From:In-Reply-To:Subject:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=Th4fGolO9bWK59G1EtEDHd/19DB9Q7I+ZgIL1xpo2RtZEcRKMdfjcFSvmIhsUEslm AFlYkk42BpoZhLA1KJb6n05IHesnAwbzfzr/LRl6fEef4iQvmB6bjOoZ4EYHlho8iK HjnrtTm5AjNRJzano0NAO7aanBJ/8txT+geeA3Pp1YpcFtqEjziTI0JXsuslWL15mU Qy5hzzryuOS3JKL0cafBJNqjlzGTomWuWwHFTepMLg8ChQNVRVC8FVvh5rydjTEMix 4Z39pPJHKhT+2J0aY1vnFgb64hMY7FixY/l9JrUKSwcXaumCVg24OItxQrmNB4FZPc opfgRSwxcoxuw== Received: from lists1.osuosl.org (lists1.osuosl.org [140.211.166.142]) by smtp3.osuosl.org (Postfix) with ESMTP id B64616153F; Wed, 1 Jul 2026 17:01:41 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by lists1.osuosl.org (Postfix) with ESMTP id 832F22EB for ; Wed, 1 Jul 2026 17:01:40 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id 68F916153F for ; Wed, 1 Jul 2026 17:01:40 +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 iAlmG4zbWohk for ; Wed, 1 Jul 2026 17:01:39 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2a00:1450:4864:20::32c; helo=mail-wm1-x32c.google.com; envelope-from=ecree.xilinx@gmail.com; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp3.osuosl.org 28E4660E63 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 28E4660E63 Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by smtp3.osuosl.org (Postfix) with ESMTPS id 28E4660E63 for ; Wed, 1 Jul 2026 17:01:39 +0000 (UTC) Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-493b27c7451so20719715e9.0 for ; Wed, 01 Jul 2026 10:01:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782925297; x=1783530097; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9CayLh9sn6SyGJ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0XgyYiTYHl4znLZdtAHeZOt9Tr3zrVrZM+gkBy45tBCH3eoC8YXgbmb2Z5yam5dEhIRA3Gvj Wg= X-Received: by 2002:a05:600c:4685:b0:490:af63:2cb1 with SMTP id 5b1f17b1804b1-493c231f913mr37259535e9.7.1782925296780; Wed, 01 Jul 2026 10:01:36 -0700 (PDT) Received: from [192.168.1.122] (cpc159313-cmbg20-2-0-cust161.5-4.cable.virginm.net. [82.0.78.162]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493be4bfd47sm122822645e9.2.2026.07.01.10.01.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Jul 2026 10:01:36 -0700 (PDT) Message-ID: Date: Wed, 1 Jul 2026 18:01:35 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird To: "Mike Rapoport (Microsoft)" , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Manish Chopra , Paolo Abeni Cc: Przemek Kitszel , Sudarsana Kalluru , Tony Nguyen , intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-net-drivers@amd.com, netdev@vger.kernel.org References: <20260701-b4-drivers-ethernet-v1-0-58776615db6e@kernel.org> <20260701-b4-drivers-ethernet-v1-3-58776615db6e@kernel.org> Content-Language: en-GB From: Edward Cree In-Reply-To: <20260701-b4-drivers-ethernet-v1-3-58776615db6e@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1782925297; x=1783530097; darn=lists.osuosl.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9CayLh9sn6SyGJSkLYj3J5jM0EP4cWj8SDd1cZ9x18Y=; b=RJYjS6Cp6Kjgun050pITyfxbmB8CgdL/u90v1KNdmFb5pVLLjkqbeqiX5QAbGkZCpm W+3B3L8ETxN27DkUiUNIhN8nqDY2sbTzX9QDmZmt2+VNHBjG2AfJaNldLgCmlJJW8aeT NYDUQRplzUIldvh3KimQVEbGqBQxPE39wOydkLoCxo+OCPIBik2OQbNo5gzqjKyJIQxI A4jSGRRvq8prz3cNYWedD2mHX9V9K/nxYuarvF7eql95ZFAWooEaeU6Jn653RIWLRbmX Xgt/qwjdlHCsgy1DvUi3ZCfpj3ZwGTy2hIQwR8T1FIcE990A959Ib2vG9aio9Q59pEIo Ctxg== X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dmarc=pass (p=none dis=none) header.from=gmail.com X-Mailman-Original-Authentication-Results: smtp3.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=RJYjS6Cp Subject: Re: [Intel-wired-lan] [PATCH 3/4] sfc/siena: use kmalloc() to allocate logging buffer 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 01/07/2026 14:57, Mike Rapoport (Microsoft) wrote: > efx_siena_mcdi_init() allocates a logging buffer for MCDI firmware > communication diagnostics. > > This buffer can be allocated with kmalloc() 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 kmalloc() and free_page() with > kfree(). > > Link: https://lore.kernel.org/all/635405e4-9423-4a25-a6e7-e03c8ea0bcbe@redhat.com > Signed-off-by: Mike Rapoport (Microsoft) Reviewed-by: Edward Cree (resending since I hit 'reply' instead of 'reply all' the first time) > --- > drivers/net/ethernet/sfc/siena/mcdi.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/ethernet/sfc/siena/mcdi.c b/drivers/net/ethernet/sfc/siena/mcdi.c > index 4d0d6bd5d3d1..048c1e6017c0 100644 > --- a/drivers/net/ethernet/sfc/siena/mcdi.c > +++ b/drivers/net/ethernet/sfc/siena/mcdi.c > @@ -7,6 +7,7 @@ > #include > #include > #include > +#include > #include "net_driver.h" > #include "nic.h" > #include "io.h" > @@ -73,7 +74,7 @@ int efx_siena_mcdi_init(struct efx_nic *efx) > mcdi->efx = efx; > #ifdef CONFIG_SFC_SIENA_MCDI_LOGGING > /* consuming code assumes buffer is page-sized */ > - mcdi->logging_buffer = (char *)__get_free_page(GFP_KERNEL); > + mcdi->logging_buffer = kmalloc(PAGE_SIZE, GFP_KERNEL); > if (!mcdi->logging_buffer) > goto fail1; > mcdi->logging_enabled = efx_siena_mcdi_logging_default; > @@ -116,7 +117,7 @@ int efx_siena_mcdi_init(struct efx_nic *efx) > return 0; > fail2: > #ifdef CONFIG_SFC_SIENA_MCDI_LOGGING > - free_page((unsigned long)mcdi->logging_buffer); > + kfree(mcdi->logging_buffer); > fail1: > #endif > kfree(efx->mcdi); > @@ -142,7 +143,7 @@ void efx_siena_mcdi_fini(struct efx_nic *efx) > return; > > #ifdef CONFIG_SFC_SIENA_MCDI_LOGGING > - free_page((unsigned long)efx->mcdi->iface.logging_buffer); > + kfree(efx->mcdi->iface.logging_buffer); > #endif > > kfree(efx->mcdi); >