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!
> 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,
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
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
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 ?
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
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
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
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
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
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
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
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
> 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 -
>
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)
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
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
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?
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
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
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
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
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
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
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
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
> >
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
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
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
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
>
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 @@
Removed commented lines from test_tcpbpf_kern.c
Fixes: d6d4f60c3a09 bpf: add selftest for tcpbpf
Signed-off-by: Lawrence Brakmo
---
tools/testing/selftests/bpf/test_tcpbpf_kern.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/tools/testing/selftests/bpf/test_tcpbpf_kern.c
b/tools
Adds direct write 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 Brakmo
---
This patchset adds support for:
- direct R or R/W access to many tcp_sock fields
- passing up to 4 arguments to sock_ops BPF functions
- tcp_sock field bpf_sock_ops_cb_flags for controlling callbacks
- optionally calling sock_ops BPF program when RTO fires
- optionally calling sock_ops BPF program
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
Acked-by: Alexei Starovoitov
---
include/linux/filter.h | 9 +
include/net/tcp.h | 2 +-
net/core/filter.c
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 bf9bb75..62e7874 100644
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,
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 | 29 -
net/ipv4/tcp.c | 24
2 files changed, 52 insertions(+), 1 deletion(-)
diff
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| 40
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
Adding the flag "-d" will show why it did not pass.
Signed-off-by: Lawrence Brakmo
als replylong[0]) is writeable.
Fixes: 40304b2a1567 ("bpf: BPF support for sock_ops")
Signed-off-by: Lawrence Brakmo
Acked-by: Yuchung Cheng
---
net/core/filter.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 18da42a..b
ons.
New op: BPF_SOCK_OPS_RETRANS_CB.
Signed-off-by: Lawrence Brakmo
---
include/uapi/linux/bpf.h | 9 -
net/ipv4/tcp_output.c| 4
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 46520ea..31c93a0b 100644
--
socket.
Examples of where one could call the bpf program:
1) When RTO fires
2) When a packet is retransmitted
3) When the connection terminates
4) When a packet is sent
5) When a packet is received
Signed-off-by: Lawrence Brakmo
Acked-by: Alexei Starovoitov
---
include/linux/tcp.h | 11
etrans
segs_in
data_segs_in
segs_out
data_segs_out
lost_out
sacked_out
sk_txhash
bytes_received (__u64)
bytes_acked(__u64)
Signed-off-by: Lawrence Brakmo
---
include/uapi/linux/bpf.h | 22
net/core/filter.c| 143 +++-
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 | 8 +++-
net/ipv4
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 | 3 ++-
net/ipv4/tcp.c | 24
3 files changed, 52
als replylong[0]) is writeable.
Fixes: 40304b2a1567 ("bpf: BPF support for sock_ops")
Signed-off-by: Lawrence Brakmo
Acked-by: Yuchung Cheng
---
net/core/filter.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 18da42a..b
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
socket.
Examples of where one could call the bpf program:
1) When RTO fires
2) When a packet is retransmitted
3) When the connection terminates
4) When a packet is sent
5) When a packet is received
Signed-off-by: Lawrence Brakmo
Acked-by: Alexei Starovoitov
---
include/linux/tcp.h | 11
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
Acked-by: Alexei Starovoitov
---
include/linux/filter.h | 9 +
include/net/tcp.h | 2 +-
net/core/filter.c
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,
etrans
segs_in
data_segs_in
segs_out
data_segs_out
lost_out
sacked_out
sk_txhash
bytes_received (__u64)
bytes_acked(__u64)
Signed-off-by: Lawrence Brakmo
---
include/uapi/linux/bpf.h | 22
net/core/filter.c| 143 +++-
This patchset adds support for:
- direct R or R/W access to many tcp_sock fields
- passing up to 4 arguments to sock_ops BPF functions
- tcp_sock field bpf_sock_ops_cb_flags for controlling callbacks
- optionally calling sock_ops BPF program when RTO fires
- optionally calling sock_ops BPF program
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| 40
ons.
New op: BPF_SOCK_OPS_RETRANS_CB.
Signed-off-by: Lawrence Brakmo
---
include/uapi/linux/bpf.h | 6 ++
include/uapi/linux/tcp.h | 3 ++-
net/ipv4/tcp_output.c| 4
3 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
in
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
Acked-by: Alexei Starovoitov
---
tools/include/uapi/linux
Adds direct write 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 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 bf9bb75..62e7874 100644
On 1/24/18, 12:07 PM, "netdev-ow...@vger.kernel.org on behalf of Yuchung Cheng"
wrote:
On Tue, Jan 23, 2018 at 11:57 PM, Lawrence Brakmo wrote:
> Add support for reading many more tcp_sock fields
>
> state,same as sk->sk_state
>
On 1/24/18, 12:02 PM, "netdev-ow...@vger.kernel.org on behalf of Yuchung Cheng"
wrote:
On Tue, Jan 23, 2018 at 11:58 PM, Lawrence Brakmo wrote:
> Adds support for calling sock_ops BPF program when there is a
> retransmission. Two arguments are used; one for the seq
socket.
Examples of where one could call the bpf program:
1) When RTO fires
2) When a packet is retransmitted
3) When the connection terminates
4) When a packet is sent
5) When a packet is received
Signed-off-by: Lawrence Brakmo
Acked-by: Alexei Starovoitov
---
include/linux/tcp.h | 11
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 18da42a..31c10a4 100644
als replylong[0]) is writeable.
Fixes: 40304b2a1567 ("bpf: BPF support for sock_ops")
Signed-off-by: Lawrence Brakmo
---
net/core/filter.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 0cf170f..c356ec0 100644
--- a/net/
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
Acked-by: Alexei Starovoitov
---
include/linux/filter.h | 9 +
include/net/tcp.h | 2 +-
net/core/filter.c
etrans
segs_in
data_segs_in
segs_out
data_segs_out
sk_txhash
bytes_received (__u64)
bytes_acked(__u64)
Signed-off-by: Lawrence Brakmo
---
include/uapi/linux/bpf.h | 20 +++
net/core/filter.c| 135 +++
2 files change
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
Acked-by: Alexei Starovoitov
---
tools/include/uapi/linux
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 | 3 ++-
net/ipv4/tcp.c | 24
3 files changed, 52
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
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| 40
Adds direct write 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 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
all_bpf_4arg) based
on comments from Daniel Borkmann.
v8: Add commit message 00/12
Add Acked-by as appropriate
Signed-off-by: Lawrence Brakmo
Consists of the following patches:
[PATCH bpf-next v8 01/12] bpf: Make SOCK_OPS_GET_TCP size independent
[PATCH bpf-next v8 02/12] bpf: Make SOCK_O
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,
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 | 74
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
Adds direct write 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 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,
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 | 9 +
include/net/tcp.h | 2 +-
net/core/filter.c | 48
3 files c
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 18da42a..31c10a4 100644
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
etrans
segs_in
data_segs_in
segs_out
data_segs_out
sk_txhash
bytes_received (__u64)
bytes_acked(__u64)
Signed-off-by: Lawrence Brakmo
---
include/uapi/linux/bpf.h | 20 +++
net/core/filter.c| 135 +++
2 files change
socket.
Examples of where one could call the bpf program:
1) When RTO fires
2) When a packet is retransmitted
3) When the connection terminates
4) When a packet is sent
5) When a packet is received
Signed-off-by: Lawrence Brakmo
---
include/linux/tcp.h | 11 +++
include/uapi/linux
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 | 3 ++-
net/ipv4/tcp.c | 24
3 files changed, 52
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| 40
als replylong[0]) is writeable.
Fixes: 40304b2a1567 ("bpf: BPF support for sock_ops")
Signed-off-by: Lawrence Brakmo
---
net/core/filter.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/net/core/filter.c b/net/core/filter.c
index 0cf170f..c356ec0 100644
--- a/net/
1 - 100 of 407 matches
Mail list logo