netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg <lego12239@yandex.ru>
To: Florian Westphal <fw@strlen.de>
Cc: netfilter-devel@vger.kernel.org
Subject: Re: libnetfilter_queue & multithreading & 1 queue freezing
Date: Sun, 27 Aug 2017 15:19:00 +0300	[thread overview]
Message-ID: <20170827121900.GA25231@legohost> (raw)
In-Reply-To: <20170826192625.GD29355@breakpoint.cc>

On Sat, Aug 26, 2017 at 09:26:25PM +0200, Florian Westphal wrote:
> Oleg <lego12239@yandex.ru> wrote:
> >   Hi, all.
> > 
> > My program process multiple NFQUEUEs by creating a separate thread
> > for every NFQUEUE. An each thread do recv() and nfq_set_verdict2():
> > 
> > But i catch a strange behaviour when more than 1 thread(queue) are
> > used. In those cases one queue "freeze" while others works right.
> > For example, for 5 queues(here a queue with id 1 "freeze"):
> 
> If you use libnetfilter_queue you might need
> 
> commit 4ca06bc967d94b7b7b5a6efc76e870f0efc77e24
> src: make nfq_open_nfnl thread-safe
> 
> (or protect nfq_open_nfnl calls with a mutex).

A mutex around nfq_open() seems to work. At least, 30 restarts
didn't show a frozen on recvfrom() queue.

Thanks!

-- 
Олег Неманов (Oleg Nemanov)

      reply	other threads:[~2017-08-27 12:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-26 15:07 libnetfilter_queue & multithreading & 1 queue freezing Oleg
2017-08-26 19:26 ` Florian Westphal
2017-08-27 12:19   ` Oleg [this message]

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=20170827121900.GA25231@legohost \
    --to=lego12239@yandex.ru \
    --cc=fw@strlen.de \
    --cc=netfilter-devel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).