Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 791E2257A for ; Tue, 28 Jun 2022 11:27:41 +0000 (UTC) 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 Precedence: bulk X-Mailing-List: iommu@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: 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 Message-ID: <20220628112738.Ku7IYxMmW_JnoVItD9NAnA7ijdaQFjU9Dc3sLPRbwY4@z> 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