Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp4261419rwd; Sun, 11 Jun 2023 04:12:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5OxUFguZllPMXIIU2Lrs7k1XfeSzK81Q599PIluNt4bOPcOhlPN58VmriQrehZi2KIutaU X-Received: by 2002:a05:6a00:14c9:b0:654:3dac:f107 with SMTP id w9-20020a056a0014c900b006543dacf107mr7857857pfu.4.1686481966932; Sun, 11 Jun 2023 04:12:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686481966; cv=none; d=google.com; s=arc-20160816; b=uLN22ygUaBC89dApzg2acOv28WgxElXpYQmMv+Q6DNPgYRzqOb56w6JhVydgO9RgHz fVwaTr0Km/KcjuYYvRbdw97F4DujAfvOmpEPu5zbIfHCqg/vpHYxYHJ9Ff2h5aX7b/Bg 4W04Du4DQfdFrybehAb5LKX62jDRSG1ouTDGR4ew587lZSo8ZUrduO1FG1MFmSrQJZ4Q bAfD8y0jZUuEzud4d0qPRwL81g1CDM+mUzu5vCj/0iZS+rL7cchAYIyy06qvjSsbA2UM iyp3CBYoDVTGru8sGZmEwmjNp/eKsy5YDhu5nVzxX4qDqYRnFTSa3CYvkZkp88wFATrP luHA== 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 :content-language:references:to:subject:cc:user-agent:mime-version :date:message-id:from:dkim-signature; bh=j68gTnjgXVwXYZVMYqrbKZ59sLTdFoJLwLEaM6oQtU0=; b=FVQyt3ILnmET2IfS92iZFTlc5hBsns67sdsvFadOmAUQu+NZubtAh/1l1lWZYVAp3K LAYctjmVcnt137A0Fa3TjX3CwEfnLCAGTEKTYgDzsTy0UvbSfbRJJjmvNSy8sq1u8hw+ MuGfe9Sz5PoWcFx7Q0IxFRpmeV53DO3AwWuMqIDQv+qjI86U4S0SAGluDNQ0CNBoHDN2 Fb8QNgW3lafyMCVfiC1ctGt0VPHD739htvwv/Kyvq7KC4fIJxqfAvooKFx2jYVcE8a68 Uhrht7SBjGKTm17KTKE4KhHTvKdItKXNZd2Dh72cTRsEMOa/T9zKMEKSu9MKnVgesDol m4rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=gkVcopoL; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f21-20020a637555000000b0052c37cb5116si5345050pgn.435.2023.06.11.04.12.35; Sun, 11 Jun 2023 04:12:46 -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=@redhat.com header.s=mimecast20190719 header.b=gkVcopoL; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231268AbjFKKsh (ORCPT + 99 others); Sun, 11 Jun 2023 06:48:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229720AbjFKKsf (ORCPT ); Sun, 11 Jun 2023 06:48:35 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9C1E0173A for ; Sun, 11 Jun 2023 03:47:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1686480467; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=j68gTnjgXVwXYZVMYqrbKZ59sLTdFoJLwLEaM6oQtU0=; b=gkVcopoLdRPQNeCHRSTFc7g4kYf9VE4hgSuXmn7bq/9UTdmAQirc5/Qxy31QbRmP81N7rs bGhs2HqE1ITPFywFe/ImO9P0B1fmwMfeOnqlAbM6wGcNdYmCTT74YhgNcQOXekucrgVwcg c+91SQy/HVesmatvLzmozDIL9nnxmnM= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-646-fbDcIieQOSutatTMFW27IQ-1; Sun, 11 Jun 2023 06:47:46 -0400 X-MC-Unique: fbDcIieQOSutatTMFW27IQ-1 Received: by mail-ed1-f70.google.com with SMTP id 4fb4d7f45d1cf-51495d51e0fso2616463a12.2 for ; Sun, 11 Jun 2023 03:47:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686480465; x=1689072465; h=content-transfer-encoding:in-reply-to:content-language:references :to:subject:cc:user-agent:mime-version:date:message-id:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=j68gTnjgXVwXYZVMYqrbKZ59sLTdFoJLwLEaM6oQtU0=; b=PbaqDgrkpCawXPwf0xQEm/WATxGg5O1R4SxvGU39YvJoErQrNJmOQkqgORLPr3YZ2K R9qJxVHdhnNEu4HRPRHqX0CjG9kd8KnZrMmT+MwfrWodQlAn2fsTDGVy2MJq7yhstaVu ZCpnx0bFhb4EqL/V0L0abPIjnOA1CfqMP3hqJusMlDaIPn4woqiVphxBs3xuCo9+GeqD X7EkUCry2K+t0agScsoI2MR5IEbGmuE7YarwwEMv94cmaEWJRVkchmO/iBqeB08/y/nt Q7qGRrVMHvTNstvczZ5JachtquBX6ToUvdU/JZuJlxOZVDYP8BSPekDdiXfWX++eHjd6 thSg== X-Gm-Message-State: AC+VfDynkuX0/1Jgbx3Qbx81IrmL0IrRPRJ4UQLMhZGR58O/RRk/frG+ uR7t54mCa9ISbD6NxgiixsJXO/X940QOPpTzK829pFUd9lv9rQBBHTc1njzO+fNSIDylr371qQh HxUaVLyxIBG3aiVXt44giOIeb X-Received: by 2002:aa7:c6c3:0:b0:516:7b3f:545d with SMTP id b3-20020aa7c6c3000000b005167b3f545dmr2758976eds.30.1686480464914; Sun, 11 Jun 2023 03:47:44 -0700 (PDT) X-Received: by 2002:aa7:c6c3:0:b0:516:7b3f:545d with SMTP id b3-20020aa7c6c3000000b005167b3f545dmr2758964eds.30.1686480464613; Sun, 11 Jun 2023 03:47:44 -0700 (PDT) Received: from [192.168.42.222] (194-45-78-10.static.kviknet.net. [194.45.78.10]) by smtp.gmail.com with ESMTPSA id w8-20020aa7cb48000000b0051632dc69absm3776418edt.86.2023.06.11.03.47.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 11 Jun 2023 03:47:43 -0700 (PDT) From: Jesper Dangaard Brouer X-Google-Original-From: Jesper Dangaard Brouer Message-ID: <2c48652e-ace4-45c8-7a7d-5ec87d1b0b75@redhat.com> Date: Sun, 11 Jun 2023 12:47:42 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Cc: brouer@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Lorenzo Bianconi , Alexander Duyck , Saeed Mahameed , Leon Romanovsky , Eric Dumazet , Jesper Dangaard Brouer , Ilias Apalodimas , linux-rdma@vger.kernel.org Subject: Re: [PATCH net-next v3 1/4] page_pool: frag API support for 32-bit arch with 64-bit DMA To: Yunsheng Lin , Jesper Dangaard Brouer , Yunsheng Lin , davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com References: <20230609131740.7496-1-linyunsheng@huawei.com> <20230609131740.7496-2-linyunsheng@huawei.com> <4f1a0b7d-973f-80f5-cc39-74f09622ccef@redhat.com> <1bbf2afa-91b2-a3d0-60e0-81cd386eb68d@gmail.com> Content-Language: en-US In-Reply-To: <1bbf2afa-91b2-a3d0-60e0-81cd386eb68d@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.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_NONE,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE, SPF_NONE,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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/06/2023 15.13, Yunsheng Lin wrote: > On 2023/6/9 23:02, Jesper Dangaard Brouer wrote: > ... > >>>                    PP_FLAG_DMA_SYNC_DEV |\ >>>                    PP_FLAG_PAGE_FRAG) >>>   +#define PAGE_POOL_DMA_USE_PP_FRAG_COUNT    \ >>> +        (sizeof(dma_addr_t) > sizeof(unsigned long)) >>> + >> >> I have a problem with the name PAGE_POOL_DMA_USE_PP_FRAG_COUNT >> because it is confusing to read in an if-statement. > > Actually, it is already in an if-statement before this patch:) I did notice, but I've had a problem with this name for a while. (see later, why this might be long in separate patch) > Maybe starting to use it in the driver is confusing to you? > If not, maybe we can keep it that for now, and change it when > we come up with a better name. > >> >> Proposals rename to:  DMA_OVERLAP_PP_FRAG_COUNT >>  Or:  MM_DMA_OVERLAP_PP_FRAG_COUNT >>  Or:  DMA_ADDR_OVERLAP_PP_FRAG_COUNT > > It seems DMA_ADDR_OVERLAP_PP_FRAG_COUNT is better, > and DMA_ADDR_UPPER_OVERLAP_PP_FRAG_COUNT seems more accurate if a > longer macro name is not an issue here. > I like the shorter DMA_ADDR_OVERLAP_PP_FRAG_COUNT variant best. >> >> Notice how I also removed the prefix PAGE_POOL_ because this is a >> MM-layer constraint and not a property of page_pool. > > I am not sure if it is a MM-layer constraint yet. > Do you mean 'MM-layer constraint' as 'struct page' not having > enough space for page pool with 32-bit arch with 64-bit DMA? Yes. > If that is the case, we may need a more generic name for that > constraint instead of 'DMA_ADDR_OVERLAP_PP_FRAG_COUNT'? > I think this name is clear enough; the dma_addr_t is overlapping the pp_frag_count. > And a more generic name seems confusing for page pool too, as > it doesn't tell that we only have that problem for 32-bit arch > with 64-bit DMA. > > So if the above makes sense, it seems we may need to keep the > PAGE_POOL_ prefix, which would be > 'PAGE_POOL_DMA_ADDR_UPPER_OVERLAP_PP_FRAG_COUNT' if the long > name is not issue here. > I think it gets too long now. Also I still disagree with PAGE_POOL_ prefix, if anything it is a property of 'struct page'. Thus a prefix with PAGE_ make more sense to me, but it also gets too long (for my taste). > Anyway, naming is hard, we may need a seperate patch to explain > it, which is not really related to this patchset IHMO, so I'd > rather keep it as before if we can not come up with a name which > is not confusing to most people. > Okay, lets do the (re)naming in another patch then. --Jesper