Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3863348iog; Tue, 28 Jun 2022 04:30:05 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tRw7L2VMj0puVujvW8QVk79Or96R22ge7sOi0cRl22iR7pXmOLXQ6DMGV8YtHXqtvifH2X X-Received: by 2002:a17:906:5d08:b0:6ff:8ed:db63 with SMTP id g8-20020a1709065d0800b006ff08eddb63mr17325944ejt.408.1656415805139; Tue, 28 Jun 2022 04:30:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656415805; cv=none; d=google.com; s=arc-20160816; b=X+nFX0Quio2AZ3/HU9SBah9wv/pjTFCwYbSd/RENO6ilL2uh5OoytTe2qyTNzBjd2R CFC99/TgNz+i4nU1sI6O95LIiXfIKYTKVmstUVVKSS7fQm0Vc3lLTPcbhwt0K5KaUNqq t0mS5gLUij/sGezoelPli/gf23AxfXj50jfwaTxFLqQPG/zsfpclEDgzwQOYvwQrEJzk SV5GctRRYyWJqWfN08Z/S6GVukJApqVLyXm20MvH1W0vg+td9Fchu6B+niTvTLp7TlAF dGl1WPE1QoBe5H3doELc+fAQO7NUW2N+6zcvmDmyVYnWD5kKNz3n/GqnAFWxHEEsJrvS 8UPw== 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:subject:user-agent:mime-version:date:message-id; bh=GQQFYSY2ga8+FY/iiycLWdOB318f7RNRiRGVCGbU8rM=; b=L3VSvR6rGWca0yKuHRSUrujFmfyYXTtlVlzMPMcSGIFgUIOqJdP2EeY/BqGG96EDt3 kW1zeBYXezSBGKW4RdIg9lG9nw4CNiLArlx3pTdqb8OdYet4XMekDxYrRk/ghAsueee9 zPX737YDob4lurP78G3ampb40LB/RLltedbfc3l1vVmEL+MoOyHqIKF1rt3vorNSBfz4 oOJMWtKIYYcHHnOMpsMP29eMoHOwhAzyUtoc26nS/mjATkGndNcQ9WrALTWdYlpPmNmt jBypTSh8gssTQeGD0ot+HDRnoJD3tlgD0JmlyD4JGhdQzORZgF7N+2UovZNmrRT9fCQZ W/ww== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n1-20020a5099c1000000b0043580071f5asi10525145edb.176.2022.06.28.04.29.39; Tue, 28 Jun 2022 04:30:05 -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; 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=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345501AbiF1L2W (ORCPT + 99 others); Tue, 28 Jun 2022 07:28:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345332AbiF1L1m (ORCPT ); Tue, 28 Jun 2022 07:27:42 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F6512CDFC; Tue, 28 Jun 2022 04:27:40 -0700 (PDT) Received: from fraeml740-chm.china.huawei.com (unknown [172.18.147.206]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4LXMhd247Pz6H6w8; Tue, 28 Jun 2022 19:25:21 +0800 (CST) Received: from lhreml724-chm.china.huawei.com (10.201.108.75) by fraeml740-chm.china.huawei.com (10.206.15.221) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 28 Jun 2022 13:27:38 +0200 Received: from [10.126.174.22] (10.126.174.22) by lhreml724-chm.china.huawei.com (10.201.108.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Tue, 28 Jun 2022 12:27:37 +0100 Message-ID: Date: Tue, 28 Jun 2022 12:27:38 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.1 Subject: Re: [PATCH v4 1/5] dma-mapping: Add dma_opt_mapping_size() To: Robin Murphy , , , , , , , CC: , , , , , , References: <1656343521-62897-1-git-send-email-john.garry@huawei.com> <1656343521-62897-2-git-send-email-john.garry@huawei.com> From: John Garry In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.126.174.22] X-ClientProxiedBy: lhreml726-chm.china.huawei.com (10.201.108.77) To lhreml724-chm.china.huawei.com (10.201.108.75) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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 28/06/2022 12:23, Robin Murphy wrote: >> + >> +    size_t >> +    dma_opt_mapping_size(struct device *dev); >> + >> +Returns the maximum optimal size of a mapping for the device. Mapping >> large >> +buffers may take longer so device drivers are advised to limit total DMA >> +streaming mappings length to the returned value. > > Nit: I'm not sure "advised" is necessarily the right thing to say in > general - that's only really true for a caller who cares about > throughput of churning through short-lived mappings more than anything > else, and doesn't take a significant hit overall from splitting up > larger requests. I do think it's good to clarify the exact context of > "optimal" here, but I'd prefer to be objectively clear that it's for > workloads where the up-front mapping overhead dominates. Ok, sure, I can make that clear. Thanks, John