Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp469623iob; Wed, 18 May 2022 06:15:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxqcbQTH41u+wrnwTIGoQe8vM9zDdfSmyAoLOMt/5k53dcLzG48O3DvE5FHaTizjOCYBsuH X-Received: by 2002:a17:90b:364f:b0:1df:6e51:e2a3 with SMTP id nh15-20020a17090b364f00b001df6e51e2a3mr13399140pjb.26.1652879707924; Wed, 18 May 2022 06:15:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652879707; cv=none; d=google.com; s=arc-20160816; b=Go4pqthQYVK8d95S6bP8eCRV7qnPYoWqNOgbTvdDvyhb9D6AYHeR2Re7Fq3Fpx+ngs OpWqyihebAbw87iuM8LKnvDM/Nq0Unm03EUBET7RrsSsgJJu1/K/M6sXCAIbJ6ElI2hN zXVVCDLA84IM9HSviGwv0QtqdpRHeiDl8p6OWEiz5Ba3IEe8ub0v6jtbG/+40L8Dx/tc aT8qLKiGZarCLRq7R+Q9xyJpdIPxDdAEsVGb4ynQL9qpEwybcQOp4iQKypNZr1apt+l7 C70JeDNBBIZvbzXRsyPzExZ2fNW6P6kgrYEicmuzLwJ4m4TukCkYJtst5gTMEnL4eejX LagA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=VfTuGdkhen0TUAVrjOJrhqDWTXx1IZx/Jtkh3hEor9c=; b=aBIE1WrPiRb09663m9/g8ijfft63rol88ZCgGYGrNwN+AH7sHWN+OnSS20ZabUxRZh p6E5KEH1JM0RCBWHpJ50PKCfwAOAipYIrhDeb0A32C77rQrO+JwPZJ/Ebktl0EZ/qhjd zPGd+029ReI1ALw7VwxZe3OwPEw0AZgX6ZrFHrMdShrZ/HjmwZjnGt02o3myfYBAmJHB RlDkUGSkYntirrq2sAOnTZaFtezNhcmUT5DM1A1MPW70jmIWQY1Jx+EM+5V0VAk0DbaA iZBHk/RRZdeJUiFZvmoOY7EXAfv4YWVBPT+w4TMqXrFwh5tgWAwvbHbGdJle9dmRvKi+ Cg0A== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id r26-20020a63fc5a000000b003aa65024928si2346914pgk.224.2022.05.18.06.15.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 May 2022 06:15:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 084C710AA; Wed, 18 May 2022 06:14:14 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237546AbiERNN6 (ORCPT + 99 others); Wed, 18 May 2022 09:13:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53740 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237454AbiERNN5 (ORCPT ); Wed, 18 May 2022 09:13:57 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A32801B0924 for ; Wed, 18 May 2022 06:13:56 -0700 (PDT) Received: by verein.lst.de (Postfix, from userid 2407) id 9033A68AFE; Wed, 18 May 2022 15:13:53 +0200 (CEST) Date: Wed, 18 May 2022 15:13:53 +0200 From: Christoph Hellwig To: Robin Murphy Cc: John Garry , joro@8bytes.org, will@kernel.org, hch@lst.de, m.szyprowski@samsung.com, chenxiang66@hisilicon.com, thunder.leizhen@huawei.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, liyihang6@hisilicon.com Subject: Re: [RFC PATCH] dma-iommu: Add iommu_dma_max_mapping_size() Message-ID: <20220518131353.GB26019@lst.de> References: <1652706361-92557-1-git-send-email-john.garry@huawei.com> <9160031b-50be-6993-5a8e-f238391962c5@huawei.com> <8f193bdd-3a0a-f9ed-0726-e6081f374320@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8f193bdd-3a0a-f9ed-0726-e6081f374320@arm.com> User-Agent: Mutt/1.5.17 (2007-11-01) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Tue, May 17, 2022 at 01:02:00PM +0100, Robin Murphy wrote: >> So how to inform the SCSI driver of this caching limit then so that it may >> limit the SGL length? > > Driver-specific mechanism; block-layer-specific mechanism; redefine this > whole API to something like dma_opt_mapping_size(), as a limit above which > mappings might become less efficient or start to fail (callback to my > thoughts on [1] as well, I suppose); many options. Just not imposing a > ridiculously low *maximum* on everyone wherein mapping calls "should not be > larger than the returned value" when that's clearly bollocks. Well, for swiotlb it is a hard limit. So if we want to go down that route we need two APIs, one for the optimal size and one for the hard limit.