Re: queue buffer size increasing howto?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, 22 Aug 2004 15:40:16 +0200, Banszki Gabor
<banszki.gabor@xxxxxxxxx> wrote:
>
> Hi everybody!
>
> Greetings for you! I am a new member of this list.
>
> Please somebody help me!
>
> I am developing an application for counting and processing packets in a
> linux box with using the ip_queue module.
>
> It is working properly, but sometimes I have a problem, that I get often
> this message:
>
> Failed to receive netlink message, No buffer space available

This message indicates the the buffer for the netlink socket was full.
This is different from the queue that ip_queue has internally for
packets to be sent to userspace. You will need to open the netlink
socket with a larger buffer, which can be accomplished by using
setsockopt(2):

int fd, rv, size = LARGE_SOCKET_BUFFER;

fd = socket( PF_NETLINK, SOCK_RAW, NETLINK_FIREWALL);
rv = setsockopt( fd, SOL_SOCKET, SO_RCVBUF, &size, sizeof( size));
...

> With this command: watch -n 0 "cat /proc/net/ip_queue" during my
> application running the biggest number of "Queue length" is 255.
>
> I don't understand it, because the "Queue max. length" is 2048.

See above. You should be able to increase the size of the socket
receive buffer in your userspace process without changing the length
of ip_queue's internal packet queue, but test that out to make sure.
You will probably need to run the process with root privileges to
change your socket receive buffer size, however.

--
[ Tobias DiPasquale ]
0x636f6465736c696e67657240676d61696c2e636f6d


[Index of Archives]     [Linux Netfilter Development]     [Linux Kernel Networking Development]     [Netem]     [Berkeley Packet Filter]     [Linux Kernel Development]     [Advanced Routing & Traffice Control]     [Bugtraq]

  Powered by Linux