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 BPF programs can > reque

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 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] 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

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

2019-07-02 Thread Lawrence Brakmo
4236 0.00 134 305 490 624 1310 10 17 > cubic-edt 5G4 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

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,

Re: [PATCH net] bpf: fix bpf_setsockopts return value

2017-08-24 Thread Lawrence Brakmo
Neal Cardwell > Signed-off-by: Yuchung Cheng > Acked-by: Neal Cardwell > Acked-by: Craig Gallek Ohh well, thanks for the fix! Acked-by: Daniel Borkmann Thanks! I never checked return values in by bpf test programs Acked-by: Lawrence Brakmo

Re: [PATCH net] tcp: fix refcnt leak with ebpf congestion control

2017-08-25 Thread Lawrence Brakmo
ca->flags & TCP_CONG_NON_RESTRICTED) || ns_capable(sock_net(sk)->user_ns, CAP_NET_ADMIN))) { err = -EPERM; -- 2.14.1 Thank you for finding and fixing these issues. Acked-by: Lawrence Brakmo

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 nrm_pkt_info *pkti)

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

2019-02-19 Thread Lawrence Brakmo
> 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/bpf.h | 9 - >

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

2019-02-19 Thread Lawrence Brakmo
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 > --- > include/uapi

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 bpf_prog > which currently

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 which currently can > be a

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 programs cannot trigger TCP c

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

2019-05-03 Thread Lawrence Brakmo
sed to specify the duration of the probe timer for the case described > earlier. The allowed values are between 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/ne

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_out is 0, it is beneficial to set a

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 a packet is dropped when calling queue_xmit in

[PATCH net-next] tcp: force cwnd at least 2 in tcp_cwnd_reduction

2018-06-26 Thread Lawrence Brakmo
r the problem). Signed-off-by: Lawrence Brakmo --- net/ipv4/tcp_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 76ca88f63b70..a9255c424761 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -2477,7 +2477,7 @@

[PATCH net-next v2] tcp: force cwnd at least 2 in tcp_cwnd_reduction

2018-06-26 Thread Lawrence Brakmo
r the problem). v2: fixed compiler warning in max function arguments Signed-off-by: Lawrence Brakmo --- net/ipv4/tcp_input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 76ca88f63b70..282bd85322b0 100644 --- a/net/ipv4/tcp_in

Re: [PATCH net-next v2] tcp: force cwnd at least 2 in tcp_cwnd_reduction

2018-06-28 Thread Lawrence Brakmo
On 6/28/18, 1:48 PM, "netdev-ow...@vger.kernel.org on behalf of Neal Cardwell" wrote: On Thu, Jun 28, 2018 at 4:20 PM Lawrence Brakmo wrote: > > I just looked at 4.18 traces and the behavior is as follows: > >Host A sends the last

Re: [PATCH net-next v2] tcp: force cwnd at least 2 in tcp_cwnd_reduction

2018-06-28 Thread Lawrence Brakmo
On 6/28/18, 1:48 PM, "netdev-ow...@vger.kernel.org on behalf of Neal Cardwell" wrote: On Thu, Jun 28, 2018 at 4:20 PM Lawrence Brakmo wrote: > > I just looked at 4.18 traces and the behavior is as follows: > >Host A sends the last

Re: [PATCH net-next v2] tcp: force cwnd at least 2 in tcp_cwnd_reduction

2018-06-29 Thread Lawrence Brakmo
On 6/28/18, 1:48 PM, "netdev-ow...@vger.kernel.org on behalf of Neal Cardwell" wrote: On Thu, Jun 28, 2018 at 4:20 PM Lawrence Brakmo wrote: > > I just looked at 4.18 traces and the behavior is as follows: > >Host A sends the last

[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

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

2018-06-29 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 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

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

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 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 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

[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

[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

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

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 >

[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

[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 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

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 > >

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 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 1/2] tcp: fix dctcp delayed ACK schedule

2018-07-12 Thread Lawrence Brakmo
mp; + inet_csk(sk)->icsk_ack.pending & ICSK_ACK_TIMER) { u32 tmp_rcv_nxt; /* Save current rcv_nxt. */ -- 2.18.0.203.gfac676dfb9-goog LGTM. Thanks for the patch. Acked-by: Lawrence Brakmo

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

[PATCH bpf 02/11] bpf: Make SOCK_OPS_GET_TCP struct independent

2017-12-18 Thread Lawrence Brakmo
quotation). Assumes FIELD_NAME is a field in the struct bpf_sock_ops and in the OBJ specified. Signed-off-by: Lawrence Brakmo --- net/core/filter.c | 18 +- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/net/core/filter.c b/net/core/filter.c index d47d126..f808269 1

[PATCH bpf 01/11] bpf: Make SOCK_OPS_GET_TCP size independent

2017-12-18 Thread Lawrence Brakmo
Make SOCK_OPS_GET_TCP helper macro size independent (before only worked with 4-byte fields. Signed-off-by: Lawrence Brakmo --- net/core/filter.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/net/core/filter.c b/net/core/filter.c index 754abe1..d47d126 100644

[PATCH bpf 06/11] bpf: Add sock_ops RTO callback

2017-12-18 Thread Lawrence Brakmo
Adds an optional call to sock_ops BPF program based on whether the BPF_SOCK_OPS_RTO_CB_FLAG is set in bpf_sock_ops_flags. The BPF program is passed 2 arguments: icsk_retransmits and whether the RTO has expired. Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 5 + include/uapi

[PATCH bpf 11/11] bpf: add selftest for tcpbpf

2017-12-18 Thread Lawrence Brakmo
Added a selftest for tcpbpf (sock_ops) that checks that the appropriate callbacks occured and that it can access tcp_sock fields and that their values are correct. Signed-off-by: Lawrence Brakmo --- tools/include/uapi/linux/bpf.h | 45 - tools/testing/selftests/bpf

[PATCH bpf 03/11] bpf: Add write access to tcp_sock and sock fields

2017-12-18 Thread Lawrence Brakmo
the macro SOCK_OPS_GET_OR_SET_FIELD that calls one of the GET or SET macros depending on the value of the TYPE field. Signed-off-by: Lawrence Brakmo --- include/linux/filter.h | 3 +++ include/net/tcp.h | 2 +- net/core/filter.c | 46 ++ 3 files changed, 50 insert

[PATCH bpf 04/11] bpf: Support passing args to sock_ops bpf function

2017-12-18 Thread Lawrence Brakmo
Adds support for passing up to 4 arguments to sock_ops bpf functions. It reusues the reply union, so the bpf_sock_ops structures are not increased in size. Signed-off-by: Lawrence Brakmo --- include/linux/filter.h | 1 + include/net/tcp.h| 64

[PATCH bpf 05/11] bpf: Adds field bpf_sock_ops_flags to tcp_sock

2017-12-18 Thread Lawrence Brakmo
received Signed-off-by: Lawrence Brakmo --- include/linux/tcp.h | 8 include/uapi/linux/bpf.h | 1 + net/core/filter.c| 6 ++ 3 files changed, 15 insertions(+) diff --git a/include/linux/tcp.h b/include/linux/tcp.h index df5d97a..c46553f 100644 --- a/include/linux/tcp.h

[PATCH bpf 0/11] bpf: more sock_ops callbacks

2017-12-18 Thread Lawrence Brakmo
when packet is retransmitted - optionally calling sock_ops BPF program when TCP state changes - access to tclass and sk_txhash - new selftest Signed-off-by: Lawrence Brakmo Consists of the following patches: [PATCH bpf 01/11] bpf: Make SOCK_OPS_GET_TCP size independent [PATCH bpf 02/11] bpf: Make

[PATCH bpf 10/11] bpf: Add BPF_SOCK_OPS_STATE_CB

2017-12-18 Thread Lawrence Brakmo
Adds support for calling sock_ops BPF program when there is a TCP state change. Two arguments are used; one for the old state and another for the new state. New op: BPF_SOCK_OPS_STATE_CB. Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 4 include/uapi/linux/tcp.h | 1 + net

[PATCH bpf 09/11] bpf: Add BPF_SOCK_OPS_RETRANS_CB

2017-12-18 Thread Lawrence Brakmo
Adds support for calling sock_ops BPF program when there is a retransmission. Two arguments are used; one for the sequence number and other for the number of segments retransmitted. Does not include syn-ack retransmissions. New op: BPF_SOCK_OPS_RETRANS_CB. Signed-off-by: Lawrence Brakmo

[PATCH bpf 07/11] bpf: Add support for reading sk_state and more

2017-12-18 Thread Lawrence Brakmo
etrans segs_in data_segs_in segs_out data_segs_out bytes_received (__u64) bytes_acked(__u64) Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 19 ++ net/core/filter.c| 96 +++- 2 files changed, 114 insertions

[PATCH bpf 08/11] bpf: Add sock_ops R/W access to tclass & sk_txhash

2017-12-18 Thread Lawrence Brakmo
Adds direct R/W access to sk_txhash and access to tclass for ipv6 flows through getsockopt and setsockopt. Sample usage for tclass: bpf_getsockopt(skops, SOL_IPV6, IPV6_TCLASS, &v, sizeof(v)) where skops is a pointer to the ctx (struct bpf_sock_ops). Signed-off-by: Lawrence Br

[PATCH bpf-next 05/11] bpf: Adds field bpf_sock_ops_flags to tcp_sock

2017-12-20 Thread Lawrence Brakmo
received Signed-off-by: Lawrence Brakmo --- include/linux/tcp.h | 8 include/uapi/linux/bpf.h | 1 + net/core/filter.c| 7 +++ 3 files changed, 16 insertions(+) diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 4f93f095..62f4388 100644 --- a/include/linux/tcp.h

[PATCH bpf-next 01/11] bpf: Make SOCK_OPS_GET_TCP size independent

2017-12-20 Thread Lawrence Brakmo
Make SOCK_OPS_GET_TCP helper macro size independent (before only worked with 4-byte fields. Signed-off-by: Lawrence Brakmo --- net/core/filter.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/net/core/filter.c b/net/core/filter.c index 130b842..099ff9fd 100644

[PATCH bpf-next 0/11] bpf: more sock_ops callbacks

2017-12-20 Thread Lawrence Brakmo
when packet is retransmitted - optionally calling sock_ops BPF program when TCP state changes - access to tclass and sk_txhash - new selftest Signed-off-by: Lawrence Brakmo Consists of the following patches: [PATCH bpf 01/11] bpf: Make SOCK_OPS_GET_TCP size independent [PATCH bpf 02/11] bpf: Make

[PATCH bpf-next 06/11] bpf: Add sock_ops RTO callback

2017-12-20 Thread Lawrence Brakmo
Adds an optional call to sock_ops BPF program based on whether the BPF_SOCK_OPS_RTO_CB_FLAG is set in bpf_sock_ops_flags. The BPF program is passed 2 arguments: icsk_retransmits and whether the RTO has expired. Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 5 + include/uapi

[PATCH bpf-next 11/11] bpf: add selftest for tcpbpf

2017-12-20 Thread Lawrence Brakmo
Added a selftest for tcpbpf (sock_ops) that checks that the appropriate callbacks occured and that it can access tcp_sock fields and that their values are correct. Run with command: ./test_tcpbpf_user Signed-off-by: Lawrence Brakmo --- tools/include/uapi/linux/bpf.h | 45

[PATCH bpf-next 02/11] bpf: Make SOCK_OPS_GET_TCP struct independent

2017-12-20 Thread Lawrence Brakmo
Return a fixed value (e.x. 0 or 0x), or 2) Make the verifier fail if that field is accessed (i.e. program fails to load) so the user will know that field is no longer supported. Signed-off-by: Lawrence Brakmo --- net/core/filter.c | 20 ++-- 1 file changed,

[PATCH bpf-next 03/11] bpf: Add write access to tcp_sock and sock fields

2017-12-20 Thread Lawrence Brakmo
the macro SOCK_OPS_GET_OR_SET_FIELD that calls one of the GET or SET macros depending on the value of the TYPE field. Signed-off-by: Lawrence Brakmo --- include/linux/filter.h | 3 +++ include/net/tcp.h | 2 +- net/core/filter.c | 48 3 files changed, 52

[PATCH bpf-next 08/11] bpf: Add sock_ops R/W access to tclass & sk_txhash

2017-12-20 Thread Lawrence Brakmo
Adds direct R/W access to sk_txhash and access to tclass for ipv6 flows through getsockopt and setsockopt. Sample usage for tclass: bpf_getsockopt(skops, SOL_IPV6, IPV6_TCLASS, &v, sizeof(v)) where skops is a pointer to the ctx (struct bpf_sock_ops). Signed-off-by: Lawrence Br

[PATCH bpf-next 04/11] bpf: Support passing args to sock_ops bpf function

2017-12-20 Thread Lawrence Brakmo
Adds support for passing up to 4 arguments to sock_ops bpf functions. It reusues the reply union, so the bpf_sock_ops structures are not increased in size. Signed-off-by: Lawrence Brakmo --- include/linux/filter.h | 1 + include/net/tcp.h| 64

[PATCH bpf-next 09/11] bpf: Add BPF_SOCK_OPS_RETRANS_CB

2017-12-20 Thread Lawrence Brakmo
Adds support for calling sock_ops BPF program when there is a retransmission. Two arguments are used; one for the sequence number and other for the number of segments retransmitted. Does not include syn-ack retransmissions. New op: BPF_SOCK_OPS_RETRANS_CB. Signed-off-by: Lawrence Brakmo

[PATCH bpf-next 07/11] bpf: Add support for reading sk_state and more

2017-12-20 Thread Lawrence Brakmo
etrans segs_in data_segs_in segs_out data_segs_out bytes_received (__u64) bytes_acked(__u64) Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 19 + net/core/filter.c| 101 ++- 2 files changed, 119 insertions

[PATCH bpf-next 10/11] bpf: Add BPF_SOCK_OPS_STATE_CB

2017-12-20 Thread Lawrence Brakmo
Adds support for calling sock_ops BPF program when there is a TCP state change. Two arguments are used; one for the old state and another for the new state. New op: BPF_SOCK_OPS_STATE_CB. Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 4 include/uapi/linux/tcp.h | 1 + net

Re: [PATCH bpf-next 0/11] bpf: more sock_ops callbacks

2017-12-21 Thread Lawrence Brakmo
Daniel, Dam, by mistake I copied the “consists of the following pachtes” from the previous bpf branch commit. I will send a corrected patch set in a few minutes. Thanks, - Lawrence On 12/21/17, 4:03 PM, "Daniel Borkmann" wrote: On 12/20/2017 10:16 PM, Lawrence Brakmo wrote:

[PATCH v2 bpf-next 00/11]

2017-12-21 Thread Lawrence Brakmo
when packet is retransmitted - optionally calling sock_ops BPF program when TCP state changes - access to tclass and sk_txhash - new selftest v2: Fixed commit message 0/11. The commit is to "bpf-next" but the patch below used "bpf" and Patchwork didn't work correctly.

[PATCH v2 bpf-next 02/11] bpf: Make SOCK_OPS_GET_TCP struct independent

2017-12-21 Thread Lawrence Brakmo
Return a fixed value (e.x. 0 or 0x), or 2) Make the verifier fail if that field is accessed (i.e. program fails to load) so the user will know that field is no longer supported. Signed-off-by: Lawrence Brakmo --- net/core/filter.c | 20 ++-- 1 file changed,

[PATCH v2 bpf-next 04/11] bpf: Support passing args to sock_ops bpf function

2017-12-21 Thread Lawrence Brakmo
Adds support for passing up to 4 arguments to sock_ops bpf functions. It reusues the reply union, so the bpf_sock_ops structures are not increased in size. Signed-off-by: Lawrence Brakmo --- include/linux/filter.h | 1 + include/net/tcp.h| 64

[PATCH v2 bpf-next 08/11] bpf: Add sock_ops R/W access to tclass & sk_txhash

2017-12-21 Thread Lawrence Brakmo
Adds direct R/W access to sk_txhash and access to tclass for ipv6 flows through getsockopt and setsockopt. Sample usage for tclass: bpf_getsockopt(skops, SOL_IPV6, IPV6_TCLASS, &v, sizeof(v)) where skops is a pointer to the ctx (struct bpf_sock_ops). Signed-off-by: Lawrence Br

[PATCH v2 bpf-next 07/11] bpf: Add support for reading sk_state and more

2017-12-21 Thread Lawrence Brakmo
etrans segs_in data_segs_in segs_out data_segs_out bytes_received (__u64) bytes_acked(__u64) Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 19 + net/core/filter.c| 101 ++- 2 files changed, 119 insertions

[PATCH v2 bpf-next 05/11] bpf: Adds field bpf_sock_ops_flags to tcp_sock

2017-12-21 Thread Lawrence Brakmo
received Signed-off-by: Lawrence Brakmo --- include/linux/tcp.h | 8 include/uapi/linux/bpf.h | 1 + net/core/filter.c| 7 +++ 3 files changed, 16 insertions(+) diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 4f93f095..62f4388 100644 --- a/include/linux/tcp.h

[PATCH v2 bpf-next 03/11] bpf: Add write access to tcp_sock and sock fields

2017-12-21 Thread Lawrence Brakmo
the macro SOCK_OPS_GET_OR_SET_FIELD that calls one of the GET or SET macros depending on the value of the TYPE field. Signed-off-by: Lawrence Brakmo --- include/linux/filter.h | 3 +++ include/net/tcp.h | 2 +- net/core/filter.c | 48 3 files changed, 52

[PATCH v2 bpf-next 06/11] bpf: Add sock_ops RTO callback

2017-12-21 Thread Lawrence Brakmo
Adds an optional call to sock_ops BPF program based on whether the BPF_SOCK_OPS_RTO_CB_FLAG is set in bpf_sock_ops_flags. The BPF program is passed 2 arguments: icsk_retransmits and whether the RTO has expired. Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 5 + include/uapi

[PATCH v2 bpf-next 11/11] bpf: add selftest for tcpbpf

2017-12-21 Thread Lawrence Brakmo
Added a selftest for tcpbpf (sock_ops) that checks that the appropriate callbacks occured and that it can access tcp_sock fields and that their values are correct. Run with command: ./test_tcpbpf_user Signed-off-by: Lawrence Brakmo --- tools/include/uapi/linux/bpf.h | 45

[PATCH v2 bpf-next 10/11] bpf: Add BPF_SOCK_OPS_STATE_CB

2017-12-21 Thread Lawrence Brakmo
Adds support for calling sock_ops BPF program when there is a TCP state change. Two arguments are used; one for the old state and another for the new state. New op: BPF_SOCK_OPS_STATE_CB. Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 4 include/uapi/linux/tcp.h | 1 + net

[PATCH v2 bpf-next 09/11] bpf: Add BPF_SOCK_OPS_RETRANS_CB

2017-12-21 Thread Lawrence Brakmo
Adds support for calling sock_ops BPF program when there is a retransmission. Two arguments are used; one for the sequence number and other for the number of segments retransmitted. Does not include syn-ack retransmissions. New op: BPF_SOCK_OPS_RETRANS_CB. Signed-off-by: Lawrence Brakmo

[PATCH v2 bpf-next 01/11] bpf: Make SOCK_OPS_GET_TCP size independent

2017-12-21 Thread Lawrence Brakmo
Make SOCK_OPS_GET_TCP helper macro size independent (before only worked with 4-byte fields. Signed-off-by: Lawrence Brakmo --- net/core/filter.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/net/core/filter.c b/net/core/filter.c index 130b842..099ff9fd 100644

Re: [PATCH v2 bpf-next 06/11] bpf: Add sock_ops RTO callback

2017-12-31 Thread Lawrence Brakmo
On 12/28/17, 9:58 AM, "Yuchung Cheng" wrote: On Thu, Dec 21, 2017 at 5:20 PM, Lawrence Brakmo wrote: > > Adds an optional call to sock_ops BPF program based on whether the > BPF_SOCK_OPS_RTO_CB_FLAG is set in bpf_sock_ops_flags. > The BPF program

[PATCH v3 bpf-next 04/11] bpf: Support passing args to sock_ops bpf function

2017-12-31 Thread Lawrence Brakmo
Adds support for passing up to 4 arguments to sock_ops bpf functions. It reusues the reply union, so the bpf_sock_ops structures are not increased in size. Signed-off-by: Lawrence Brakmo --- include/linux/filter.h | 1 + include/net/tcp.h| 64

[PATCH v3 bpf-next 03/11] bpf: Add write access to tcp_sock and sock fields

2017-12-31 Thread Lawrence Brakmo
the macro SOCK_OPS_GET_OR_SET_FIELD that calls one of the GET or SET macros depending on the value of the TYPE field. Signed-off-by: Lawrence Brakmo --- include/linux/filter.h | 3 +++ include/net/tcp.h | 2 +- net/core/filter.c | 48 3 files changed, 52

[PATCH v3 bpf-next 02/11] bpf: Make SOCK_OPS_GET_TCP struct independent

2017-12-31 Thread Lawrence Brakmo
Return a fixed value (e.x. 0 or 0x), or 2) Make the verifier fail if that field is accessed (i.e. program fails to load) so the user will know that field is no longer supported. Signed-off-by: Lawrence Brakmo --- net/core/filter.c | 20 ++-- 1 file changed,

[PATCH v3 bpf-next 00/11] bpf: More sock_ops callbacks

2017-12-31 Thread Lawrence Brakmo
: Cleaned RTO callback as per Yuchung's comment Added BPF enum for TCP states as per Alexei's comment Signed-off-by: Lawrence Brakmo Consists of the following patches: [PATCH v3 bpf-next 01/11] bpf: Make SOCK_OPS_GET_TCP size independent [PATCH v3 bpf-next 02/11] bpf: Make SOCK_OP

[PATCH v3 bpf-next 10/11] bpf: Add BPF_SOCK_OPS_STATE_CB

2017-12-31 Thread Lawrence Brakmo
necessary to change the internal TCP state values (other than adding more to the end), then it will become necessary to convert from the internal TCP state value to the BPF value before calling the BPF sock_ops function. New op: BPF_SOCK_OPS_STATE_CB. Signed-off-by: Lawrence Brakmo --- include

[PATCH v3 bpf-next 07/11] bpf: Add support for reading sk_state and more

2017-12-31 Thread Lawrence Brakmo
etrans segs_in data_segs_in segs_out data_segs_out bytes_received (__u64) bytes_acked(__u64) Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 19 + net/core/filter.c| 101 ++- 2 files changed, 119 insertions

[PATCH v3 bpf-next 11/11] bpf: add selftest for tcpbpf

2017-12-31 Thread Lawrence Brakmo
Added a selftest for tcpbpf (sock_ops) that checks that the appropriate callbacks occured and that it can access tcp_sock fields and that their values are correct. Run with command: ./test_tcpbpf_user Signed-off-by: Lawrence Brakmo --- tools/include/uapi/linux/bpf.h | 70

[PATCH v3 bpf-next 09/11] bpf: Add BPF_SOCK_OPS_RETRANS_CB

2017-12-31 Thread Lawrence Brakmo
Adds support for calling sock_ops BPF program when there is a retransmission. Two arguments are used; one for the sequence number and other for the number of segments retransmitted. Does not include syn-ack retransmissions. New op: BPF_SOCK_OPS_RETRANS_CB. Signed-off-by: Lawrence Brakmo

[PATCH v3 bpf-next 05/11] bpf: Adds field bpf_sock_ops_flags to tcp_sock

2017-12-31 Thread Lawrence Brakmo
received Signed-off-by: Lawrence Brakmo --- include/linux/tcp.h | 8 include/uapi/linux/bpf.h | 1 + net/core/filter.c| 7 +++ 3 files changed, 16 insertions(+) diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 4f93f095..62f4388 100644 --- a/include/linux/tcp.h

[PATCH v3 bpf-next 08/11] bpf: Add sock_ops R/W access to tclass & sk_txhash

2017-12-31 Thread Lawrence Brakmo
Adds direct R/W access to sk_txhash and access to tclass for ipv6 flows through getsockopt and setsockopt. Sample usage for tclass: bpf_getsockopt(skops, SOL_IPV6, IPV6_TCLASS, &v, sizeof(v)) where skops is a pointer to the ctx (struct bpf_sock_ops). Signed-off-by: Lawrence Br

[PATCH v3 bpf-next 06/11] bpf: Add sock_ops RTO callback

2017-12-31 Thread Lawrence Brakmo
Adds an optional call to sock_ops BPF program based on whether the BPF_SOCK_OPS_RTO_CB_FLAG is set in bpf_sock_ops_flags. The BPF program is passed 2 arguments: icsk_retransmits and whether the RTO has expired. Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 5 + include/uapi

[PATCH v3 bpf-next 01/11] bpf: Make SOCK_OPS_GET_TCP size independent

2017-12-31 Thread Lawrence Brakmo
Make SOCK_OPS_GET_TCP helper macro size independent (before only worked with 4-byte fields. Signed-off-by: Lawrence Brakmo --- net/core/filter.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/net/core/filter.c b/net/core/filter.c index 130b842..099ff9fd 100644

Re: [PATCH v3 bpf-next 10/11] bpf: Add BPF_SOCK_OPS_STATE_CB

2018-01-03 Thread Lawrence Brakmo
applied to the wrong git tree, please drop us a note to help improve the system] url: https://github.com/0day-ci/linux/commits/Lawrence-Brakmo/bpf-More-sock_ops-callbacks/20180102-111550 config: x86_64-randconfig-x007-201800 (attached as .config) compiler: gcc-7 (Debian 7.2.0

[PATCH bpf-next v4 11/11] bpf: add selftest for tcpbpf

2018-01-04 Thread Lawrence Brakmo
Added a selftest for tcpbpf (sock_ops) that checks that the appropriate callbacks occured and that it can access tcp_sock fields and that their values are correct. Run with command: ./test_tcpbpf_user Signed-off-by: Lawrence Brakmo --- tools/include/uapi/linux/bpf.h | 70

[PATCH bpf-next v4 10/11] bpf: Add BPF_SOCK_OPS_STATE_CB

2018-01-04 Thread Lawrence Brakmo
BPF values differ so we can make the necessary fixes. New op: BPF_SOCK_OPS_STATE_CB. Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 26 ++ include/uapi/linux/tcp.h | 1 + net/ipv4/tcp.c | 24 3 files changed, 51

[PATCH bpf-next v4 02/11] bpf: Make SOCK_OPS_GET_TCP struct independent

2018-01-04 Thread Lawrence Brakmo
Return a fixed value (e.x. 0 or 0x), or 2) Make the verifier fail if that field is accessed (i.e. program fails to load) so the user will know that field is no longer supported. Signed-off-by: Lawrence Brakmo --- net/core/filter.c | 20 ++-- 1 file changed,

[PATCH bpf-next v4 09/11] bpf: Add BPF_SOCK_OPS_RETRANS_CB

2018-01-04 Thread Lawrence Brakmo
Adds support for calling sock_ops BPF program when there is a retransmission. Two arguments are used; one for the sequence number and other for the number of segments retransmitted. Does not include syn-ack retransmissions. New op: BPF_SOCK_OPS_RETRANS_CB. Signed-off-by: Lawrence Brakmo

[PATCH bpf-next v4 06/11] bpf: Add sock_ops RTO callback

2018-01-04 Thread Lawrence Brakmo
Adds an optional call to sock_ops BPF program based on whether the BPF_SOCK_OPS_RTO_CB_FLAG is set in bpf_sock_ops_flags. The BPF program is passed 2 arguments: icsk_retransmits and whether the RTO has expired. Signed-off-by: Lawrence Brakmo --- include/uapi/linux/bpf.h | 5 + include/uapi

[PATCH bpf-next v4 01/11] bpf: Make SOCK_OPS_GET_TCP size independent

2018-01-04 Thread Lawrence Brakmo
Make SOCK_OPS_GET_TCP helper macro size independent (before only worked with 4-byte fields. Signed-off-by: Lawrence Brakmo --- net/core/filter.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/net/core/filter.c b/net/core/filter.c index 130b842..099ff9fd 100644

[PATCH bpf-next v4 00/11] bpf: More sock_ops callbacks

2018-01-04 Thread Lawrence Brakmo
: Cleaned RTO callback as per Yuchung's comment Added BPF enum for TCP states as per Alexei's comment v4: Fixed compile warnings related to detecting changes between TCP internal states and the BPF defined states. Signed-off-by: Lawrence Brakmo Consists of the following pat

  1   2   3   4   5   >