Re: [PATCH net] tcp: fix tcp_set_congestion_control() use from bpf hook

2019-07-18 Thread Lawrence Brakmo
f: Add support for changing congestion control") Signed-off-by: Eric Dumazet Cc: Lawrence Brakmo Reported-by: Neal Cardwell --- Acked-by: Lawrence Brakmo Thanks, Eric!

Re: [PATCH bpf-next v2 0/8] bpf: TCP RTT sock_ops bpf callback

2019-07-02 Thread Lawrence Brakmo
> Suggested-by: Eric Dumazet > Cc: Eric Dumazet > Cc: Priyaranjan Jha > Cc: Yuchung Cheng > Cc: Soheil Hassas Yeganeh > Acked-by: Soheil Hassas Yeganeh > Acked-by: Yuchung Cheng Ack for the whole series. Acked-by: Yonghong Song Thanks,

[PATCH v3 bpf-next] bpf: Add support for fq's EDT to HBM

2019-07-02 Thread brakmo
4 4865 0.00 156 306 425 759 1520 10 16 dctcp 5G4 4936 0.00 128 485 221 409 148479 dctcp-edt 5G4 4924 0.00 148 390 392 623 1508 11 26 v1 -> v2: Incorporated Andrii's suggestions v2 -> v3: Incorporated Yonghong's su

[PATCH v4 bpf-next] bpf: Add support for fq's EDT to HBM

2019-07-02 Thread brakmo
ggestions v3 -> v4: Removed credit update that is not needed Signed-off-by: Lawrence Brakmo --- samples/bpf/Makefile | 2 + samples/bpf/do_hbm_test.sh | 22 ++--- samples/bpf/hbm.c | 18 +++- samples/bpf/hbm_edt_kern.c | 168 + samples

Re: [PATCH v2 bpf-next] bpf: Add support for fq's EDT to HBM

2019-07-02 Thread Lawrence Brakmo
Yonhhong, thank you for the feedbac. Repies inlined. I will submit a new revision later today. On 7/1/19, 2:04 PM, "Yonghong Song" wrote: On 6/28/19 12:41 PM, brakmo wrote: > Adds support for fq's Earliest Departure Time to HBM (Host Bandwidth > Manager

[PATCH v2 bpf-next] bpf: Add support for fq's EDT to HBM

2019-06-28 Thread brakmo
4 4865 0.00 156 306 425 759 1520 10 16 dctcp 5G4 4936 0.00 128 485 221 409 148479 dctcp-edt 5G4 4924 0.00 148 390 392 623 1508 11 26 v1 -> v2: Incorporated Andrii's suggestions Signed-off-by: Lawrence Brakmo ---

Re: [PATCH bpf-next] bpf: fix precision tracking

2019-06-28 Thread Lawrence Brakmo
v.o 840731904 6801 7002 > bpf_overlay.o 542023569 4754 4858 > bpf_lxc_jit.o 39389 35944550925 69631 > Overall precision tracking is still very effective. > > Fixes: b5dc0163d8fd ("bpf: precise scalar_val

[PATCH bpf-next] bpf: Add support for fq's EDT to HBM

2019-06-12 Thread brakmo
4 4865 0.00 156 306 425 759 1520 10 16 dctcp 5G4 4936 0.00 128 485 221 409 148479 dctcp-edt 5G4 4924 0.00 148 390 392 623 1508 11 26 Signed-off-by: Lawrence Brakmo --- samples/bpf/Makefile | 2 + samples/bpf/do_hbm_tes

[PATCH v4 bpf-next 3/6] bpf: Update __cgroup_bpf_run_filter_skb with cn

2019-05-28 Thread brakmo
return -EPERM if any attached program was found and if it returned != 1 during execution. Otherwise 0 is returned. Signed-off-by: Lawrence Brakmo --- kernel/bpf/cgroup.c | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/kernel/bpf/cgroup.c b/kernel/bpf

[PATCH v4 bpf-next 6/6] bpf: Add more stats to HBM

2019-05-28 Thread brakmo
Adds more stats to HBM, including average cwnd and rtt of all TCP flows, percents of packets that are ecn ce marked and distribution of return values. Signed-off-by: Lawrence Brakmo --- samples/bpf/hbm.c | 33 +++ samples/bpf/hbm.h | 6 samples/bpf

[PATCH v4 bpf-next 4/6] bpf: Update BPF_CGROUP_RUN_PROG_INET_EGRESS calls

2019-05-28 Thread brakmo
Update BPF_CGROUP_RUN_PROG_INET_EGRESS() callers to support returning congestion notifications from the BPF programs. Signed-off-by: Lawrence Brakmo Signed-off-by: Alexei Starovoitov --- net/ipv4/ip_output.c | 34 +++--- net/ipv6/ip6_output.c | 26

[PATCH v4 bpf-next 5/6] bpf: Add cn support to hbm_out_kern.c

2019-05-28 Thread brakmo
Update hbm_out_kern.c to support returning cn notifications. Also updates relevant files to allow disabling cn notifications. Signed-off-by: Lawrence Brakmo --- samples/bpf/do_hbm_test.sh | 10 +++--- samples/bpf/hbm.c | 18 +++--- samples/bpf/hbm.h | 3

[PATCH v4 bpf-next 2/6] bpf: cgroup inet skb programs can return 0 to 3

2019-05-28 Thread brakmo
will break backward compatibility. This patch adds a enforce_expected_attach_type bit to only enforce the expected_attach_type when it uses the new return value. Signed-off-by: Lawrence Brakmo Signed-off-by: Martin KaFai Lau --- include/linux/filter.h | 3 ++- kernel/bpf/syscall.c | 12

[PATCH v4 bpf-next 0/6] bpf: Propagate cn to TCP

2019-05-28 Thread brakmo
hanges v3->v4: Replaced preempt_enable_no_resched() by preempt_enable() in BPF_PROG_CGROUP_INET_EGRESS_RUN_ARRAY() macro brakmo (6): bpf: Create BPF_PROG_CGROUP_INET_EGRESS_RUN_ARRAY bpf: cgroup inet skb programs can return 0 to 3 bpf: Update __cgroup_bpf_run_filter_skb with

[PATCH v4 bpf-next 1/6] bpf: Create BPF_PROG_CGROUP_INET_EGRESS_RUN_ARRAY

2019-05-28 Thread brakmo
skb should be dropped (no cn) Note that when more than one BPF program is called, the packet is dropped if at least one of programs requests it be dropped, and there is cn if at least one program returns cn. Signed-off-by: Lawrence Brakmo --- include/linux/bpf.h | 50

Re: [PATCH v3 bpf-next 1/6] bpf: Create BPF_PROG_CGROUP_INET_EGRESS_RUN_ARRAY

2019-05-28 Thread Lawrence Brakmo
On 5/28/19, 1:43 PM, "Eric Dumazet" wrote: On 5/28/19 11:54 AM, Lawrence Brakmo wrote: > On 5/28/19, 6:43 AM, "netdev-ow...@vger.kernel.org on behalf of Eric Dumazet" wrote: > > Why are you using preempt_enable_no_resched() here ?

Re: [PATCH v3 bpf-next 1/6] bpf: Create BPF_PROG_CGROUP_INET_EGRESS_RUN_ARRAY

2019-05-28 Thread Lawrence Brakmo
On 5/28/19, 6:43 AM, "netdev-ow...@vger.kernel.org on behalf of Eric Dumazet" wrote: On 5/27/19 8:49 PM, brakmo wrote: > Create new macro BPF_PROG_CGROUP_INET_EGRESS_RUN_ARRAY() to be used by > __cgroup_bpf_run_filter_skb for EGRESS BPF progs so

[PATCH v3 bpf-next 4/6] bpf: Update BPF_CGROUP_RUN_PROG_INET_EGRESS calls

2019-05-27 Thread brakmo
Update BPF_CGROUP_RUN_PROG_INET_EGRESS() callers to support returning congestion notifications from the BPF programs. Signed-off-by: Lawrence Brakmo Signed-off-by: Alexei Starovoitov --- net/ipv4/ip_output.c | 34 +++--- net/ipv6/ip6_output.c | 26

[PATCH v3 bpf-next 5/6] bpf: Add cn support to hbm_out_kern.c

2019-05-27 Thread brakmo
Update hbm_out_kern.c to support returning cn notifications. Also updates relevant files to allow disabling cn notifications. Signed-off-by: Lawrence Brakmo --- samples/bpf/do_hbm_test.sh | 10 +++--- samples/bpf/hbm.c | 18 +++--- samples/bpf/hbm.h | 3

[PATCH v3 bpf-next 6/6] bpf: Add more stats to HBM

2019-05-27 Thread brakmo
Adds more stats to HBM, including average cwnd and rtt of all TCP flows, percents of packets that are ecn ce marked and distribution of return values. Signed-off-by: Lawrence Brakmo --- samples/bpf/hbm.c | 33 +++ samples/bpf/hbm.h | 6 samples/bpf

[PATCH v3 bpf-next 3/6] bpf: Update __cgroup_bpf_run_filter_skb with cn

2019-05-27 Thread brakmo
return -EPERM if any attached program was found and if it returned != 1 during execution. Otherwise 0 is returned. Signed-off-by: Lawrence Brakmo --- kernel/bpf/cgroup.c | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/kernel/bpf/cgroup.c b/kernel/bpf

[PATCH v3 bpf-next 0/6] bpf: Propagate cn to TCP

2019-05-27 Thread brakmo
hanges brakmo (6): bpf: Create BPF_PROG_CGROUP_INET_EGRESS_RUN_ARRAY bpf: cgroup inet skb programs can return 0 to 3 bpf: Update __cgroup_bpf_run_filter_skb with cn bpf: Update BPF_CGROUP_RUN_PROG_INET_EGRESS calls bpf: Add cn support to hbm_out_kern.c bpf: Add more stats to HBM i

[PATCH v3 bpf-next 1/6] bpf: Create BPF_PROG_CGROUP_INET_EGRESS_RUN_ARRAY

2019-05-27 Thread brakmo
skb should be dropped (no cn) Note that when more than one BPF program is called, the packet is dropped if at least one of programs requests it be dropped, and there is cn if at least one program returns cn. Signed-off-by: Lawrence Brakmo --- include/linux/bpf.h | 50

[PATCH v3 bpf-next 2/6] bpf: cgroup inet skb programs can return 0 to 3

2019-05-27 Thread brakmo
will break backward compatibility. This patch adds a enforce_expected_attach_type bit to only enforce the expected_attach_type when it uses the new return value. Signed-off-by: Lawrence Brakmo Signed-off-by: Martin KaFai Lau --- include/linux/filter.h | 3 ++- kernel/bpf/syscall.c | 12

Re: [PATCH v2 bpf-next 5/7] bpf: sysctl for probe_on_drop

2019-05-03 Thread Lawrence Brakmo
On 4/8/19, 10:39 AM, "Yuchung Cheng" wrote: On Mon, Apr 8, 2019 at 10:07 AM Eric Dumazet wrote: > > > > On 04/08/2019 09:16 AM, Neal Cardwell wrote: > > On Wed, Apr 3, 2019 at 8:13 PM brakmo wrote: > >> > >> When

Re: [PATCH v2 bpf-next 5/7] bpf: sysctl for probe_on_drop

2019-05-03 Thread Lawrence Brakmo
On 4/8/19, 10:07 AM, "Eric Dumazet" wrote: On 04/08/2019 09:16 AM, Neal Cardwell wrote: > On Wed, Apr 3, 2019 at 8:13 PM brakmo wrote: >> >> When a packet is dropped when calling queue_xmit in __tcp_transmit_skb >> and packets_ou

Re: [PATCH v2 bpf-next 5/7] bpf: sysctl for probe_on_drop

2019-05-03 Thread Lawrence Brakmo
at 8:13 PM brakmo wrote: > > When a packet is dropped when calling queue_xmit in __tcp_transmit_skb > and packets_out is 0, it is beneficial to set a small probe timer. > Otherwise, the throughput for the flow can suffer because it may need to > depend on the probe tim

[PATCH v2 bpf-next 4/7] bpf: Update BPF_CGROUP_RUN_PROG_INET_EGRESS calls

2019-04-03 Thread brakmo
Update BPF_CGROUP_RUN_PROG_INET_EGRESS() callers to support returning congestion notifications from the BPF programs. Signed-off-by: Lawrence Brakmo Signed-off-by: Alexei Starovoitov --- net/ipv4/ip_output.c | 34 +++--- net/ipv6/ip6_output.c | 26

[PATCH v2 bpf-next 5/7] bpf: sysctl for probe_on_drop

2019-04-03 Thread brakmo
0 and TCP_RTO_MIN. A value of 0 disables setting the probe timer with a small value. Signed-off-by: Lawrence Brakmo --- include/net/netns/ipv4.h | 1 + net/ipv4/sysctl_net_ipv4.c | 10 ++ net/ipv4/tcp_ipv4.c| 1 + net/ipv4/tcp_output.c | 18 +++--- 4 files

[PATCH v2 bpf-next 7/7] bpf: Add more stats to HBM

2019-04-03 Thread brakmo
Adds more stats to HBM, including average cwnd and rtt of all TCP flows, percents of packets that are ecn ce marked and distribution of return values. Signed-off-by: Lawrence Brakmo --- samples/bpf/hbm.c | 33 +++ samples/bpf/hbm.h | 6 samples/bpf

[PATCH v2 bpf-next 3/7] bpf: Update __cgroup_bpf_run_filter_skb with cn

2019-04-03 Thread brakmo
return -EPERM if any attached program was found and if it returned != 1 during execution. Otherwise 0 is returned. Signed-off-by: Lawrence Brakmo --- kernel/bpf/cgroup.c | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/kernel/bpf/cgroup.c b/kernel/bpf

[PATCH v2 bpf-next 1/7] bpf: Create BPF_PROG_CGROUP_INET_EGRESS_RUN_ARRAY

2019-04-03 Thread brakmo
skb should be dropped (no cn) Note that when more than one BPF program is called, the packet is dropped if at least one of programs requests it be dropped, and there is cn if at least one program returns cn. Signed-off-by: Lawrence Brakmo --- include/linux/bpf.h | 50

[PATCH v2 bpf-next 6/7] bpf: Add cn support to hbm_out_kern.c

2019-04-03 Thread brakmo
Update hbm_out_kern.c to support returning cn notifications. Also updates relevant files to allow disabling cn notifications. Signed-off-by: Lawrence Brakmo --- samples/bpf/do_hbm_test.sh | 10 +++--- samples/bpf/hbm.c | 18 +++--- samples/bpf/hbm.h | 3

[PATCH v2 bpf-next 2/7] bpf: cgroup inet skb programs can return 0 to 3

2019-04-03 Thread brakmo
will break backward compatibility. This patch adds a enforce_expected_attach_type bit to only enforce the expected_attach_type when it uses the new return value. Signed-off-by: Lawrence Brakmo Signed-off-by: Martin KaFai Lau --- include/linux/filter.h | 3 ++- kernel/bpf/syscall.c | 12

[PATCH v2 bpf-next 0/7] bpf: Propagate cn to TCP

2019-04-03 Thread brakmo
-202 0.48333 -199 0.50 200M,20, 5,cn 1992 -209 0.38 1991 -214 0.30 Notes: --no_cn has no effect with DCTCP Lim = rate limit Prob = Probe timer DA = maximum delay ack timer cred = credit in packets drops = % packets dropped brakmo (7): bpf: Create

Re: [PATCH bpf-next 0/7] bpf: Propagate cn to TCP

2019-03-23 Thread Lawrence Brakmo
On 3/23/19, 10:12 AM, "Eric Dumazet" wrote: On 03/23/2019 01:05 AM, brakmo wrote: > This patchset adds support for propagating congestion notifications (cn) > to TCP from cgroup inet skb egress BPF programs. > > Current cgroup skb BPF progr

[PATCH bpf-next 0/7] bpf: Propagate cn to TCP

2019-03-23 Thread brakmo
1992 -209 0.38 1991 -214 0.30 Notes: --no_cn has no effect with DCTCP Lim = rate limit Prob = Probe timer DA = maximum delay ack timer cred = credit in packets drops = % packets dropped brakmo (7): bpf: Create BPF_PROG_CGROUP_INET_EGRESS_RUN_ARRAY bpf: cgroup inet skb pro

[PATCH bpf-next 7/7] bpf: Add more stats to HBM

2019-03-23 Thread brakmo
Adds more stats to HBM, including average cwnd and rtt of all TCP flows, percents of packets that are ecn ce marked and distribution of return values. Signed-off-by: Lawrence Brakmo --- samples/bpf/hbm.c | 33 +++ samples/bpf/hbm.h | 6 samples/bpf

[PATCH bpf-next 4/7] bpf: Update BPF_CGROUP_RUN_PROG_INET_EGRESS calls

2019-03-23 Thread brakmo
is not NET_XMIT_SUCCESS, return it, otherwise return the return value of the call to BPF_CGROUP_RUN_PROG_INET_EGRESS(). Otherwise, return the return value of the output function. Signed-off-by: Lawrence Brakmo --- net/ipv4/ip_output.c | 39 ++- net/ipv6

[PATCH bpf-next 5/7] bpf: sysctl for probe_on_drop

2019-03-23 Thread brakmo
0 and TCP_RTO_MIN. A value of 0 disables setting the probe timer with a small value. Signed-off-by: Lawrence Brakmo --- include/net/netns/ipv4.h | 1 + net/ipv4/sysctl_net_ipv4.c | 10 ++ net/ipv4/tcp_ipv4.c| 1 + net/ipv4/tcp_output.c | 18 +++--- 4 files

[PATCH bpf-next 6/7] bpf: Add cn support to hbm_out_kern.c

2019-03-23 Thread brakmo
Update hbm_out_kern.c to support returning cn notifications. Also updates relevant files to allow disabling cn notifications. Signed-off-by: Lawrence Brakmo --- samples/bpf/do_hbm_test.sh | 10 +++--- samples/bpf/hbm.c | 18 +++--- samples/bpf/hbm.h | 3

[PATCH bpf-next 3/7] bpf: Update __cgroup_bpf_run_filter_skb with cn

2019-03-23 Thread brakmo
return -EPERM if any attached program was found and if it returned != 1 during execution. Otherwise 0 is returned. Signed-off-by: Lawrence Brakmo --- kernel/bpf/cgroup.c | 25 - 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/kernel/bpf/cgroup.c b/kernel/bpf

[PATCH bpf-next 2/7] bpf: cgroup inet skb programs can return 0 to 3

2019-03-23 Thread brakmo
will break backward compatibility. This patch adds a enforce_expected_attach_type bit to only enforce the expected_attach_type when it uses the new return value. Signed-off-by: Lawrence Brakmo Signed-off-by: Martin KaFai Lau --- include/linux/filter.h | 3 ++- kernel/bpf/syscall.c | 12

[PATCH bpf-next 1/7] bpf: Create BPF_PROG_CGROUP_INET_EGRESS_RUN_ARRAY

2019-03-23 Thread brakmo
skb should be dropped (no cn) Note that when more than one BPF program is called, the packet is dropped if at least one of programs requests it be dropped, and there is cn if at least one program returns cn. Signed-off-by: Lawrence Brakmo --- include/linux/bpf.h | 50

[PATCH v3 bpf-next 0/5] bpf: Host Bandwidth Manager (HBM)

2019-03-01 Thread brakmo
M (Network Resource Manager) to HBM (Host Bandwdith Manager) * The bpf helper to set ECN ce now checks that the header is writeable * Removed helper bpf functions that modified TCP state due to a concern about whether the socket is locked by the current thread. brakmo (5): bpf: add

[PATCH v3 bpf-next 4/5] bpf: User program for testing HBM

2019-03-01 Thread brakmo
Name defaults to hbm_out_kern.o More information about HBM can be found in the paper "BPF Host Resource Management" presented at the 2018 Linux Plumbers Conference, Networking Track (http://vger.kernel.org/lpc_net2018_talks/LPC%20BPF%20Network%20Resource%20Paper.pdf) Signed-off-by: Lawrenc

[PATCH v3 bpf-next 3/5] bpf: Sample HBM BPF program to limit egress bw

2019-03-01 Thread brakmo
A latter patch provides such a program (hbm.c) Signed-off-by: Lawrence Brakmo --- samples/bpf/Makefile | 2 + samples/bpf/hbm.h | 31 samples/bpf/hbm_kern.h | 137 samples/bpf/hbm_out_kern.c | 157 +

[PATCH v3 bpf-next 1/5] bpf: add bpf helper bpf_skb_ecn_set_ce

2019-03-01 Thread brakmo
This works best when using DCTCP. Signed-off-by: Lawrence Brakmo Signed-off-by: Martin KaFai Lau --- include/uapi/linux/bpf.h | 10 +- net/core/filter.c| 28 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/bpf.h b/in

[PATCH v3 bpf-next 2/5] bpf: sync bpf.h to tools and update bpf_helpers.h

2019-03-01 Thread brakmo
This patch syncs the uapi bpf.h to tools/ and also updates bpf_herlpers.h in tools/ Signed-off-by: Lawrence Brakmo --- tools/include/uapi/linux/bpf.h| 10 +- tools/testing/selftests/bpf/bpf_helpers.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a

[PATCH v3 bpf-next 5/5] bpf: HBM test script

2019-03-01 Thread brakmo
st the rate is 8Gbps vs. 1Gbps of the previous test. Signed-off-by: Lawrence Brakmo --- samples/bpf/do_hbm_test.sh | 436 + 1 file changed, 436 insertions(+) create mode 100755 samples/bpf/do_hbm_test.sh diff --git a/samples/bpf/do_hbm_test.sh b/samples/bpf

[PATCH v2 bpf-next 3/9] bpf: Test bpf_tcp_enter_cwr in test_verifier

2019-02-22 Thread brakmo
This test ensures the verifier has checked the arg1 of BPF_FUNC_tcp_enter_cwr is of ARG_PTR_TO_TCP_SOCK type. Signed-off-by: Martin KaFai Lau Signed-off-by: Lawrence Brakmo --- tools/testing/selftests/bpf/verifier/sock.c | 33 + 1 file changed, 33 insertions(+) diff --git

[PATCH v2 bpf-next 4/9] bpf: add bpf helper bpf_skb_ecn_set_ce

2019-02-22 Thread brakmo
This works best when using DCTCP. Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 10 +- net/core/filter.c| 14 ++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 95b5058fa945..fc646f3ea

[PATCH v2 bpf-next 2/9] bpf: Add bpf helper bpf_tcp_enter_cwr

2019-02-22 Thread brakmo
enforced if this new helper is used by the prog. Signed-off-by: Lawrence Brakmo Signed-off-by: Martin KaFai Lau --- include/linux/bpf.h | 1 + include/linux/filter.h | 3 ++- include/uapi/linux/bpf.h | 9 - kernel/bpf/syscall.c | 12 kernel/bpf/verifier.c

[PATCH v2 bpf-next 6/9] bpf: sync bpf.h to tools and update bpf_helpers.h

2019-02-22 Thread brakmo
This patch syncs the uapi bpf.h to tools/ and also updates bpf_herlpers.h in tools/ Signed-off-by: Lawrence Brakmo --- tools/include/uapi/linux/bpf.h| 27 ++- tools/testing/selftests/bpf/bpf_helpers.h | 6 + 2 files changed, 32 insertions(+), 1 deletion

[PATCH v2 bpf-next 1/9] bpf: Remove const from get_func_proto

2019-02-22 Thread brakmo
proto implementations to avoid compiler error. Signed-off-by: Martin KaFai Lau Signed-off-by: Lawrence Brakmo --- drivers/media/rc/bpf-lirc.c | 2 +- include/linux/bpf.h | 2 +- kernel/bpf/cgroup.c | 2 +- kernel/trace/bpf_trace.c| 10 +- ne

[PATCH v2 bpf-next 5/9] bpf: Add bpf helper bpf_tcp_check_probe_timer

2019-02-22 Thread brakmo
unction allows for setting a smaller probe timer. Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 12 +++- net/core/filter.c| 32 2 files changed, 43 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/bpf.h b/include/uapi/li

[PATCH v2 bpf-next 8/9] bpf: User program for testing NRM

2019-02-22 Thread brakmo
) Signed-off-by: Lawrence Brakmo --- samples/bpf/Makefile | 3 + samples/bpf/nrm.c| 440 +++ 2 files changed, 443 insertions(+) create mode 100644 samples/bpf/nrm.c diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 897b467066fd..6186c9fc317

[PATCH v2 bpf-next 7/9] bpf: Sample NRM BPF program to limit egress bw

2019-02-22 Thread brakmo
ides such a program (nrm.c) Signed-off-by: Lawrence Brakmo --- samples/bpf/Makefile | 2 + samples/bpf/nrm.h | 31 ++ samples/bpf/nrm_kern.h | 137 ++ samples/bpf/nrm_out_kern.c | 190 + 4 files changed, 360 i

[PATCH v2 bpf-next 9/9] bpf: NRM test script

2019-02-22 Thread brakmo
he program netserver manually on the remote host. It will use 1 flow, a rate limit of 2Gbps and dctcp. ./do_nrm_test.sh -f=1 -r=2000 -t=5 -N -D --stats -w dctcp \ -s= As previous, but allows use of extra bandwidth. For this test the rate is 8Gbps vs. 1Gbps of the previous test.

[PATCH v2 bpf-next 0/9] bpf: Network Resource Manager (NRM)

2019-02-22 Thread brakmo
ECN_ defines instead of integers. * NRM script test program now uses bpftool instead of load_cg_skb Martin KaFai Lau (2): bpf: Remove const from get_func_proto bpf: Add bpf helper bpf_tcp_enter_cwr brakmo (7): bpf: Test bpf_tcp_enter_cwr in test_verifier bpf: add bpf helper bpf_skb_ecn_s

Re: [PATCH bpf-next 3/9] bpf: add bpf helper bpf_skb_set_ecn

2019-02-20 Thread Lawrence Brakmo
On 2/19/19, 10:30 AM, "Eric Dumazet" wrote: On 02/18/2019 09:38 PM, brakmo wrote: > This patch adds a new bpf helper BPF_FUNC_skb_set_ecn > "int bpf_skb_set_Ecn(struct sk_buff *skb)". It is added to > BPF_PROG_TYPE_CGROUP_SKB typed bpf_prog

Re: [PATCH bpf-next 1/9] bpf: Add bpf helper bpf_tcp_enter_cwr

2019-02-20 Thread Lawrence Brakmo
On 2/19/19, 10:30 AM, "Eric Dumazet" wrote: On 02/18/2019 09:38 PM, brakmo wrote: > This patch adds a new bpf helper BPF_FUNC_tcp_enter_cwr > "int bpf_tcp_enter_cwr(struct bpf_tcp_sock *tp)". > It is added to BPF_PROG_TYPE_CGROUP_SKB typed b

Re: [PATCH bpf-next 3/9] bpf: add bpf helper bpf_skb_set_ecn

2019-02-19 Thread Lawrence Brakmo
On 2/19/19, 2:52 AM, "netdev-ow...@vger.kernel.org on behalf of Daniel Borkmann" wrote: On 02/19/2019 06:38 AM, brakmo wrote: > This patch adds a new bpf helper BPF_FUNC_skb_set_ecn > "int bpf_skb_set_Ecn(struct sk_buff *skb)". It is added to > B

Re: [PATCH bpf-next 1/9] bpf: Add bpf helper bpf_tcp_enter_cwr

2019-02-19 Thread Lawrence Brakmo
On 2/19/19, 2:24 AM, "Daniel Borkmann" wrote: On 02/19/2019 06:38 AM, brakmo wrote: > This patch adds a new bpf helper BPF_FUNC_tcp_enter_cwr > "int bpf_tcp_enter_cwr(struct bpf_tcp_sock *tp)". > It is added to BPF_PROG_TYPE_CGROUP_SKB typed bpf_p

Re: [PATCH bpf-next 7/9] bpf: Sample NRM BPF program to limit egress bw

2019-02-19 Thread Lawrence Brakmo
On 2/19/19, 10:29 AM, "netdev-ow...@vger.kernel.org on behalf of Eric Dumazet" wrote: On 02/18/2019 09:38 PM, brakmo wrote: > + > +static __always_inline void get_nrm_pkt_info(struct bpf_sock *sk, > + struct

[PATCH bpf-next 2/9] bpf: Test bpf_tcp_enter_cwr in test_verifier

2019-02-18 Thread brakmo
This test ensures the verifier has checked the arg1 of BPF_FUNC_tcp_enter_cwr is of ARG_PTR_TO_TCP_SOCK type. Signed-off-by: Martin KaFai Lau Signed-off-by: Lawrence Brakmo --- tools/testing/selftests/bpf/verifier/sock.c | 33 + 1 file changed, 33 insertions(+) diff --git

[PATCH bpf-next 6/9] bpf: Sample program to load cg skb BPF programs

2019-02-18 Thread brakmo
ot;-i" is used, the program is attached as ingress (default is egress). load_cg_skb -r[i] Detaches the currnetly attached egress (or ingress if -ri is used) cg skb program from the specified cgroup. Signed-off-by: Lawrence Brakmo --- samples/bpf/Makefile | 2 + s

[PATCH bpf-next 5/9] bpf: sync bpf.h to tools and update bpf_helpers.h

2019-02-18 Thread brakmo
This patch syncs the uapi bpf.h to tools/ and also updates bpf_herlpers.h in tools/ Signed-off-by: Lawrence Brakmo --- tools/include/uapi/linux/bpf.h| 27 ++- tools/testing/selftests/bpf/bpf_helpers.h | 6 + 2 files changed, 32 insertions(+), 1 deletion

[PATCH bpf-next 1/9] bpf: Add bpf helper bpf_tcp_enter_cwr

2019-02-18 Thread brakmo
used by a bpf_prog to manage egress network bandwidth limit per cgroupv2. A later patch will have a sample program to show how it can be used to limit bandwidth usage per cgroupv2. Signed-off-by: Lawrence Brakmo Signed-off-by: Martin KaFai Lau --- include/linux/bpf.h | 1 + include/uapi/linux/

[PATCH bpf-next 9/9] bpf: NRM test script

2019-02-18 Thread brakmo
he program netserver manually on the remote host. It will use 1 flow, a rate limit of 2Gbps and dctcp. ./do_nrm_test.sh -f=1 -r=2000 -t=5 -N -D --stats -w dctcp \ -s= As previous, but allows use of extra bandwidth. For this test the rate is 8Gbps vs. 1Gbps of the previous test.

[PATCH bpf-next 7/9] bpf: Sample NRM BPF program to limit egress bw

2019-02-18 Thread brakmo
ides such a program (nrm.c) Signed-off-by: Lawrence Brakmo --- samples/bpf/Makefile | 2 + samples/bpf/nrm.h | 31 ++ samples/bpf/nrm_kern.h | 109 +++ samples/bpf/nrm_out_kern.c | 213 + 4 files changed, 355 i

[PATCH bpf-next 8/9] bpf: User program for testing NRM

2019-02-18 Thread brakmo
) Signed-off-by: Lawrence Brakmo --- samples/bpf/Makefile | 3 + samples/bpf/nrm.c| 439 +++ 2 files changed, 442 insertions(+) create mode 100644 samples/bpf/nrm.c diff --git a/samples/bpf/Makefile b/samples/bpf/Makefile index 86633af239d4..248a88355a6

[PATCH bpf-next 4/9] bpf: Add bpf helper bpf_tcp_check_probe_timer

2019-02-18 Thread brakmo
Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 12 +++- net/core/filter.c| 27 +++ 2 files changed, 38 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h index 5daf404511f7..a78936acccae 100644 ---

[PATCH bpf-next 3/9] bpf: add bpf helper bpf_skb_set_ecn

2019-02-18 Thread brakmo
sed to set the ECN bits (2) of the IPv6 or IPv4 header in skb. It can be used by a bpf_prog to manage egress network bandwdith limit per cgroupv2 by inducing an ECN response in the TCP sender (when the packet is ECN enabled). This works best when using DCTCP. Signed-off-by: Lawrence Brakmo --- in

[PATCH bpf-next 0/9] bpf: Network Resource Manager (NRM)

2019-02-18 Thread brakmo
vided in an upcomming patchset. brakmo (9): bpf: Add bpf helper bpf_tcp_enter_cwr bpf: Test bpf_tcp_enter_cwr in test_verifier bpf: add bpf helper bpf_skb_set_ecn bpf: Add bpf helper bpf_tcp_check_probe_timer bpf: sync bpf.h to tools and update bpf_helpers.h bpf: Sample program to lo

Re: [PATCH bpf-next] bpf: support SO_DEBUG in bpf_setsockopt()

2019-02-03 Thread Lawrence Brakmo
On 2/3/19, 12:15 AM, "Yafang Shao" wrote: Then we can enable/disable socket debugging without modifying user code. That is more convenient for debugging. Signed-off-by: Yafang Shao Acked-by: Lawrence Brakmo --- include/net/sock.h | 8 net/cor

Re: [PATCH bpf-next] bpf: use the proper optlen when doing strncpy in bpf_getsockopt()

2019-01-22 Thread Lawrence Brakmo
it will make it more consistent with the bpf_setsockopt() above. Acked-by: Martin KaFai Lau Cc: Lawrence Brakmo Acked-by: Lawrence Brakmo > > Signed-off-by: Yafang Shao > --- > net/core/filter.c | 2 +- > 1 file chan

Re: [PATCH bpf-next] bpf: sock recvbuff must be limited by rmem_max in bpf_setsockopt()

2019-01-22 Thread Lawrence Brakmo
Yafang Shao For bug fixes, please target the bpf branch instead of bpf-next and please also add the Fixes tag: Fixes: 8c4b4c7e9ff0 ("bpf: Add setsockopt helper function to bpf") Patch LGTM, Acked-by: Martin KaFai Lau Cc: Lawrence Brakmo, thought?

Re: [PATCH bpf] bpf: correctly set initial window on active Fast Open sender

2019-01-09 Thread Lawrence Brakmo
t;= 0 || tp->data_segs_out > tp->syn_data) ret = -EINVAL; else tp->snd_cwnd = val; -- 2.20.1.97.g81188d93c3-goog Looks good to me. Acked-by: Lawrence Brakmo

Re: [PATCH net-next] tcp: ack immediately when a cwr packet arrives

2018-07-24 Thread Lawrence Brakmo
Note that without this fix the 99% latencies when doing 10KB RPCs in a congested network using DCTCP are 40ms vs. 190us with the patch. Also note that these 40ms high tail latencies started after commit 3759824da87b30ce7a35b4873b62b0ba38905ef5 in Jul 2015, which triggered the bugs/features we a

[PATCH net-next] tcp: ack immediately when a cwr packet arrives

2018-07-23 Thread Lawrence Brakmo
01(0) ack 4 win 257 Modified based on comments by Neal Cardwell Signed-off-by: Lawrence Brakmo --- net/ipv4/tcp_input.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 91dbb9afb950..2370fd79c5c5 100644 --- a/net/ipv4/tcp_inp

Re: [PATCH bpf-next 0/6] TCP-BPF callback for listening sockets

2018-07-12 Thread Lawrence Brakmo
LGTM. Thank you for adding the listen callback and cleaning up the test. Acked-by: Lawrence Brakmo On 7/11/18, 8:34 PM, "Andrey Ignatov" wrote: This patchset adds TCP-BPF callback for listening sockets. Patch 0001 provides more details and is the main patch

Re: [PATCH net 1/2] tcp: fix dctcp delayed ACK schedule

2018-07-12 Thread Lawrence Brakmo
cknowledging the latest data until the sender times out and retry in some cases. Packetdrill script (provided by Larry Brakmo) 0.000 socket(..., SOCK_STREAM, IPPROTO_TCP) = 3 0.000 setsockopt(3, SOL_SOCKET, SO_REUSEADDR, [1], 4) = 0 0.000 setsockopt(3, SOL_TCP, TCP_CONGES

Re: [PATCH net 2/2] tcp: remove DELAYED ACK events in DCTCP

2018-07-12 Thread Lawrence Brakmo
LGTM. Thanks for the patch. Acked-by: Lawrence Brakmo On 7/12/18, 9:05 AM, "Yuchung Cheng" wrote: After fixing the way DCTCP tracking delayed ACKs, the delayed-ACK related callbacks are no longer needed Signed-off-by: Yuchung Cheng Signed-off-by: Eric Dumazet

Re: [PATCH net-next v3 0/2] tcp: fix high tail latencies in DCTCP

2018-07-09 Thread Lawrence Brakmo
On 7/9/18, 12:32 PM, "Yuchung Cheng" wrote: On Sat, Jul 7, 2018 at 7:07 AM, Neal Cardwell wrote: > On Sat, Jul 7, 2018 at 7:15 AM David Miller wrote: >> >> From: Lawrence Brakmo >> Date: Tue, 3 Jul 2018 09:26:13 -0700 >> >&g

Re: [PATCH net-next v2 1/2] tcp: notify when a delayed ack is sent

2018-07-03 Thread Lawrence Brakmo
On 7/3/18, 6:15 AM, "Neal Cardwell" wrote: On Mon, Jul 2, 2018 at 7:49 PM Yuchung Cheng wrote: > > On Mon, Jul 2, 2018 at 2:39 PM, Lawrence Brakmo wrote: > > > > DCTCP depends on the CA_EVENT_NON_DELAYED_ACK and CA_EVENT_DELAYED_ACK > >

[PATCH net-next v3 1/2] tcp: notify when a delayed ack is sent

2018-07-03 Thread Lawrence Brakmo
roved based on comments from Neal Cardwell . Signed-off-by: Lawrence Brakmo --- net/ipv4/tcp_output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index f8f6129160dd..acefb64e8280 100644 --- a/net/ipv4/tcp_output.c +++ b/net

[PATCH net-next v3 2/2] tcp: ack immediately when a cwr packet arrives

2018-07-03 Thread Lawrence Brakmo
arrives, the ACK was sometimes delayed even though it is CWR marked, adding up to 40ms to the RPC latency. This patch insures that CWR makred data packets arriving will be acked immediately. Modified based on comments by Neal Cardwell Signed-off-by: Lawrence Brakmo --- net/ipv4/tcp_input.c | 9

[PATCH net-next v3 0/2] tcp: fix high tail latencies in DCTCP

2018-07-03 Thread Lawrence Brakmo
When have observed high tail latencies when using DCTCP for RPCs as compared to using Cubic. For example, in one setup there are 2 hosts sending to a 3rd one, with each sender having 3 flows (1 stream, 1 1MB back-to-back RPCs and 1 10KB back-to-back RPCs). The following table shows the 99% and 99.9

Re: [PATCH net-next v2 1/2] tcp: notify when a delayed ack is sent

2018-07-03 Thread Lawrence Brakmo
On 7/2/18, 4:50 PM, "Yuchung Cheng" wrote: On Mon, Jul 2, 2018 at 2:39 PM, Lawrence Brakmo wrote: > > DCTCP depends on the CA_EVENT_NON_DELAYED_ACK and CA_EVENT_DELAYED_ACK > notifications to keep track if it needs to send an ACK for packets that >

Re: [PATCH net-next v2 0/2] tcp: fix high tail latencies in DCTCP

2018-07-03 Thread Lawrence Brakmo
On 7/2/18, 5:52 PM, "netdev-ow...@vger.kernel.org on behalf of Neal Cardwell" wrote: On Mon, Jul 2, 2018 at 5:39 PM Lawrence Brakmo wrote: > > When have observed high tail latencies when using DCTCP for RPCs as > compared to using Cubic. For example, in on

[PATCH net-next v2 0/2] tcp: fix high tail latencies in DCTCP

2018-07-02 Thread Lawrence Brakmo
When have observed high tail latencies when using DCTCP for RPCs as compared to using Cubic. For example, in one setup there are 2 hosts sending to a 3rd one, with each sender having 3 flows (1 stream, 1 1MB back-to-back RPCs and 1 10KB back-to-back RPCs). The following table shows the 99% and 99.9

[PATCH net-next v2 2/2] tcp: ack immediately when a cwr packet arrives

2018-07-02 Thread Lawrence Brakmo
arrives, the ACK was sometimes delayed even though it is CWR marked, adding up to 40ms to the RPC latency. This patch insures that CWR makred data packets arriving will be acked immediately. Modified based on comments by Neal Cardwell Signed-off-by: Lawrence Brakmo --- net/ipv4/tcp_input.c

[PATCH net-next v2 1/2] tcp: notify when a delayed ack is sent

2018-07-02 Thread Lawrence Brakmo
roved based on comments from Neal Cardwell . Signed-off-by: Lawrence Brakmo --- net/ipv4/tcp_output.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index f8f6129160dd..acefb64e8280 100644 --- a/net/ipv4/tcp_output.c +++ b/net

Re: [PATCH net-next 2/2] tcp: ack immediately when a cwr packet arrives

2018-07-02 Thread Lawrence Brakmo
On 7/2/18, 7:57 AM, "Neal Cardwell" wrote: On Sat, Jun 30, 2018 at 9:47 PM Lawrence Brakmo wrote: > I see two issues, one is that entering quickack mode as you > mentioned does not insure that it will still be on when the CWR > arrives. The second issue

Re: [PATCH net-next 1/2] tcp: notify when a delayed ack is sent

2018-07-02 Thread Lawrence Brakmo
On 7/2/18, 8:18 AM, "netdev-ow...@vger.kernel.org on behalf of Neal Cardwell" wrote: On Fri, Jun 29, 2018 at 9:48 PM Lawrence Brakmo wrote: > > DCTCP depends on the CA_EVENT_NON_DELAYED_ACK and CA_EVENT_DELAYED_ACK > notifications to keep track if it needs

Re: [PATCH net-next 0/2] tcp: fix high tail latencies in DCTCP

2018-06-30 Thread Lawrence Brakmo
On 6/30/18, 5:26 PM, "netdev-ow...@vger.kernel.org on behalf of Neal Cardwell" wrote: On Fri, Jun 29, 2018 at 9:48 PM Lawrence Brakmo wrote: > > When have observed high tail latencies when using DCTCP for RPCs as > compared to using Cubic. For example, in on

Re: [PATCH net-next 2/2] tcp: ack immediately when a cwr packet arrives

2018-06-30 Thread Lawrence Brakmo
On 6/30/18, 11:23 AM, "Neal Cardwell" wrote: On Fri, Jun 29, 2018 at 9:48 PM Lawrence Brakmo wrote: > > We observed high 99 and 99.9% latencies when doing RPCs with DCTCP. The > problem is triggered when the last packet of a request arrives CE > marked

[PATCH net-next 2/2] tcp: ack immediately when a cwr packet arrives

2018-06-29 Thread Lawrence Brakmo
arrives it was sometimes delayed adding up to 40ms to the latency. This patch insures that CWR makred data packets arriving will be acked immediately. Signed-off-by: Lawrence Brakmo --- net/ipv4/tcp_input.c | 25 + 1 file changed, 17 insertions(+), 8 deletions(-) diff

[PATCH net-next 1/2] tcp: notify when a delayed ack is sent

2018-06-29 Thread Lawrence Brakmo
igned-off-by: Lawrence Brakmo --- net/ipv4/tcp_output.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index f8f6129160dd..41f6ad7a21e4 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -172,6 +172,8 @@ static inline

  1   2   3   4   5   >