vmsplice returned "bad address"
I have a driver which will dma_alloc a CMA region and return the address to my user space program, the program then will mmap /dev/mem according to the address offset. I was trying to vmsplice and splice it into my socket buffer, but the vmsplice always return "bad address". Anybody knows why? I attach my user space code for your perusal.
On Fri, 19 Aug 2016 00:19:47 +0800, Teoh Choon Zone said:
I have a driver which will dma_alloc a CMA region and return the address to my user space program, the program then will mmap /dev/mem according to the address offset.
Step 1: Figure out whether your driver is returning a physical or logical address for the CMA, and which of the two /dev/mem requires. Step 2: Take a look at the address returned and make sure it at least looks valid (is someplace the E820 map says is RAM, isn't a PCI BAR or something like that, etc etc) Those are the two biggest sources of error I can think of...
On Fri, Aug 19, 2016 at 1:32 AM, <Valdis.Kletnieks@vt.edu> wrote:
Step 1: Figure out whether your driver is returning a physical or logical address for the CMA, and which of the two /dev/mem requires.
Step 2: Take a look at the address returned and make sure it at least looks valid (is someplace the E820 map says is RAM, isn't a PCI BAR or something like that, etc etc)
Those are the two biggest sources of error I can think of...
First of all, just want to make my problem clear, the "bad address" is returned when I call vmsplice(), not mmap(). 1. I have verified the address is a physical one 2. It indeed is within the RAM range What bugs me is that write() works just fine but vmsplice() complains about the address.
participants (2)
-
Teoh Choon Zone -
Valdis.Kletnieks@vt.edu