]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
doc: document XDP CPU redirect
authorEric Leblond <eric@regit.org>
Thu, 11 Jan 2018 15:52:21 +0000 (16:52 +0100)
committerEric Leblond <eric@regit.org>
Tue, 6 Feb 2018 15:58:19 +0000 (16:58 +0100)
doc/userguide/capture-hardware/ebpf-xdp.rst

index e5ad7500620ddf019c1ff0164537d488d0fadd39..0c1118e7c48966b4f902bfe29f7d969482dcca4a 100644 (file)
@@ -289,6 +289,32 @@ Try to use the network's card balancing as much as possible ::
        /sbin/ethtool -N eth3 rx-flow-hash $proto sdfn
  done
 
+The XDP CPU redirect case
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+If ever your hardware is not able to do a symetric load balancing but support XDP in driver mode, you
+can then use the CPU redirect map support available in the xdp_filter.bpf file. In this mode, the load
+balancinf will be done by the XDP filter and each CPU will handle the whole packet treatment including
+the creation of the skb structure in kernel.
+
+To do so set the `xdp-cpu-redirect` variable in af-packet interface configuration to a set of CPUs.
+Then use the `cluster_cpu` as load balancing function. You will also need to set the affinity
+accordingly.
+
+It is possible to use `xdp_monitor` to have information about the behavior of CPU redirect. This
+program is available in Linux tree under the `samples/bpf` directory and will be build by the
+make command. Sample output is the following ::
+
+ sudo ./xdp_monitor --stats
+ XDP-event       CPU:to  pps          drop-pps     extra-info
+ XDP_REDIRECT    11      2,880,212    0            Success
+ XDP_REDIRECT    total   2,880,212    0            Success
+ XDP_REDIRECT    total   0            0            Error
+ cpumap-enqueue   11:0   575,954      0            5.27       bulk-average
+ cpumap-enqueue  sum:0   575,954      0            5.27       bulk-average
+ cpumap-kthread  0       575,990      0            56,409     sched
+ cpumap-kthread  1       576,090      0            54,897     sched
+
 Start Suricata with XDP
 ~~~~~~~~~~~~~~~~~~~~~~~