Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761042AbXEKPnD (ORCPT ); Fri, 11 May 2007 11:43:03 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757671AbXEKPmz (ORCPT ); Fri, 11 May 2007 11:42:55 -0400 Received: from mtagate2.de.ibm.com ([195.212.29.151]:31538 "EHLO mtagate2.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757409AbXEKPmy (ORCPT ); Fri, 11 May 2007 11:42:54 -0400 Date: Fri, 11 May 2007 18:42:51 +0300 From: Muli Ben-Yehuda To: David Miller Cc: maheshk@cdac.in, linux-kernel@vger.kernel.org, kernelnewbies@nl.linux.org Subject: Re: [HOWTO] accessing the DMA mapped data Message-ID: <20070511154251.GJ4523@rhun.ibm.com> References: <4642FFA7.4040303@cdac.in> <20070510.043233.08323827.davem@davemloft.net> <464304DD.9070600@cdac.in> <20070510.044732.38321699.davem@davemloft.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20070510.044732.38321699.davem@davemloft.net> User-Agent: Mutt/1.5.11 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1633 Lines: 34 On Thu, May 10, 2007 at 04:47:32AM -0700, David Miller wrote: > From: Mahesh > Date: Thu, 10 May 2007 17:11:17 +0530 > > > Hi, > You haven't given an example of where this might actually > > happen. > > The driver is where the DMA mappings almost always > > occur because > that is the layer that knows the bus technology and > > therefore > the correct DMA interfaces to call. > > What kind of > > driver do you have and what is this upper layer > doing the mappings > > for you but not giving you a pointer to > the kernel buffer as well? > > > Here I am dealing with a infiniband (see www.openfabrics.org) > > network device driver. The layer above the driver is the standard > > infiniband core interface. Now I have a situation where I need to > > peek into the packets and do some modifications(some hacking). So I > > just want know whether I can access the original data region using > > the bus address generated by the dma_map_single. > > You can't, therefore you need to ask the Inifiniband guys to perhaps > tweak the infiniband driver interfaces so that you can get at the > buffer or provide some other mechanism by which you can accomplish > what you're trying to do. AFAICR the ipath driver had the same problem, which resulted in the addition of ib specific DMA-API wrappers. See usage of struct ipath_dma_mapping_ops in ipath_dma.c. Cheers, Muli - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/