Mapping memory between kernel and user space
YOUNGWHAN SONG
breadncup at gmail.com
Fri Feb 11 07:42:00 EST 2011
Hi Sri,
On Feb 10, 2011, at 11:56 AM, Sri Ram Vemulpali wrote:
> Hi Santosa,
>
> Can you please be more explicit. I do manage buffers internally in
> my module.
> Some cases if it full I will lose data. Can you please provide more
> detailed explanation
> on how to approach this. Thanks.
>
> --Sri
>
> On Wed, Feb 9, 2011 at 10:21 PM, Mulyadi Santosa
> <mulyadi.santosa at gmail.com> wrote:
>> On Thu, Feb 10, 2011 at 06:45, Sri Ram Vemulpali
>> <sri.ram.gmu06 at gmail.com> wrote:
>>> Hi all,
>>>
>>> How do I map some space between kernel and user space. Can anyone
>>> point me in to right direction. I was trying to map the packets from
>>> my netfilter function to kernel user space, to avoid over head of
>>> copying. Thanks in advance.
Isn't it possible if your driver supports mmap? Have you checked it out in Linux Kernel Drive chapter 15?
>>
>> Not trying to discourage you, but I assume your "filtering" function
>> will be engaged many many times in the case of rapid traffic...thus,
>> the buffer might grow rapidly too, right? In that case, are you sure
>> direct mapping could cope with it? Well unless you're ready to loose
>> some data .....
>>
>> Anyway, I think you can do that by reserve the buffer in user space
>> and the get_user_page() them. As the bridge, a unique device with
>> ioctl() might do the job.
>>
>> --
>> regards,
>>
>> Mulyadi Santosa
>> Freelance Linux trainer and consultant
>>
>> blog: the-hydra.blogspot.com
>> training: mulyaditraining.blogspot.com
>>
>
>
>
> --
> Regards,
> Sri.
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
Daniel.
More information about the Kernelnewbies
mailing list