From mboxrd@z Thu Jan 1 00:00:00 1970 From: Shamir Rabinovitch Subject: Re: [PATCH v1 2/2] dma-mapping-common: add DMA attribute - DMA_ATTR_IOMMU_BYPASS Date: Sun, 1 Nov 2015 09:45:34 +0200 Message-ID: <20151101074534.GC23022@shamir-ThinkPad-T430> References: <1445789224-28032-1-git-send-email-shamir.rabinovitch@oracle.com> <1445789224-28032-2-git-send-email-shamir.rabinovitch@oracle.com> <1446013801.3405.183.camel@infradead.org> <20151028111049.GA30785@shamir-ThinkPad-T430> <1446039110.3405.212.camel@infradead.org> <1446078721.1856.49.camel@kernel.crashing.org> <1446079332.3405.273.camel@infradead.org> <1446081046.1856.55.camel@kernel.crashing.org> <1446158125.4471.5.camel@infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1446158125.4471.5.camel@infradead.org> Sender: linux-doc-owner@vger.kernel.org To: David Woodhouse Cc: Andy Lutomirski , Benjamin Herrenschmidt , Christian Borntraeger , linux-arch , Paolo Bonzini , Martin Schwidefsky , "linux-doc@vger.kernel.org" , Sebastian Ott , linux-s390 , Cornelia Huck , Joerg Roedel , Jonathan Corbet , KVM , Arnd Bergmann , Christoph Hellwig List-Id: linux-arch.vger.kernel.org On Thu, Oct 29, 2015 at 10:35:25PM +0000, David Woodhouse wrote: > > > > Could this be mitigated using pools? I don't know if the net code > > would play along easily. > > For the receive side, it shouldn't be beyond the wit of man to > introduce an API which allocates *and* DMA-maps a skb. Pass it to > netif_rx() still mapped, with a destructor that just shoves it back in > a pool for re-use. > > Doing it for transmit might be a little more complex, but perhaps still > possible. Not sure this use case is possible for Infiniband where application hold the data buffers and there is no way to force application to re use the buffer as suggested. This is why I think there will be no easy way to bypass the DMA mapping cost for all use cases unless we allow applications to request bypass/pass through DMA mapping (implicitly or explicitly). > > -- > dwmw2 > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aserp1040.oracle.com ([141.146.126.69]:20207 "EHLO aserp1040.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750972AbbKAHqe (ORCPT ); Sun, 1 Nov 2015 02:46:34 -0500 Date: Sun, 1 Nov 2015 09:45:34 +0200 From: Shamir Rabinovitch Subject: Re: [PATCH v1 2/2] dma-mapping-common: add DMA attribute - DMA_ATTR_IOMMU_BYPASS Message-ID: <20151101074534.GC23022@shamir-ThinkPad-T430> References: <1445789224-28032-1-git-send-email-shamir.rabinovitch@oracle.com> <1445789224-28032-2-git-send-email-shamir.rabinovitch@oracle.com> <1446013801.3405.183.camel@infradead.org> <20151028111049.GA30785@shamir-ThinkPad-T430> <1446039110.3405.212.camel@infradead.org> <1446078721.1856.49.camel@kernel.crashing.org> <1446079332.3405.273.camel@infradead.org> <1446081046.1856.55.camel@kernel.crashing.org> <1446158125.4471.5.camel@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1446158125.4471.5.camel@infradead.org> Sender: linux-arch-owner@vger.kernel.org List-ID: To: David Woodhouse Cc: Andy Lutomirski , Benjamin Herrenschmidt , Christian Borntraeger , linux-arch , Paolo Bonzini , Martin Schwidefsky , "linux-doc@vger.kernel.org" , Sebastian Ott , linux-s390 , Cornelia Huck , Joerg Roedel , Jonathan Corbet , KVM , Arnd Bergmann , Christoph Hellwig Message-ID: <20151101074534.XzMXzDBY9gPMJaT3UbOjwYu3sutsKAluFACL6CPbGuU@z> On Thu, Oct 29, 2015 at 10:35:25PM +0000, David Woodhouse wrote: > > > > Could this be mitigated using pools? I don't know if the net code > > would play along easily. > > For the receive side, it shouldn't be beyond the wit of man to > introduce an API which allocates *and* DMA-maps a skb. Pass it to > netif_rx() still mapped, with a destructor that just shoves it back in > a pool for re-use. > > Doing it for transmit might be a little more complex, but perhaps still > possible. Not sure this use case is possible for Infiniband where application hold the data buffers and there is no way to force application to re use the buffer as suggested. This is why I think there will be no easy way to bypass the DMA mapping cost for all use cases unless we allow applications to request bypass/pass through DMA mapping (implicitly or explicitly). > > -- > dwmw2 >