Received: by 10.192.165.148 with SMTP id m20csp217890imm; Fri, 20 Apr 2018 05:48:01 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+McaH6N2bdqJ1IfucHiUECwsBZNTIPsiQX5UTR9yKbtNGq90vkluTzmMTgrKHXc1MNYi7h X-Received: by 10.98.78.21 with SMTP id c21mr9552243pfb.107.1524228481785; Fri, 20 Apr 2018 05:48:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524228481; cv=none; d=google.com; s=arc-20160816; b=mMkjBZahT2ZVnXDHQ4iJptcMmRrx9MGN/K4us6EXkqmxGvVgWg0XqmAAmgATn7EaPf JOGu7AFh9vrBzaTAreh+iFf2GJEKUDlW16ZQVzBe2EOiWMOTeiNa1NwrwJFR2Q080ybu 3kP9QAFa0xVae8xwUwi/JT/nypuF3n2a12axF+UUg7idfvhFb4FAGuVrCY8kd29u2HdY CNNmCxe3XE8VftF7aRBECVOhGAD6QNA2di6V2ABjske9CmfaCbfwHwcc8Mkgm09bnPe5 +MTg5yhiWU//cvMOG1rSWDKzrILmZDOg2QATL94u9A5QNYvC7s2WFWrqgUBvUU7yGKjC eryQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=jRHjlEIKi/tajjYeog2IUuRjGBi1wutnv4q1ZlgB+7I=; b=Co4zET2RQS7RnlgPhNwLr0DfTmUbFjhtHEkKKLKvRzYx6ASTV69NuGNf0fof06iEv2 GL9xwlxLFPu8qyozRoPbSkX8oqo1aDgLnEJlf+8oBTCPD7/gXaaJLwCrGXqEMzwaML4E 64HBgEhts2w9spN7ce/AJSZn16yC5L2eNrhBnLBseUdXwqGdYyAAUvxbMLnltMvTxxpM ldMhHd3orO8NYHZSSkQQzG1drpOtZ/cDyMAH3h5SYhxHlPswDKQVbxg3G8MtzC6FZNJh ERppTAa1uVmW4vvxh97MWeFPaBA7aE2q/NnVjFfWMTYxrNTstUpcwq50Wr0V8Mhrj4Zd UHXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Rq9xMT+o; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a12si5437617pfd.235.2018.04.20.05.47.46; Fri, 20 Apr 2018 05:48:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=Rq9xMT+o; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754791AbeDTMqb (ORCPT + 99 others); Fri, 20 Apr 2018 08:46:31 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:50082 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754686AbeDTMq3 (ORCPT ); Fri, 20 Apr 2018 08:46:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Transfer-Encoding :Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To: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=jRHjlEIKi/tajjYeog2IUuRjGBi1wutnv4q1ZlgB+7I=; b=Rq9xMT+ottcKGMg0xbs168mS6U Vm/Yko56If+0xrWgMBIaRuuWJ6sH2CsppbA904cFI6BfmN0EF2KM6PTG6PhOOO8jfwbcvmms4FII0 zCe3zRLkH6r30T205+LBrGSknjTmWT12VoMghksTZaCflqzNx3QKf7OAWe0RXwIPO9bK40IqX7sl1 GdzGZYoZk14X1sJNaaCH4gAfDY6rpqjCRgZeT4o9+b0/4XeKBvKkj6z8D4CvhEnLrrskKmAj1fTaU OZE552aRqHcHw6nyMk4JMo+WaZY+D2FQSxIE1ZjqAbRi5/MmJfZxnhaFxyN6Fx+42WC/jMas7TIoT zMrj3U+g==; Received: from hch by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1f9VQn-0001L4-Aw; Fri, 20 Apr 2018 12:46:25 +0000 Date: Fri, 20 Apr 2018 05:46:25 -0700 From: Christoph Hellwig To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: Christoph Hellwig , Jerome Glisse , "moderated list:DMA BUFFER SHARING FRAMEWORK" , "open list:DMA BUFFER SHARING FRAMEWORK" , dri-devel , amd-gfx list , Linux Kernel Mailing List , Logan Gunthorpe , Dan Williams Subject: Re: [PATCH 4/8] dma-buf: add peer2peer flag Message-ID: <20180420124625.GA31078@infradead.org> References: <20180403090909.GN3881@phenom.ffwll.local> <20180403170645.GB5935@redhat.com> <20180403180832.GZ3881@phenom.ffwll.local> <20180416123937.GA9073@infradead.org> <20180419081657.GA16735@infradead.org> <20180420071312.GF31310@phenom.ffwll.local> <3e17afc5-7d6c-5795-07bd-f23e34cf8d4b@gmail.com> <20180420101755.GA11400@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 20, 2018 at 12:44:01PM +0200, Christian K?nig wrote: > > > What we need is an sg_alloc_table_from_resources(dev, resources, > > > num_resources) which does the handling common to all drivers. > > A structure that contains > > > > {page,offset,len} + {dma_addr+dma_len} > > > > is not a good container for storing > > > > {virt addr, dma_addr, len} > > > > no matter what interface you build arond it. > > Why not? I mean at least for my use case we actually don't need the virtual > address. If you don't need the virtual address you need scatterlist even list. > What we need is {dma_addr+dma_len} in a consistent interface which can come > from both {page,offset,len} as well as {resource, len}. Ok. > What I actually don't need is separate handling for system memory and > resources, but that would we get exactly when we don't use sg_table. At the very lowest level they will need to be handled differently for many architectures, the questions is at what point we'll do the branching out.