Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4747943rdb; Tue, 12 Dec 2023 08:15:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/l6I+BRfOQoF+vxpBJ5J2Jc//1hzhuBShpv3u7jO5LFvYcRIBj5VAoj2RoOgpyjX441mF X-Received: by 2002:a17:90a:7286:b0:285:ade0:86de with SMTP id e6-20020a17090a728600b00285ade086demr4729058pjg.12.1702397731239; Tue, 12 Dec 2023 08:15:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702397731; cv=none; d=google.com; s=arc-20160816; b=bJyzdbCO83d4i/ua7BNvx3y6nDbU6o8BTK1ZPGVkVsj37oq0dJPw9+lCKAPjr1W/+x ajds8e/ML3k4VGqWSgj9bsmTohytC+xAU35ZrHNrKUi+i41ivuotOMK2JdrK3ajK9lFw gj69VU9r0iRo3ErevlltOkZeaqeKtQ01122guTFlIKAfxFkDnhCQmNMmEiB8+aK64zaM /axDcu6zBuePK+TkV6vQK3+WnGJJJ+lelYSzXCkN3mqQ8w2WHUTa/SgSIk6LTmODDHGT pILOBPWVdF77NqTF4oXdeebKgsmTsK9foEAb+i8u4jqnvVCubp48xRZ2Rev/n8WFhqZ2 0+Kw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=KPkDhdP4e0RTH+GCxFA+29duj+Ltr9LIDpgourkAuzM=; fh=3FW5VGrIzBiSotjP/oGCW07XA3z4tx30vQ/sJKxtkJ0=; b=L03EkIBAHxoi6EreXJ43qaawNxHCGphJpnJ8f0xWhXdtmg5ZxvKNlHg1dxZO50HowH vpYuiflCsfhW1/shlomS+vom+987qGPEf0L71cOBhibWzXeZxJELHoOe+fRJlJbUIQfp 87qqEjHCMdLmc5nA7BjtnE+D4WvCoGjEQUmt1lUTViufu56DHtaxIf58379IGHHteuTA +wfZCxjcg/GhQyfkMuVoY1FTpIyzfQp7FVSAYLiofA5D8rv+10SWHrE/Oxtn2M6AdXb5 hDX63Nn8oK7bzEreLFU5RsuWqz+lPSU0taMyO1svtLjWjIxF2QECigicjOIn5oJ4GVQa o8hg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qu8huz3q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id pf6-20020a17090b1d8600b0028881bb2b5bsi9418707pjb.188.2023.12.12.08.15.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 08:15:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Qu8huz3q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 9C23E80832CD; Tue, 12 Dec 2023 08:15:14 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346513AbjLLQOn (ORCPT + 99 others); Tue, 12 Dec 2023 11:14:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232529AbjLLQOl (ORCPT ); Tue, 12 Dec 2023 11:14:41 -0500 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C241C3 for ; Tue, 12 Dec 2023 08:14:47 -0800 (PST) Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-50bf4f97752so7539173e87.1 for ; Tue, 12 Dec 2023 08:14:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1702397685; x=1703002485; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=KPkDhdP4e0RTH+GCxFA+29duj+Ltr9LIDpgourkAuzM=; b=Qu8huz3qDNXQuAS3jiHRXJVteK1Yka9mxHuQTDhH0dCKi2eQBGg5H3HvbPeCQfj/Fv w27s4P46hwPQ4CXFofsp0busdTLemi0gda22GlM+TY3UCiBXBxQtF75QO5Q3TL2wkxvN /MbQx7/kOto3szeagvSZrEQEPifgJhTMzolK7Hng11PXO7YiJiMXxTpz9a4DI/ovkkb1 NeoNwgk4d+Ndmawb5GQrav7r8zbVQwxwCzlrCX7ZUSpFde+xcqOTajmHVue/MUrTELSW MHc2EgfW6Oy6XIVKwzfhHUTOx5orjxUPxHTNoAlxUK1q2utKn5Hdz85U1b9jHn6AzBji YETw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702397685; x=1703002485; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=KPkDhdP4e0RTH+GCxFA+29duj+Ltr9LIDpgourkAuzM=; b=l03IftRaOamrnDI12SUdSGmYUSLx2WccGpe/3owD06qwfxCHJFdgvCGNGDLwmm6im9 ElktMwxO2ieFcRPEAeg7dedImmVNXZnj7qxHZb3Qi74DYd7Im40+qkQusZDYx8IXM/Hi Vx6k8beZOdTwni+5wfJphq8N47p+zZAROC6EEDm4yzIPL/r4x9gFTgU3gY4p1xgEPZ8N ARXWHtvCHEQJ+z+A3Q42P9VXV8L+R08QoOzzqFcTvNIzBPSD6lAkfcRy16CqLVs2lL04 JDPYCGnlLyly5OGkFlKOJ/QWWFuaja/K2SgXGrQaX0EiqlacrUsqODkTGIrvP8ByGeZz Uinw== X-Gm-Message-State: AOJu0Yxg/PLtCvUsdzCoHU8sorCwzPr5WNuRghd3pnpssTwWkXNaOn4C fzWMwU66k2qkOAq8Je8SpqLYKxB/mxIktXFlBtTR5A== X-Received: by 2002:a05:6512:108c:b0:50c:fd2:df1a with SMTP id j12-20020a056512108c00b0050c0fd2df1amr3778283lfg.78.1702397685556; Tue, 12 Dec 2023 08:14:45 -0800 (PST) MIME-Version: 1.0 References: <20231207172010.1441468-1-aleksander.lobakin@intel.com> <20231207172010.1441468-7-aleksander.lobakin@intel.com> In-Reply-To: <20231207172010.1441468-7-aleksander.lobakin@intel.com> From: Ilias Apalodimas Date: Tue, 12 Dec 2023 18:14:09 +0200 Message-ID: Subject: Re: [PATCH net-next v6 06/12] page_pool: constify some read-only function arguments To: Alexander Lobakin Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maciej Fijalkowski , Michal Kubiak , Larysa Zaremba , Alexander Duyck , Yunsheng Lin , David Christensen , Jesper Dangaard Brouer , Paul Menzel , netdev@vger.kernel.org, intel-wired-lan@lists.osuosl.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Tue, 12 Dec 2023 08:15:14 -0800 (PST) Apologies for the noise, Resending without HTML On Thu, 7 Dec 2023 at 19:22, Alexander Lobakin wrote: > > There are several functions taking pointers to data they don't modify. > This includes statistics fetching, page and page_pool parameters, etc. > Constify the pointers, so that call sites will be able to pass const > pointers as well. > No functional changes, no visible changes in functions sizes. > > Signed-off-by: Alexander Lobakin > --- > include/net/page_pool/helpers.h | 10 +++++----- > net/core/page_pool.c | 8 ++++---- > 2 files changed, 9 insertions(+), 9 deletions(-) > > diff --git a/include/net/page_pool/helpers.h b/include/net/page_pool/helpers.h > index 7dc65774cde5..c860fad50d00 100644 > --- a/include/net/page_pool/helpers.h > +++ b/include/net/page_pool/helpers.h > @@ -58,7 +58,7 @@ > /* Deprecated driver-facing API, use netlink instead */ > int page_pool_ethtool_stats_get_count(void); > u8 *page_pool_ethtool_stats_get_strings(u8 *data); > -u64 *page_pool_ethtool_stats_get(u64 *data, void *stats); > +u64 *page_pool_ethtool_stats_get(u64 *data, const void *stats); > > bool page_pool_get_stats(const struct page_pool *pool, > struct page_pool_stats *stats); > @@ -73,7 +73,7 @@ static inline u8 *page_pool_ethtool_stats_get_strings(u8 *data) > return data; > } > > -static inline u64 *page_pool_ethtool_stats_get(u64 *data, void *stats) > +static inline u64 *page_pool_ethtool_stats_get(u64 *data, const void *stats) > { > return data; > } > @@ -204,8 +204,8 @@ static inline void *page_pool_dev_alloc_va(struct page_pool *pool, > * Get the stored dma direction. A driver might decide to store this locally > * and avoid the extra cache line from page_pool to determine the direction. > */ > -static > -inline enum dma_data_direction page_pool_get_dma_dir(struct page_pool *pool) > +static inline enum dma_data_direction > +page_pool_get_dma_dir(const struct page_pool *pool) > { > return pool->p.dma_dir; > } > @@ -357,7 +357,7 @@ static inline void page_pool_free_va(struct page_pool *pool, void *va, > * Fetch the DMA address of the page. The page pool to which the page belongs > * must had been created with PP_FLAG_DMA_MAP. > */ > -static inline dma_addr_t page_pool_get_dma_addr(struct page *page) > +static inline dma_addr_t page_pool_get_dma_addr(const struct page *page) > { > dma_addr_t ret = page->dma_addr; > > diff --git a/net/core/page_pool.c b/net/core/page_pool.c > index 59aca3339222..4295aec0be40 100644 > --- a/net/core/page_pool.c > +++ b/net/core/page_pool.c > @@ -121,9 +121,9 @@ int page_pool_ethtool_stats_get_count(void) > } > EXPORT_SYMBOL(page_pool_ethtool_stats_get_count); > > -u64 *page_pool_ethtool_stats_get(u64 *data, void *stats) > +u64 *page_pool_ethtool_stats_get(u64 *data, const void *stats) > { > - struct page_pool_stats *pool_stats = stats; > + const struct page_pool_stats *pool_stats = stats; > > *data++ = pool_stats->alloc_stats.fast; > *data++ = pool_stats->alloc_stats.slow; > @@ -360,8 +360,8 @@ static struct page *__page_pool_get_cached(struct page_pool *pool) > return page; > } > > -static void page_pool_dma_sync_for_device(struct page_pool *pool, > - struct page *page, > +static void page_pool_dma_sync_for_device(const struct page_pool *pool, > + const struct page *page, > unsigned int dma_sync_size) > { > dma_addr_t dma_addr = page_pool_get_dma_addr(page); > -- > 2.43.0 > Reviewed-by: Ilias Apalodimas