All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tobias DiPasquale <codeslinger@gmail.com>
To: netfilter <netfilter@lists.netfilter.org>
Subject: Re: queue buffer size increasing howto?
Date: Sun, 22 Aug 2004 10:55:00 -0400	[thread overview]
Message-ID: <876ef97a040822075556951a4@mail.gmail.com> (raw)
In-Reply-To: <876ef97a0408220750591cc852@mail.gmail.com>

On Sun, 22 Aug 2004 15:40:16 +0200, Banszki Gabor
<banszki.gabor@chello.hu> 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


  parent reply	other threads:[~2004-08-22 14:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-22 13:40 queue buffer size increasing howto? Banszki Gabor
     [not found] ` <876ef97a0408220750591cc852@mail.gmail.com>
2004-08-22 14:55   ` Tobias DiPasquale [this message]
2004-09-08  6:01     ` Banszki Gabor
2004-09-04  8:16   ` Banszki Gabor
2004-09-07 16:30     ` queue buffer size increasing howto? - solved Banszki Gabor
2004-09-07 23:39       ` Tobias DiPasquale

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=876ef97a040822075556951a4@mail.gmail.com \
    --to=codeslinger@gmail.com \
    --cc=netfilter@lists.netfilter.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.