]> git.baikalelectronics.ru Git - kernel.git/commit
bpf: tcp: Add bpf_cubic example
authorMartin KaFai Lau <kafai@fb.com>
Wed, 22 Jan 2020 23:36:58 +0000 (15:36 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 23 Jan 2020 00:30:10 +0000 (16:30 -0800)
commit1dd66743cab9efa0b2937dd75a536fde4c77cb6a
tree0632f77c714898a1ae96619361d986f706979535
parent235c98866269aed1185362740c53fbc4346b86f4
bpf: tcp: Add bpf_cubic example

This patch adds a bpf_cubic example.  Some highlights:
1. CONFIG_HZ .kconfig map is used.
2. In bictcp_update(), calculation is changed to use usec
   resolution (i.e. USEC_PER_JIFFY) instead of using jiffies.
   Thus, usecs_to_jiffies() is not used in the bpf_cubic.c.
3. In bitctcp_update() [under tcp_friendliness], the original
   "while (ca->ack_cnt > delta)" loop is changed to the equivalent
   "ca->ack_cnt / delta" operation.

Signed-off-by: Martin KaFai Lau <kafai@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200122233658.903774-1-kafai@fb.com
tools/testing/selftests/bpf/bpf_tcp_helpers.h
tools/testing/selftests/bpf/prog_tests/bpf_tcp_ca.c
tools/testing/selftests/bpf/progs/bpf_cubic.c [new file with mode: 0644]