I am writing a user space MAC driver in Linux 2.6.23 hosted on a Arm11 mpcore. A contiguous block of physical memory is allocated and mmap'd to userspace.
/dev/mem with O_SYNC flag is used to mmap so that the user virtual memory is uncached (with no much benefit).
kptr = kmalloc(sz, GFP_DMA|GFP_KERNEL);
pptr = __pa(kptr);
fd = open("/dev/mem", O_RDWR|O_SYNC);
uptr = mmap(0, sz, PROT_READ|PROT_WRITE, MAP_SHARED|MAP_LOCKED,fd, pptr);
The map'd user virtual memory is carved into network buffers and used for DMA.The MAC is successfully able to DMA ethernet frames to the physical memory. From the Rx interrupt handler bh (kernel logical memory) the frames received could be viewed and the cache functions also work fine. However, the mmap'd memory in user space does not reflect the changes.
Why is the physical memory mapped to user virtual does not reflect the chages ?
Or any suggestions on what could be going wrong here ?
Deb Rupam Banerjee
P.S: Please note that all buffer alignment's are taken care of.
- Readers' Choice Awards 2013
- December 2013 Issue of Linux Journal: Readers' Choice
- IBM Will Minimize Impact of Future Disasters
- Raspberry Pi: the Perfect Home Server
- Sublime Text: One Editor to Rule Them All?
- RSS Feeds
- Linux Systems Administrator
- Tech Tip: Really Simple HTTP Server with Python
- Senior Perl Developer
- Technical Support Rep
- Reply to comment | Linux Journal
3 hours 31 min ago
- It's Jupiter
4 hours 31 min ago
- GIMP is certainly a graphic
5 hours 33 min ago
- Thanks For Your Sharing
10 hours 19 min ago
- Studying linux, and looking
13 hours 44 min ago
- voting for Best Linux Distribution
22 hours 11 min ago
- tizen vs android
1 day 2 hours ago
- i switch my choice from KDE
1 day 2 hours ago
1 day 5 hours ago
- Belanja Online
1 day 8 hours ago