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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8261CC19759 for ; Thu, 1 Aug 2019 14:05:49 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5F2F920838 for ; Thu, 1 Aug 2019 14:05:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5F2F920838 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id A45D0156C; Thu, 1 Aug 2019 14:04:30 +0000 (UTC) Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 3C1792626 for ; Thu, 1 Aug 2019 14:00:50 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by smtp1.linuxfoundation.org (Postfix) with ESMTPS id 05712821 for ; Thu, 1 Aug 2019 14:00:48 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id B3CAF68AFE; Thu, 1 Aug 2019 16:00:45 +0200 (CEST) Date: Thu, 1 Aug 2019 16:00:45 +0200 From: Christoph Hellwig To: Lucas Stach Subject: Re: large DMA segments vs SWIOTLB Message-ID: <20190801140045.GA23435@lst.de> References: <1564584029.7267.15.camel@pengutronix.de> <20190801072958.GA16178@lst.de> <1564648502.7267.27.camel@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1564648502.7267.27.camel@pengutronix.de> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: iommu@lists.linux-foundation.org, Christoph Hellwig , Konrad Rzeszutek Wilk X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: iommu-bounces@lists.linux-foundation.org Errors-To: iommu-bounces@lists.linux-foundation.org On Thu, Aug 01, 2019 at 10:35:02AM +0200, Lucas Stach wrote: > Hi Christoph, > > Am Donnerstag, den 01.08.2019, 09:29 +0200 schrieb Christoph Hellwig: > > Hi Lukas, > > > > have you tried the latest 5.3-rc kernel, where we limited the NVMe > > I/O size based on the swiotlb buffer size? > > Yes, the issue was reproduced on 5.3-rc2. I now see your commit > limiting the request size, so I guess I need to dig in to see why I'm > still getting requests larger than the SWIOTLB max segment size. Thanks > for the pointer! a similar setup to yours the dma_addressing_limited doesn't work, but if we changed it to a <= it does. The result is counter to what I'd expect, but because I'm on vacation I didn't have time to look into why it works. This is his patch, let me know if this works for you: diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index f7d1eea32c78..89ac1cf754cc 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -689,7 +689,7 @@ static inline int dma_coerce_mask_and_coherent(struct device *dev, u64 mask) */ static inline bool dma_addressing_limited(struct device *dev) { - return min_not_zero(dma_get_mask(dev), dev->bus_dma_mask) < + return min_not_zero(dma_get_mask(dev), dev->bus_dma_mask) <= dma_get_required_mask(dev); } _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu