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 D8E54C001E0 for ; Wed, 2 Aug 2023 11:36:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233244AbjHBLg1 (ORCPT ); Wed, 2 Aug 2023 07:36:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233373AbjHBLgZ (ORCPT ); Wed, 2 Aug 2023 07:36:25 -0400 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E1729211E; Wed, 2 Aug 2023 04:36:20 -0700 (PDT) Received: from dggpemm500005.china.huawei.com (unknown [172.30.72.53]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4RG8zS3ndtz1GDP2; Wed, 2 Aug 2023 19:35:16 +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.27; Wed, 2 Aug 2023 19:36:18 +0800 Subject: Re: [PATCH net-next 5/9] page_pool: don't use driver-set flags field directly To: Alexander Lobakin CC: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Maciej Fijalkowski , Larysa Zaremba , Alexander Duyck , Jesper Dangaard Brouer , Ilias Apalodimas , Simon Horman , , References: <20230727144336.1646454-1-aleksander.lobakin@intel.com> <20230727144336.1646454-6-aleksander.lobakin@intel.com> <6f8147ec-b8ad-3905-5279-16817ed6f5ae@intel.com> <0fe906a2-5ba1-f24a-efd8-7804ef0683b6@intel.com> From: Yunsheng Lin Message-ID: <03124fbf-1b47-99e1-d9a5-a9251890f6e7@huawei.com> Date: Wed, 2 Aug 2023 19:36:17 +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: <0fe906a2-5ba1-f24a-efd8-7804ef0683b6@intel.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.69.30.204] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) 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/8/1 21:36, Alexander Lobakin wrote: >> >> It just seems odd to me that dma_map and page_frag is duplicated as we >> seems to have the same info in the page_pool->p.flags. > > It's just because we copy the whole &page_pool_params passed by the > driver. It doesn't look good to me to define a new structure and copy > the values field-by-field just to avoid duplicating 3 bits :s > >> >> What about: >> In [PATCH net-next 4/9] page_pool: shrink &page_pool_params a tiny bit, >> 'flags' is bit-field'ed with 'dma_dir', what about changing 'dma_dir' >> to be bit-field'ed with 'dma_sync_act', so that page_pool->p.flags stays >> the same as before, and 'dma_map' & 'page_frag' do not seems be really >> needed as we have the same info in page_pool->p.flags? > > Not sure I follow :z ::dma_dir is also passed by the driver, so we can't > drop it from the params struct. My bad, I missed that dma_dir is in the params struct.