summaryrefslogtreecommitdiff
path: root/vswitchd
diff options
context:
space:
mode:
authorMark Gray <mark.d.gray@redhat.com>2021-07-16 06:17:36 -0400
committerIlya Maximets <i.maximets@ovn.org>2021-07-16 20:05:03 +0200
commitb1e517bd2f818fc7c0cd43ee0b67db4274e6b972 (patch)
tree97b08b9fd7cfce9b81d69c2eb9965fcb6e8c6979 /vswitchd
parent485e3a13a6ead01df5ae68931b36d9845b8ea61c (diff)
downloadopenvswitch-b1e517bd2f818fc7c0cd43ee0b67db4274e6b972.tar.gz
dpif-netlink: Introduce per-cpu upcall dispatch.
The Open vSwitch kernel module uses the upcall mechanism to send packets from kernel space to user space when it misses in the kernel space flow table. The upcall sends packets via a Netlink socket. Currently, a Netlink socket is created for every vport. In this way, there is a 1:1 mapping between a vport and a Netlink socket. When a packet is received by a vport, if it needs to be sent to user space, it is sent via the corresponding Netlink socket. This mechanism, with various iterations of the corresponding user space code, has seen some limitations and issues: * On systems with a large number of vports, there is correspondingly a large number of Netlink sockets which can limit scaling. (https://bugzilla.redhat.com/show_bug.cgi?id=1526306) * Packet reordering on upcalls. (https://bugzilla.redhat.com/show_bug.cgi?id=1844576) * A thundering herd issue. (https://bugzilla.redhat.com/show_bug.cgi?id=1834444) This patch introduces an alternative, feature-negotiated, upcall mode using a per-cpu dispatch rather than a per-vport dispatch. In this mode, the Netlink socket to be used for the upcall is selected based on the CPU of the thread that is executing the upcall. In this way, it resolves the issues above as: a) The number of Netlink sockets scales with the number of CPUs rather than the number of vports. b) Ordering per-flow is maintained as packets are distributed to CPUs based on mechanisms such as RSS and flows are distributed to a single user space thread. c) Packets from a flow can only wake up one user space thread. Reported-at: https://bugzilla.redhat.com/1844576 Signed-off-by: Mark Gray <mark.d.gray@redhat.com> Acked-by: Flavio Leitner <fbl@sysclose.org> Acked-by: Aaron Conole <aconole@redhat.com> Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Diffstat (limited to 'vswitchd')
-rw-r--r--vswitchd/ovs-vswitchd.8.in1
-rw-r--r--vswitchd/vswitch.xml23
2 files changed, 15 insertions, 9 deletions
diff --git a/vswitchd/ovs-vswitchd.8.in b/vswitchd/ovs-vswitchd.8.in
index ec0131a19..1a32402be 100644
--- a/vswitchd/ovs-vswitchd.8.in
+++ b/vswitchd/ovs-vswitchd.8.in
@@ -280,6 +280,7 @@ type).
.
.so lib/dpdk-unixctl.man
.so lib/dpif-netdev-unixctl.man
+.so lib/dpif-netlink-unixctl.man
.so lib/netdev-dpdk-unixctl.man
.so ofproto/ofproto-dpif-unixctl.man
.so ofproto/ofproto-unixctl.man
diff --git a/vswitchd/vswitch.xml b/vswitchd/vswitch.xml
index c15053b25..24bfd13bb 100644
--- a/vswitchd/vswitch.xml
+++ b/vswitchd/vswitch.xml
@@ -570,9 +570,9 @@
<column name="other_config" key="n-handler-threads"
type='{"type": "integer", "minInteger": 1}'>
<p>
- Specifies the number of threads for software datapaths to use for
- handling new flows. The default the number of online CPU cores minus
- the number of revalidators.
+ Attempts to specify the number of threads for software datapaths to
+ use for handling new flows. Some datapaths may choose to ignore
+ this and it will be set to a sensible option for the datapath type.
</p>
<p>
This configuration is per datapath. If you have more than one
@@ -586,12 +586,17 @@
<column name="other_config" key="n-revalidator-threads"
type='{"type": "integer", "minInteger": 1}'>
<p>
- Specifies the number of threads for software datapaths to use for
- revalidating flows in the datapath. Typically, there is a direct
- correlation between the number of revalidator threads, and the number
- of flows allowed in the datapath. The default is the number of cpu
- cores divided by four plus one. If <code>n-handler-threads</code> is
- set, the default changes to the number of cpu cores minus the number
+ Attempts to specify the number of threads for software datapaths to
+ use for revalidating flows in the datapath. Some datapaths may
+ choose to ignore this and will set to a sensible option for the
+ datapath type.
+ </p>
+ <p>
+ Typically, there is a direct correlation between the
+ number of revalidator threads, and the number of flows allowed in the
+ datapath. The default is the number of cpu cores divided by four
+ plus one. If <code>n-handler-threads</code> is set, the default
+ changes to the number of cpu cores minus the number
of handler threads.
</p>
<p>