Commit Graph

158 Commits

Author SHA1 Message Date
Jesper Dangaard Brouer
cde146eed6 Makefile: trivial fixes
SPDX-License should be first line in file.

This Makefile is for bpf-examples not xdp-tools.

Signed-off-by: Jesper Dangaard Brouer <netoptimizer@brouer.com>
2021-01-13 18:09:09 +01:00
Jesper Dangaard Brouer
ae7b0948f9 MTU-tests: Makefile detect if TC have libbpf
Only strip BTF info when TC don't have libbpf support.

Signed-off-by: Jesper Dangaard Brouer <netoptimizer@brouer.com>
2021-01-13 18:09:06 +01:00
Toke Høiland-Jørgensen
afcc607e64 .gitmodules: Add ignore=dirty for libbpf
We run 'make install' inside the libbpf subdirectory which will mark it as
'dirty' as far as the parent repo is concerned. Since we're not doing any
libbpf development in this repository, just ignoring it should not bring
any issues; we'll still get a notification if the committed content of the
submodule changes.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2021-01-13 17:10:20 +01:00
Toke Høiland-Jørgensen
175fb4ad6c configure: Add variable to force submodule
Also don't call removed check for perf_buffer__consume() when using system
libbpf.

Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
2021-01-12 21:45:29 +01:00
Toke Høiland-Jørgensen
378dcd476b Update libbpf submodule to latest upstream 2021-01-12 21:45:03 +01:00
Jesper Dangaard Brouer
e90c94c492 Merge branch 'netoptimizer-master' 2021-01-08 14:55:37 +01:00
Jesper Dangaard Brouer
a47528b709 Merge branch 'master' of https://github.com/netoptimizer/bpf-examples into netoptimizer-master
Signed-off-by: Jesper Dangaard Brouer <netoptimizer@brouer.com>
2021-01-08 14:54:40 +01:00
Jesper D. Brouer
904c820e7e traffic-pacing-edt: Propagate define that enables BTF maps
Two errors:
- Wrong define in config.mk
- Use BPF_CFLAGS to reach llvm compile cflags

Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-22 19:16:10 +01:00
Jesper D. Brouer
39ab41d0d6 Add CPU mapping layer to allow excluding some CPUs
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-18 22:09:24 +01:00
Jesper D. Brouer
47e5cb1c39 traffic-pacing-edt: playing with hash initval
It didn't help kept the original value.

Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-18 20:13:55 +01:00
Jesper D. Brouer
3b6a0c0aa9 traffic-pacing-edt: Exclude CPU-6 in the code
On production setup i40e driver sends all packets to CPU-6 (RX).
Thus, we want to exclude CPU-6 itself from processing/pacing
packets itself.

Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-16 21:24:14 +01:00
Jesper D. Brouer
a16ab11e70 traffic-pacing-edt: Use hash function to calc cpu_dest
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-16 21:09:28 +01:00
Jesper D. Brouer
74a47be697 traffic-pacing-edt: Add "SuperFastHash" based on Paul Hsieh design
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-16 20:42:37 +01:00
Jesper D. Brouer
e8ae6a9287 traffic-pacing-edt: implement spead across CPUs
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-16 16:40:15 +01:00
Jesper Dangaard Brouer
12dc740a1a MTU-tests: Add tc_mtu_enforce.c
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
2020-12-16 11:39:16 +01:00
Jesper D. Brouer
b3ebc2c18c traffic-pacing-edt: implement option for --remove
Need quick way to remove before testing on production.

Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-15 19:34:03 +01:00
Jesper D. Brouer
c8682ec27f traffic-pacing-edt: userspace loader for xdp_cpumap_qinq
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-15 17:55:24 +01:00
Jesper D. Brouer
e9c45d7f64 traffic-pacing-edt: start working on xdp_cpumap_qinq
Signed-off-by: Jesper D. Brouer <netoptimizer@brouer.com>
2020-12-15 16:49:57 +01:00
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