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=-2.5 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS, USER_AGENT_MUTT 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 52C68C43219 for ; Fri, 26 Apr 2019 15:38:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 2425D206E0 for ; Fri, 26 Apr 2019 15:38:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="eO9/GJ8G"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="1V4l2rJN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2425D206E0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lunn.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vHPR25XqXsOF7Tj/nn+8lCXr2e7a0HZnsnEWN+agXl0=; b=eO9/GJ8GJlMwfM XF0Dppa2g0kN2zDuuqH+nDSPmrISRqo64hHTgSEKLKnhsO3xSindiccyUuwvpsKvN/ApyGIQb77B3 8G+Ly1ONWVYqpkytuulkQaSJDydHM9KLazJbHV8Rb099V3msHensoxfUxvc6/U0zDywnSBurT+j8U y2Wei8t4RWH9ICt8MU5B7xk5UM4L833iF2CuSE3GjTrmypydZMo1pi1BthbZk/aGtIvpsXdI7rUtc O+WUyQnWo39vOtdspDkygnhtQBJr6NNoZlifwVkyD2gAexDakDlFs5a+/j28OxPilugX8/qB1mBHx 4GLGXbYWRWy2Jd35uZbQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hK2vV-0005yt-CT; Fri, 26 Apr 2019 15:38:13 +0000 Received: from vps0.lunn.ch ([185.16.172.187]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hK2vB-0005jZ-SK for linux-arm-kernel@lists.infradead.org; Fri, 26 Apr 2019 15:37:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=UvVB9YW+Vf/5xEb1JhQ4wi6DLqMa8+rWR925tLl65eQ=; b=1V4l2rJNC2XkmV+VPpYk6e05n1 yhh4hA0pIi1FbejNCY/aQODoLBKLKb/ghS6x1aPtipzeL3xTxF4PBWq0RSCGhoTl178rMUBG/3tCO nqv8I5Rr18wzSZ9q08e0MM3B0aoKA5nY5sFt/QWC5HX6uTxmIuF3BaBLaTxQkMYagiN8=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1hK2uv-000221-1a; Fri, 26 Apr 2019 17:37:37 +0200 Date: Fri, 26 Apr 2019 17:37:37 +0200 From: Andrew Lunn To: Robin Murphy Subject: Re: [PATCH 08/12] net: ll_temac: Fix iommu/swiotlb leak Message-ID: <20190426153737.GC4041@lunn.ch> References: <20190426073231.4008-1-esben@geanix.com> <20190426073231.4008-9-esben@geanix.com> <20190426142103.GI14432@lunn.ch> <0aab6152-82c6-b53f-6b9b-0905995de43a@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <0aab6152-82c6-b53f-6b9b-0905995de43a@arm.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190426_083754_064207_365EA84A X-CRM114-Status: GOOD ( 13.83 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: netdev@vger.kernel.org, Esben Haabendal , YueHaibing , Michal Simek , linux-kernel@vger.kernel.org, Yang Wei , Luis Chamberlain , "David S. Miller" , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Apr 26, 2019 at 03:43:20PM +0100, Robin Murphy wrote: > On 26/04/2019 15:21, Andrew Lunn wrote: > >On Fri, Apr 26, 2019 at 09:32:27AM +0200, Esben Haabendal wrote: > >>Unmap the actual buffer length, not the amount of data received. > > > >Hi Esben > > > >The patch Subject does not seem to match the content? > > > >Also, there can be performance advantages of just unmapping the > >received length. The unmap operation does a cache invalidate, which > >can be expensive. Consider the effort of unmapping a 64 byte ACK vs 9K > >jumbo frame? > > If the size passed to dma_unmap_*() is not the same as was passed to the > corresponding dma_map_*(), that is fundamentally incorrect use of the API > and may lead to warnings, resource exhaustion, or possibly even corruption > and crashes for some DMA API implementations. > > If there's a case where you just need to look at a small part of the buffer > right now, but can unmap the whole thing properly later. then > dma_sync_single_*() does allow operating on partial buffers. Even better, if > you're able to recycle buffers in your Rx pool you could potentially replace > the unmap/map dance altogether with some careful use of sync_single. Hi Robin Thanks for the info. I went back to the driver i was thinking of, and it is using dma_sync_single_range_for_cpu() for just the received packet length. Sorry for the mixup. Andrew _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel