Hello All,
I have tried to implement socket programming in kernel
space. The client and server are communicating using a
buffer. The size of this buffer is 1K (1024 bytes).
The client and server are able to communicate using
this size buffer but since this size i.e. 1K is very
small and since we are using this buffer for testing
file system functions we require a bigger buffer of
about 4K or 8K.
The problem is that when I try to change my buffer
size to 4K or even 2K, the system hangs and no
communication b/w client and server can take place. I
want to inquire whether the max buffer limit is 1K. If
not then what changes I have to make in my client &
server kernel modules.
Thanks,
Uzair Lakhani,
Karachi, Pakistan.
How are you allocating your b
How are you allocating your buffer?
Don't allocate on the stack. The kernel stack is very small, AFAIK.
Buffer Allocation
Hello All,
Thanks for the reply. Now I am allocating the memory using kmalloc(SIZE, GFP_KERNEL). It solved my initial problems which I was getting previously. Before this I was allocating as below
FUNCTION_XXX( )
{
unsigned char buffer[1024 or 4096];
}
This memory was going to be allocated on stack and creating problems.
Thanks,
Uzair Lakhani,
Karachi, Pakistan.