Received: by 2002:a05:7412:bb8d:b0:d7:7d3a:4fe2 with SMTP id js13csp1805171rdb; Thu, 17 Aug 2023 02:33:23 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFC0JyFQTpGh7tcd7xiheVxMVV+zqf2Q/LA0wfo0uPM4gkDQMZlYiC4Qht/X9gYWmCv06Ee X-Received: by 2002:a17:906:390b:b0:99b:e6c3:f6b0 with SMTP id f11-20020a170906390b00b0099be6c3f6b0mr4272987eje.62.1692264802936; Thu, 17 Aug 2023 02:33:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692264802; cv=none; d=google.com; s=arc-20160816; b=FU94tQ2Xz73cb8MmPCRQbM7s7siKzb75XATzqsJFnVYSK7a+NA/KREfCmyN8eAGrWh 2LXByV1XBjZKBZmhOQNhnGaT8oqbsDFG4kuODCK83KWQ4gytbMPAnUBD9t2QmQwrs5oq yvS3DVYb0wnYZJ8lG+ExqZ2DVIYHiSOGZ9QNb5H24IZPDAqYAbnK39tgWdQwc/6fjN3O m+YfHu73x5lTiIMemw8MdQX2k7S+OERxhF6afbeMyvY9O1XgF54GgTqVQHZJRt6diE5/ 2WHXWM+oG+oFG4jo2qJu+Ojvw9kmH1KRvxvzD5omKDpL2liUOT7v4VpMJe67PIMEJh4x GSjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:cc:user-agent:mime-version :date:message-id:dkim-signature; bh=s53BoN2woMP3ra+jbC1Qd4XWFmyGWm2hahLUWsX5DlU=; fh=DFJpZtKE81RlRK+IJbQ2NOGuEKFSYbkl+KOLeM0BAfk=; b=tZXC5wHNsv5vaxbpRrdwaHGqpjD4WefrIJkIjn41TlM0Lvsrd2MCN+1ZxGPd5jq8iO kigmtEv+5CXX7fm7slHPs08gOTOEilLeAIf5LiwHDnRkOfhBJEgcpDQy8/2qrIiCdLWc UTzaMYkMuoukhpAmnaEFpsy6cRv3lH9kLvGoiBQ7A86141AvTMSvNrkrcoaOMhZSznS0 Nd3rTThNyeTYwWN3SUpe+Pi3KyDxsv9s691A020FYM1sgKlLm8BHA2a4Y2FcRA25nNss N9l/iUzFYRwixXzxng+W5CiUOUPlziGvitdFqxZURyVu/rqmqKHs2q40zDGxJ8XTEnP8 lI1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Kegzqopz; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h24-20020a17090634d800b00988da9cd05csi12985534ejb.23.2023.08.17.02.32.58; Thu, 17 Aug 2023 02:33:22 -0700 (PDT) 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=Kegzqopz; 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 S235701AbjHOImN (ORCPT + 99 others); Tue, 15 Aug 2023 04:42:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235510AbjHOIl6 (ORCPT ); Tue, 15 Aug 2023 04:41:58 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0630010F for ; Tue, 15 Aug 2023 01:41:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 92B7A617E6 for ; Tue, 15 Aug 2023 08:41:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA94FC433C7; Tue, 15 Aug 2023 08:41:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692088916; bh=WqQoOnB/jc8Ton23ktHqTDSvzOIg7daMCkV5SRI4gPM=; h=Date:Cc:Subject:To:References:From:In-Reply-To:From; b=KegzqopzoNJ3z0MXzToUFtlYs73e60whma4YHay7nEuhv6CqbmvVEVZsYukjEo0k1 3oiwWcBeKrx4SVHyPvTgnCNI+SKL4KvBa7Q5T0l1g+86y5f10LccrcSSrKnMzcEmZ2 i242c7r5Zig+XQNiqYIpZquKDc4U43oJrsyhm/FX31sQ00rwAYJC9tOQZWuS3Tjc8L 1fVYK/u0kvv2XrDj8ajBqGKc2A5J+OKISGVDYEmvRgKJlzkHNZXAT44RbkyUAhqInY PNlqiXsYQ3bPAYEBElAEoaXyoP6+O2b1iqklhrw4wnY7Kafj6nEW2pZ1l0CClausIm skkqbr0EyhcrQ== Message-ID: <110797fb-fea6-cb4d-af3c-4665e8246479@kernel.org> Date: Tue, 15 Aug 2023 10:41:52 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Cc: kuba@kernel.org, pabeni@redhat.cm, edumazet@google.com, aleksander.lobakin@intel.com, hawk@kernel.org, sgoutham@marvell.com, gakula@marvell.com, sbhatta@marvell.com, hkelam@marvell.com Subject: Re: [PATCH v1 net] octeontx2-pf: fix page_pool creation fail for rings > 32k Content-Language: en-US To: Ratheesh Kannoth , netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230814132411.2475687-1-rkannoth@marvell.com> From: Jesper Dangaard Brouer In-Reply-To: <20230814132411.2475687-1-rkannoth@marvell.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, 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 On 14/08/2023 15.24, Ratheesh Kannoth wrote: > octeontx2 driver calls page_pool_create() during driver probe() > and fails if queue size > 32k. Page pool infra uses these buffers > as shock absorbers for burst traffic. These pages are pinned > down as soon as page pool is created. It isn't true that "pages are pinned down as soon as page pool is created". We need to improve this commit text. My suggestion: These pages are pinned down over time as working sets varies, due to the recycling nature of page pool, given page pool (currently) don't have a shrinker mechanism, the pages remain pinned down in ptr_ring. > As page pool does direct > recycling way more aggressivelyi, often times ptr_ring is left ^ Typo (my suggestion already covers recycling) > unused at all. Instead of clamping page_pool size to 32k at > most, limit it even more to 2k to avoid wasting memory on much > less used ptr_ring. I would adjust and delete "much less used". I assume you have the octeontx2 hardware available (which I don't). Can you test that this adjustment to 2k doesn't cause a performance regression on your hardware? And then produce a statement in the commit desc like: This have been tested on octeontx2 hardware (devel board xyz). TCP and UDP tests using netperf shows not performance regressions. 2K with page_size 4KiB is around 8MiB if PP gets full. It would be convincing if commit message said e.g. PP pool_size 2k can maximum pin down 8MiB per RX-queue (assuming page size 4K), but that is okay as systems using octeontx2 hardware often have many GB of memory. > > Fixes: b2e3406a38f0 ("octeontx2-pf: Add support for page pool") > Suggested-by: Alexander Lobakin > Signed-off-by: Ratheesh Kannoth > > --- > > ChangeLogs: > > v0->v1: Commit message changes. > --- > --- > drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c | 2 +- > drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 2 ++ > 2 files changed, 3 insertions(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c > index 77c8f650f7ac..fc8a1220eb39 100644 > --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c > +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c > @@ -1432,7 +1432,7 @@ int otx2_pool_init(struct otx2_nic *pfvf, u16 pool_id, > } > > pp_params.flags = PP_FLAG_PAGE_FRAG | PP_FLAG_DMA_MAP; > - pp_params.pool_size = numptrs; > + pp_params.pool_size = OTX2_PAGE_POOL_SZ; > pp_params.nid = NUMA_NO_NODE; > pp_params.dev = pfvf->dev; > pp_params.dma_dir = DMA_FROM_DEVICE; > diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h > index ba8091131ec0..f6fea43617ff 100644 > --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h > +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h > @@ -30,6 +30,8 @@ > #include > #include "qos.h" > > +#define OTX2_PAGE_POOL_SZ 2048 > + > /* IPv4 flag more fragment bit */ > #define IPV4_FLAG_MORE 0x20 >