netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* NFQUEUE parallelization
@ 2015-09-24 19:56 Eugene Strulyov
  2015-09-24 20:48 ` Florian Westphal
  0 siblings, 1 reply; 4+ messages in thread
From: Eugene Strulyov @ 2015-09-24 19:56 UTC (permalink / raw)
  To: netfilter-devel

Hi,

I am implementing a custom filter using the libnetfilter_queue
library. Performance is important, so I am looking at ways to
parallelize it. The options I see are as follows:

- single queue, multiple threads
- multiple queues, multiple threads
- multiple queues, multiple processes (1 per queue)

Which of these options would be most effective?

The guide I found here
https://home.regit.org/netfilter-en/using-nfqueue-and-libnetfilter_queue/
says "the nfq_set_verdict2 and nfq_handle_packet function needs to be
protected by lock mechanism." Does that mean that there can be at most
2 threads per queue?

When using multiple queues, is it valid to call nfq_open() multiple
times in the same process? When I do that I get negative numbers for
peer portid. Is this normal?

$ sudo cat /proc/net/netfilter/nfnetlink_queue
  100  27790     0 2 65531     0     0        0  1
  101  -4585     0 2 65531     0     0        0  1
  102  -4586     0 2 65531     0     0        0  1
  103  -4587     0 2 65531     0     0        0  1

Also, how exactly does --queue-balance work? All packets seem to be
directed to one particular queue.

thanks,

Eugene

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-09-24 22:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-24 19:56 NFQUEUE parallelization Eugene Strulyov
2015-09-24 20:48 ` Florian Westphal
2015-09-24 21:55   ` Eugene Strulyov
2015-09-24 22:18     ` Florian Westphal

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).