Commit Graph

640 Commits

Author SHA1 Message Date
Jesper D. Brouer
89aeeafa0e Update UAPI header file bpf.h
I need the struct bpf_cpumap_val definition for the next example.

Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-15 16:34:26 +01:00
Jesper D. Brouer
e7401bb500 traffic-pacing-edt: Remove test program edt_pacer01.c
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-01 15:36:54 +01:00
Jesper D. Brouer
5aab70b25d traffic-pacing-edt: Adjust after file rename
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-01 15:31:08 +01:00
Jesper D. Brouer
9d52254be6 traffic-pacing-edt: rename edt_pacer02.c to edt_pacer_vlan.c
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-01 15:29:04 +01:00
Jesper D. Brouer
048c960756 iproute2 tc util have recently gotten libbpf support
Implement configure script that detect support, and Makefile
defines that propagate to BPF-C file, making it possible to
use and compile with BTF type maps.

Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-01 14:28:45 +01:00
Jesper D. Brouer
23f73c86ac traffic-pacing-edt: Use bpf_ktime_get_boot_ns
The bpftrace programs use bpf_ktime_get_boot_ns, for underlying 'nsecs'
keyword.  Switch TC-BPF prog to use the same, to make sure that we
don't report false result when detecting/measureing EDT accuracy.

Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-01 12:13:24 +01:00
Jesper D. Brouer
79466715cf traffic-pacing-edt: Use SKB->mark to identify different stages
This can be used by bpftrace programs to identify different
stages, when trying to determine the EDT accuracy.

Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-01 10:07:25 +01:00
Jesper D. Brouer
b84b89dc4b bpftrace/edt_tstamp_diff_advanced.bt: add doc comments
Also found measurement tool can disturb timing.
I might have to write this in BPF-C directly to avoid overhead.

Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-01 09:34:18 +01:00
Jesper D. Brouer
381dd9a512 Add more advanced version of script edt_tstamp_diff_advanced.bt
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-30 12:43:14 +01:00
Jesper D. Brouer
93116e0fb2 Add bpftrace dir and program developed last night
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-30 12:41:48 +01:00
Jesper D. Brouer
dea36b9d8f Add practical script for loading on all outer VLAN devices
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-28 15:45:52 +01:00
Jesper D. Brouer
3248b60248 Do EDT pacing on all inner VLAN ids
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-28 15:09:12 +01:00
Jesper D. Brouer
2786f8af65 Extend the sqrt lookup table with more entries
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-28 14:38:48 +01:00
Jesper D. Brouer
60a851c2a0 Now that codel works adjust horizons
The hard drop horizon (T_HORIZON_DROP) can be increased (to 40ms)
as codel target latency (T_HORIZON_TARGET) is taking care of
signaling TCP downloads via drops (after codel scheme).

Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-28 14:22:29 +01:00
Jesper D. Brouer
3e0ac4f24d Cleanup some comments
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-28 14:02:52 +01:00
Jesper D. Brouer
516668c62c Move codel implementation to header file
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-28 13:51:49 +01:00
Jesper D. Brouer
2f6580dea4 Factor out codel structure
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-28 13:37:07 +01:00
Toke Høiland-Jørgensen
583f7a213f encap-forward: Move setting of the ethertype to the encap_* functions
Makes sure the ethertype is set correctly depending on the type of
encapsulation.

Fixes #2.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2020-11-25 11:31:06 +01:00
Toke Høiland-Jørgensen
f0fce8f62b Update kernel headers and libbpf version
This makes the encap-forward example compile and fixes #3.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2020-11-25 11:19:24 +01:00
Jesper D. Brouer
f50c741011 traffic-pacing-edt: finished codel implementation based on [1]
[1] https://queue.acm.org/appendices/codel.html

Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-22 18:11:11 +01:00
Jesper D. Brouer
d8845714da traffic-pacing-edt: Codel like scheme
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-22 14:53:51 +01:00
Jesper D. Brouer
eacff13518 traffic-pacing-edt: Experiment random drop packets exceeding 10 ms queue
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-22 14:45:13 +01:00
Jesper D. Brouer
a45ae39775 traffic-pacing-edt: make it easy to remove minimum delay trick in code
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-21 18:59:03 +01:00
Jesper D. Brouer
68505a2dbd traffic-pacing-edt: tc_fq_pacer.sh select between MQ and single FQ
For some reason cannot get correct scheduling with FQ in a MQ setup.

In production traffic is Q-in-Q double tagged VLAN traffic.

Perhaps the RX-hash is doing strange stuff, or BPF-prog concurrency
is wrong.  Due to Q-in-Q NIC RSS cause most packets to hit CPU-6
for some strange reason.

Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-21 18:27:37 +01:00
Jesper D. Brouer
4671be73a8 traffic-pacing-edt: Minimum delay for all packet if no time-queue
Trying to trigger more NET_TX_SOFTIRQ to get packets scheduled
out more spaced out in time.

It is of-cause important to disable GRO in the first place.

E.g. cmdline:
 sudo ethtool -K ens6f1 gso off tso off gro off

Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-21 18:02:45 +01:00
Jesper D. Brouer
8714c9a37d traffic-pacing-edt: also pace packets a bit on empty queue
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-21 16:54:58 +01:00
Jesper D. Brouer
794c074d7d traffic-pacing-edt: New strategy: Shape at MAC layer with Ethernet
Take into account MAC layer overhead per packet.

Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-21 15:57:14 +01:00
Jesper D. Brouer
6b5648158b traffic-pacing-edt: Testing rates in production
Test different rates in production machine, and measure iperf3 TCP-goodput

Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-21 13:53:53 +01:00
Jesper D. Brouer
740416975f traffic-pacing-edt: allow tc util to be install in other places
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-11-21 13:05:47 +01:00
Jesper Dangaard Brouer
71db45b28e traffic-pacing-edt: Handle if loaded on outer VLAN net_device
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-15 21:55:59 +01:00
Jesper Dangaard Brouer
a0f3760d6c traffic-pacing-edt: Handle if VLAN is offloaded to SKB metadata
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-15 21:19:10 +01:00
Jesper Dangaard Brouer
6a67b105ee traffic-pacing-edt: Remember MTU setting on netdevices
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-15 20:53:22 +01:00
Jesper Dangaard Brouer
d8a992aab4 traffic-pacing-edt: Add IP wrapper functions
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-15 17:27:09 +01:00
Jesper Dangaard Brouer
1196c6cf14 traffic-pacing-edt: adjust parameters help txt to be more general
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-15 17:23:41 +01:00
Jesper Dangaard Brouer
82186cfe72 traffic-pacing-edt: script for VLAN setup
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-15 17:03:04 +01:00
Jesper Dangaard Brouer
9c5ccaed9b traffic-pacing-edt: Simple VLAN parsing via parse_ethhdr_vlan
Using the XDP based ethhdr VLAN parser.  This cannot handle
if the SKB don't have the VLAN inlined.

Static match on VLAN 16 as test case.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-15 16:23:46 +01:00
Jesper Dangaard Brouer
21ebc4d8cd traffic-pacing-edt: Align map struct to cache-line size
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-15 15:56:31 +01:00
Jesper Dangaard Brouer
692202e60e traffic-pacing-edt: use READ_ONCE and WRITE_ONCE via compiler.h
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-15 15:40:42 +01:00
Jesper Dangaard Brouer
9ea235637e Add compiler.h to define some common compiler directives
This is taken from the Cilium project:
 https://github.com/cilium/cilium/blob/master/bpf/include/bpf/compiler.h

The use-case was adding READ_ONCE and WRITE_ONCE, but via re-using
the Cilium version we get a lot more useful compiler annotations.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-15 15:38:15 +01:00
Jesper Dangaard Brouer
c0cd6aedba parsing_helpers.h re-add IPv6 skip of extension headers
This code comes from xdp-tools repo.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-15 15:26:12 +01:00
Jesper Dangaard Brouer
097079cde1 Fix includes in parsing_helpers.h
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-15 15:17:00 +01:00
Jesper Dangaard Brouer
6ee640393b Update parsing_helpers.h from xdp-tutorial
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-15 15:12:20 +01:00
Jesper Dangaard Brouer
4ded8f7015 traffic-pacing-edt: control latency via horizon drop
When number of parallel (iperf -P N) flows increase, then the latency
increase as well (measured via simple ping through router).

This can be controlled via a much tigher drop horizon.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-14 19:33:42 +01:00
Jesper Dangaard Brouer
1fb4483207 traffic-pacing-edt: tc_fq_pacer.sh adjust packet per flow_limit
This was causing strange issues, where a TCP single flow could not
achieve the correct bandwidth.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-14 18:44:40 +01:00
Jesper Dangaard Brouer
9f97d984cb traffic-pacing-edt: edt_pacer02.c add ECN marking horizon
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-14 17:16:03 +01:00
Jesper Dangaard Brouer
5a3e52cf43 traffic-pacing-edt: Make fq script respect --remove
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-14 16:51:56 +01:00
Jesper Dangaard Brouer
55a8513e2c traffic-pacing-edt: Play with edt_pacer02 drop horizon
This didn't help.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-14 16:51:11 +01:00
Jesper Dangaard Brouer
252a40763a traffic-pacing-edt: Adjustments to HTB script to get closer to EDT system
These adjustment doesn't help, EDT is still closer to 1Gbit/s at wire-level.

Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-14 14:58:47 +01:00
Jesper Dangaard Brouer
a6294dd946 edt_pacer02: Use skb wire_len
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-14 14:51:30 +01:00
Jesper Dangaard Brouer
3969089c64 traffic-pacing-edt/tc_fq_pacer.sh: Add doc explaining
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-11-14 13:53:49 +01:00