-----Original Message----- From: Momchil Velikov [mailto:velco@fadata.bg] Sent: Thursday, March 25, 2004 3:19 PM To: Mandeep Singh Sandhu Subject: Re: PCI DMA mapping question >>>>> "Mandeep" == Mandeep Singh Sandhu <mandeep_sandhu@infosys.com> writes: Mandeep> if i'm allocating by transmit and recieve buffers, Mandeep> for my ethernet driver, using pci_alloc_consistent Mandeep> then do i need to establish bounce buffers as well Mandeep> in case i get a mapping in a non-DMA zone?? Mandeep> but in Rubini's book it's written - "Allocation is Mandeep> handled in this function so that the buffer will be Mandeep> placed in a location that works with DMA..." That function checks the device addressing capabilities. It assumes that if a device can be addressed in a region with certain characteristics then *IT* can also address any region with the same characteristics. For example, if a device requested to be accessible for MMIO in a region under 1M, the kernel assumes that the device itself can address any region under 1M, thus it allocates page(s) with GFP_DMA set. Mandeep> so then do i need to keep bounce buffers?? I'm not sure what's the exact meaning of ``bounce buffer''. I tend to think that these ARE the bounce buffers (as opposed to having potentially larger buffers elsewhere or locking user pages for doing DMA to them). Mandeep> then it says that the allocation uses GFP_ATOMIC Mandeep> priority, shud'nt it use the GFP_DMA priority instead Mandeep> to ensure the addresses are allocated in the DMA zone?? GFP_ATOMIC and GPF_DMA are independent and can be set at once. GFP_ATOMIC means ``don't sleep'' (which, btw, is by no means ``atomic''), GPF_DMA means ``allocate under 1M''. ~velco -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/