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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4DD0EE7D0AF for ; Thu, 21 Sep 2023 22:27:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231578AbjIUW1D (ORCPT ); Thu, 21 Sep 2023 18:27:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35862 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233344AbjIUW0R (ORCPT ); Thu, 21 Sep 2023 18:26:17 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B4BEBA0F4F; Thu, 21 Sep 2023 10:57:03 -0700 (PDT) Received: from dggpemm500005.china.huawei.com (unknown [172.30.72.54]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Rrv5n1mB5z15NQt; Thu, 21 Sep 2023 19:57:17 +0800 (CST) Received: from [10.69.30.204] (10.69.30.204) by dggpemm500005.china.huawei.com (7.185.36.74) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.31; Thu, 21 Sep 2023 19:59:24 +0800 Subject: Re: [PATCH net-next v9 5/6] page_pool: update document about frag API To: Dima Tisnek CC: , , , , , Lorenzo Bianconi , Alexander Duyck , Liang Chen , Alexander Lobakin , Jesper Dangaard Brouer , Ilias Apalodimas , Eric Dumazet , Jonathan Corbet , Alexei Starovoitov , Daniel Borkmann , John Fastabend , , References: <20230920115855.27631-1-linyunsheng@huawei.com> <20230920115855.27631-6-linyunsheng@huawei.com> From: Yunsheng Lin Message-ID: Date: Thu, 21 Sep 2023 19:59:23 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.69.30.204] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To dggpemm500005.china.huawei.com (7.185.36.74) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2023/9/21 9:02, Dima Tisnek wrote: > Minor comment on natural language: > > On Wed, Sep 20, 2023 at 9:04 PM Yunsheng Lin wrote: >> >> As more drivers begin to use the frag API, update the >> document about how to decide which API to use for the >> driver author. > > the fragment API > >> +/** >> + * page_pool_dev_alloc_frag() - allocate a page frag. > > allocate a page fragment. > > the precedent is set in > https://www.kernel.org/doc/html/v5.0/vm/page_frags.html > foo_frag is used in C code, and foo fragment in English docs. Sure. It seems I need to respin anyway as the newly merged idpf driver from intel is also using the frag API, and removing PP_FLAG_PAGE_FRAG flag breaks it. And idpf driver really should be using the new API instead of selecting which API to use according to the buf_size as below in drivers/net/ethernet/intel/idpf/idpf_txrx.h, as it seems to be assuming PAGE_SIZE always being 4K, and we may be able to enable page split for buf_size > 2048 and PAGE_SIZE > 4K if using the new API. static inline dma_addr_t idpf_alloc_page(struct page_pool *pool, struct idpf_rx_buf *buf, unsigned int buf_size) { if (buf_size == IDPF_RX_BUF_2048) buf->page = page_pool_dev_alloc_frag(pool, &buf->page_offset, buf_size); else buf->page = page_pool_dev_alloc_pages(pool); if (!buf->page) return DMA_MAPPING_ERROR; buf->truesize = buf_size; return page_pool_get_dma_addr(buf->page) + buf->page_offset + pool->p.offset; } > > . >