Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2503563rdb; Fri, 8 Dec 2023 09:56:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IFNgW+3O4Dm5wU8kYK4JEcEUHbRNh6D1oPVEV+cHiB7EU2lcZBVS+hNF3CdNDdanwvSqpGa X-Received: by 2002:a17:90b:1188:b0:286:6cc0:b92b with SMTP id gk8-20020a17090b118800b002866cc0b92bmr351033pjb.98.1702058215523; Fri, 08 Dec 2023 09:56:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702058215; cv=none; d=google.com; s=arc-20160816; b=I0D5oI8TAZTe96DojzhfUWwKh3LKjuMXd4t8yTFpmGCTVXyfFYuOafsvFyniEwJUSy zgGiIE+Ni1Mqy41aWZPLESNXwztWgxrhppOBrKfOhiq4pZTV1Fe3SL5alYPdEh3wlUW1 QRvvbFfKhUM3IiTefuU8IPPA7ISAqyBhCh+WldE2TJg0kHyYlrcZ2kGRhkv3t/pq0+Wc IunVukbmq4cc++tHna3YEHBDlUw+vE+YgpkCGh77Kdrinqvwv+kQvhLo1h2O5D6oQy5+ fxLk4wnkmLPk4xSZYnDFbDmBKGIE/0WX/1r9Efe4uZk/0NWtS3jw4zquckwhEzyLlLhZ zp/g== 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:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=yUCRAqpFIUqLl91hY2Q8NZfn8m4Xm/wBkCBouKSoXQM=; fh=p8jzhi3KzDNvYqIjTsAbouWLEIcpxVNmda4fGrgl9Gg=; b=EQ9V22pXZRPLkolXt8eKDmM0kslBa2memzTWP83Cxf7DIe1hhVHqTvJh19yWC9pdUt d77E6/Q7Y/4HYXtXfxBROzQhnjhHJp1DNV3c0SCSy4qi+ZuBCyA1+QbRc2JO3boiTbBS ATFpop8Nze8OCy3oXUOTCqnl+AuZdG3NHRU/5P7PgO9qUPKfKUjYoa12HMYhmr9/wGRF BPkWZU2bwb73r4qhaAej9eH3rJHWIp24WIS0v6uRSAh83L1HL5prkTOV7VfS6sS2uRUH U26gRACh9ta9GoNEeTgwkmdt3PxKNvFjVZ70Uy+HtHwBBMAFbX5WOsfwtYmIDl2OH3UZ 5VuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=KktLrsaH; 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=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id ce5-20020a17090aff0500b00285a0b546eesi1901682pjb.155.2023.12.08.09.56.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 09:56:55 -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=@kernel.org header.s=k20201202 header.b=KktLrsaH; 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=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 013DF819D225; Fri, 8 Dec 2023 09:56:53 -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 S233795AbjLHR4j (ORCPT + 99 others); Fri, 8 Dec 2023 12:56:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235946AbjLHR4f (ORCPT ); Fri, 8 Dec 2023 12:56:35 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF527198D for ; Fri, 8 Dec 2023 09:56:40 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6A69DC433C8; Fri, 8 Dec 2023 17:56:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702058200; bh=9xxAbGXzLKVinje/1qrTMCGO6En/seWuAJ9zKs2OvRo=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=KktLrsaHMqHuSdviPwgKD8eaGdxnuIIA4B6K6LyNeKKK7EhZ2jsE5y2g0PbAlQLer 5AZD+X8hVBf/pb6iCzYpjpO1mYT0e5phnU3CUE6Ye44qGWVDkbiSW1wIJ01RKfpqH1 aIsWiOCHUl+yjhU69kpDY6WMx48AuAE3yhIXC1chevQQLoEBFmjqiEysAoA2jweMb9 EmhyG8e1p62psBESzHBntY1HPYMm/o6U/cZsY2Jw/gG5H1OkQdrGgZc5bezgme0n3P vdBkZN5APkNeAlIxu6r+1QD1FytYmVy1OGPCUGxcdSSgAwFdHKWNbrN/KOExS72/Km KOcx35phxF+6w== Message-ID: <462da4bf-34f8-40c4-8772-9850b3127baf@kernel.org> Date: Fri, 8 Dec 2023 10:56:39 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [net-next v1 07/16] netdev: netdevice devmem allocator Content-Language: en-US To: Mina Almasry , Shailend Chand , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, linux-kselftest@vger.kernel.org, bpf@vger.kernel.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Jonathan Corbet , Jeroen de Borst , Praveen Kaligineedi , Jesper Dangaard Brouer , Ilias Apalodimas , Arnd Bergmann , Willem de Bruijn , Shuah Khan , Sumit Semwal , =?UTF-8?Q?Christian_K=C3=B6nig?= , Yunsheng Lin , Harshitha Ramamurthy , Shakeel Butt , Willem de Bruijn , Kaiyuan Zhang References: <20231208005250.2910004-1-almasrymina@google.com> <20231208005250.2910004-8-almasrymina@google.com> From: David Ahern In-Reply-To: <20231208005250.2910004-8-almasrymina@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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]); Fri, 08 Dec 2023 09:56:53 -0800 (PST) On 12/7/23 5:52 PM, Mina Almasry wrote: > diff --git a/net/core/dev.c b/net/core/dev.c > index b8c8be5a912e..30667e4c3b95 100644 > --- a/net/core/dev.c > +++ b/net/core/dev.c > @@ -2120,6 +2120,41 @@ static int netdev_restart_rx_queue(struct net_device *dev, int rxq_idx) > return err; > } > > +struct page_pool_iov *netdev_alloc_dmabuf(struct netdev_dmabuf_binding *binding) > +{ > + struct dmabuf_genpool_chunk_owner *owner; > + struct page_pool_iov *ppiov; > + unsigned long dma_addr; > + ssize_t offset; > + ssize_t index; > + > + dma_addr = gen_pool_alloc_owner(binding->chunk_pool, PAGE_SIZE, Any reason not to allow allocation sizes other than PAGE_SIZE? e.g., 2048 for smaller MTUs or 8192 for larger ones. It can be a property of page_pool and constant across allocations vs allowing different size for each allocation.