All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC 0/3] NFQUEUE: introduce CPU fanout
@ 2013-03-19 14:14 holger
  2013-03-19 14:14 ` [PATCH RFC 1/3] " holger
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: holger @ 2013-03-19 14:14 UTC (permalink / raw)
  To: netfilter-devel

Hi,

with the following patchset I'd like to improve the NFQUEUE
performance if the --queue-balance argument is used for steering
packets to the NFQUEUEs.  By changing the way which NFQUEUE is
assgined I'm able to improve the performance if the processes reading
on the NFQUEUEs are pinned correctly.

Current NFQUEUE target uses a hash, computed over source and
destination address (and other parameters), for steering the packet
to the actual NFQUEUE.  This however forgets about the fact that the
packet eventually is handled by a particular CPU on user request.

If e. g. 

  1) IRQ affinity is used to handle packets on a particular CPU already
     (both single-queue or multi-queue case)

and/or

  2) RPS is used to steer packets to a specific softirq

the target easily chooses an NFQUEUE which is not handled by a process
pinned to the same CPU.

The idea is therefore to use the CPU index for determining the
NFQUEUE handling the packet.

E. g. when having a system with 4 CPUs, 4 MQ queues and 4 NFQUEUEs it
looks like this:

 +-----+  +-----+  +-----+  +-----+
 |NFQ#0|  |NFQ#1|  |NFQ#2|  |NFQ#3|
 +-----+  +-----+  +-----+  +-----+
    ^        ^        ^        ^
    |        |NFQUEUE |        |
    +        +        +        +
 +-----+  +-----+  +-----+  +-----+
 |rx-0 |  |rx-1 |  |rx-2 |  |rx-3 |
 +-----+  +-----+  +-----+  +-----+

The NFQUEUEs not necessarily have to start with number 0, setups with
less NFQUEUEs than packet-handling CPUs are not a problem as well.

The first patch extends the NFQUEUE target to accept a new
NFQ_FLAG_CPU_FANOUT flag.  If this is specified the target uses the
CPU index for determining the NFQUEUE being used.  I have to introduce
rev3 for this, sorry.

The 2nd patch coalesces rev1 and rev3 hashing by introducing
nfqueue_hash(), then used in both revisions.

The 3rd patch extends iptables userspace to accept the
--queue-cpu-fanout argument.

This is an RFC patchset, I very much appreciate your feedback.

Thank you.

 /Holger


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

end of thread, other threads:[~2013-03-23 21:53 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-19 14:14 [PATCH RFC 0/3] NFQUEUE: introduce CPU fanout holger
2013-03-19 14:14 ` [PATCH RFC 1/3] " holger
2013-03-19 14:26   ` David Miller
2013-03-19 14:34     ` Jan Engelhardt
2013-03-19 14:37       ` David Miller
2013-03-19 21:38         ` Holger Eitzenberger
2013-03-19 21:34       ` Holger Eitzenberger
2013-03-19 21:57         ` Jan Engelhardt
2013-03-19 22:30           ` Holger Eitzenberger
2013-03-19 19:56   ` Florian Westphal
2013-03-19 20:17     ` Holger Eitzenberger
2013-03-19 14:14 ` [PATCH RFC 2/3] NFQUEUE: coalesce IPv4 and IPv6 hashing holger
2013-03-19 14:27   ` David Miller
2013-03-19 14:39     ` Holger Eitzenberger
2013-03-19 14:14 ` [PATCH RFC 3/3] NFQUEUE: add --queue-cpu-fanout parameter holger
2013-03-19 14:34   ` Eric Leblond
2013-03-19 16:07     ` Holger Eitzenberger
2013-03-23 19:52     ` Holger Eitzenberger
2013-03-23 21:53       ` Eric Leblond

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.