On 10/11/06, Jinesh K J <jineshkj.newsletters@xxxxxxxxx> wrote:
On 10/11/06, Jesper Juhl <jesper.juhl@xxxxxxxxx> wrote: > You asked for ways that userspace and kernelspace can communicate and > syscalls is one such way. > This is my requirement. I need to capture the data from an NIC. Instead of pushing it into the network stack, I'll make it to store them in a kernel ring buffer. From that buffer, a user space application will read the raw packet, do the necessary processing and send it back. As you can see I'm looking towards to transfer chunks of data to and from userspace. So, which method does suit well here?
I think you already know the ioctl syscall. You can create a shared memory, and copy the packets on that memory, then give a ioctl when packet is ready. One important point, you have to remember that if you have huge number of packets to be transfer, then this read/write process will take time. means you have to make good send/receive ioctl mechanism.
Jinesh. -- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/
-- Kernelnewbies: Help each other learn about the Linux kernel. Archive: http://mail.nl.linux.org/kernelnewbies/ FAQ: http://kernelnewbies.org/faq/