do an initial allocation of estimated size (aligned to 2K). The pool
will grow later if space are not enough.
- There is no support on returning memory back to the pool.
Signed-off-by: Jiong Wang
Signed-off-by: John Fastabend
---
kernel/bpf/cfg.c |
From: Jiong Wang
This patch centre find_subprog and add_subprog to cfg.c.
Signed-off-by: Jiong Wang
Signed-off-by: John Fastabend
---
kernel/bpf/cfg.c | 41 +
kernel/bpf/cfg.h |2 ++
kernel/bpf/verifier.c | 42
readability.
>From benchmarks like test_xdp_noinline, this patch reduce peek memory usage
of new cfg infrastructure by more than 50%.
Signed-off-by: Jiong Wang
Signed-off-by: John Fastabend
---
include/linux/bpf_verifier.h |7 -
kernel/bpf/cf
From: Jiong Wang
As we have detected loop and unreachable insns based on domination
information and call graph, there is no need of check_cfg.
This patch removes check_cfg and it's associated push_insn.
state prune heuristic marking as moved to check_subprog.
Signed-off-by: Jiong Wang
---
ke
From: Jiong Wang
Do unreachable basic blocks detection as a side-product of the dfs walk
when building domination information.
Signed-off-by: Jiong Wang
Signed-off-by: John Fastabend
---
kernel/bpf/cfg.c | 19 ++-
kernel/bpf/cfg.h |3 ++-
kernel/bpf/verifier.c
From: Jiong Wang
If one bb is dominating its predecessor, then there is loop.
Signed-off-by: Jiong Wang
Signed-off-by: John Fastabend
---
kernel/bpf/cfg.c | 22 ++
kernel/bpf/cfg.h |1 +
kernel/bpf/verifier.c |8
3 files changed, 31 insertions
From: Jiong Wang
This patch add edges between basic blocks. Both edges for predecessors and
successors are added.
Signed-off-by: Jiong Wang
Signed-off-by: John Fastabend
---
kernel/bpf/cfg.c | 129 -
kernel/bpf/cfg.h |1
kernel
-domination information is built but not tested.
Signed-off-by: Jiong Wang
Signed-off-by: John Fastabend
---
include/linux/bpf_verifier.h |3
kernel/bpf/cfg.c | 386 ++
kernel/bpf/cfg.h |3
kernel/bpf/verifier.c|5
ll graph and detect unreachable/recursive call
bpf: cfg: remove push_insn and check_cfg
bpf: cfg: reduce k*alloc/free call by using memory pool for allocating
nodes
bpf: cfg: reduce memory usage by using singly list + compat pointer
bpf: cfg: detect irreducible loop using Eric S
.
- Insn immediately follows branch insn start a BB.
Insn immediately follows exit and within subprog start a BB.
BBs for each subprog are organized as a list in ascending head.
Two special BBs, entry and exit are added as well.
Signed-off-by: Jiong Wang
Signed-off-by: John Fastabend
--
support")
Reported-by: syzbot+5c063698bdbfac19f...@syzkaller.appspotmail.com
Signed-off-by: John Fastabend
Signed-off-by: Wei Wang
---
kernel/bpf/sockmap.c | 15 ++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c
index 95a
On 05/31/2018 06:00 PM, Eric Dumazet wrote:
> On Thu, May 31, 2018 at 7:32 PM John Fastabend
> wrote:
>>
>>
>> Hi Wei,
>>
>> Thanks for the report and fix. It would be better to fix the
>> root cause so that IPv6 works as intended.
>>
>
00401950 R14: R15:
>
> Fixes: 81110384441a ("bpf: sockmap, add hash map support")
> Reported-by: syzbot+5c063698bdbfac19f...@syzkaller.appspotmail.com
> Signed-off-by: Wei Wang
> Acked-by: Eric Dumazet
> Acked-by: Willem de Bruijn
> ---
Hi Wei,
T
On 05/30/2018 12:29 PM, Alexei Starovoitov wrote:
> On Wed, May 30, 2018 at 02:56:09PM +0900, Prashant Bhole wrote:
>> In order to reduce runtime of tests, recently timout for select() call
>> was reduced from 1sec to 10usec. This was causing many tests failures.
>> It was caught with failure handl
On 05/29/2018 10:56 PM, Prashant Bhole wrote:
> This series fixes error handling, timeout and data verification in
> test_sockmap. Previously it was not able to detect failure/timeout in
> RX/TX thread because error was not notified to the main thread.
>
> Also slightly improved test output by pri
unning test_sockmap script that I run as part of Cilium[1] project
where I put longer running stress tests.
Acked-by: John Fastabend
[1] cilium.io
> 1 file changed, 19 insertions(+), 6 deletions(-)
>
Looks good. Thanks.
Acked-by: John Fastabend
On 05/29/2018 05:44 PM, Prashant Bhole wrote:
>
>
> On 5/30/2018 12:48 AM, John Fastabend wrote:
>> On 05/27/2018 09:37 PM, Prashant Bhole wrote:
>>> This series fixes error handling, timeout and data verification in
>>> test_sockmap. Previously it was not
On 05/27/2018 09:37 PM, Prashant Bhole wrote:
> This series fixes error handling, timeout and data verification in
> test_sockmap. Previously it was not able to detect failure/timeout in
> RX/TX thread because error was not notified to the main thread.
>
> Also slightly improved test output by pri
he exit code of RX/TX threads
>
> Fixes: 16962b2404ac ("bpf: sockmap, add selftests")
> Signed-off-by: Prashant Bhole
> ---
Acked-by: John Fastabend
> tools/testing/selftests/bpf/test_sockmap.c | 25 --
> 1 file changed, 19 insertions(+), 6 d
On 05/27/2018 03:36 PM, Daniel Borkmann wrote:
> On 05/25/2018 07:37 PM, John Fastabend wrote:
>> syzbot reported two related splats, a use after free and null
>> pointer dereference, when a TCP socket is closed while the map is
>> also being removed.
>>
>> The p
On 05/26/2018 01:30 AM, Daniel Borkmann wrote:
> Hi John,
>
> On 05/25/2018 07:37 PM, John Fastabend wrote:
>> syzbot reported two related splats, a use after free and null
>> pointer dereference, when a TCP socket is closed while the map is
>> also being remov
rozen_or_stopped(txq))
>> return false;
>>
>> and further simplifies the code as:
>>
>> return !netif_xmit_frozen_or_stopped(txq);
>>
>> Fixes: 29b86cdac00a ("net: sched: remove remaining uses for qdisc_qlen in
>> xmit path")
>> C
being free'd.
Reported-by: syzbot+a761b81c211794fa1...@syzkaller.appspotmail.com
Signed-off-by: John Fastabend
---
kernel/bpf/sockmap.c | 33 +
1 file changed, 21 insertions(+), 12 deletions(-)
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c
On 05/25/2018 01:28 AM, Prashant Bhole wrote:
>
>
> On 5/24/2018 1:58 PM, John Fastabend wrote:
>> On 05/23/2018 09:47 PM, Prashant Bhole wrote:
>>>
>>>
>>> On 5/23/2018 6:44 PM, Prashant Bhole wrote:
>>>>
>>>>
>>>
On 05/23/2018 09:47 PM, Prashant Bhole wrote:
>
>
> On 5/23/2018 6:44 PM, Prashant Bhole wrote:
>>
>>
>> On 5/22/2018 2:08 AM, John Fastabend wrote:
>>> On 05/20/2018 10:13 PM, Prashant Bhole wrote:
>>>>
>>>>
>>>> On 5/19/20
On 05/23/2018 08:37 AM, Huy Nguyen wrote:
>
>
> On 5/23/2018 8:52 AM, John Fastabend wrote:
>> It would be nice though if the API gave us some hint on max/min/stride
>> of allowed values. Could the get API return these along with current
>> value? Presumably the al
On 05/18/2018 06:35 AM, Jesper Dangaard Brouer wrote:
> This patch change the API for ndo_xdp_xmit to support bulking
> xdp_frames.
>
> When kernel is compiled with CONFIG_RETPOLINE, XDP sees a huge slowdown.
> Most of the slowdown is caused by DMA API indirect function calls, but
> also the net_d
On 05/18/2018 06:34 AM, Jesper Dangaard Brouer wrote:
> Notice how this allow us get XDP statistic without affecting the XDP
> performance, as tracepoint is no-longer activated on a per packet basis.
>
> Signed-off-by: Jesper Dangaard Brouer
> ---
[...]
> #include
> diff --git a/kernel/bpf/d
On 05/23/2018 02:43 AM, Jiri Pirko wrote:
> Tue, May 22, 2018 at 07:20:26AM CEST, jakub.kicin...@netronome.com wrote:
>> On Mon, 21 May 2018 14:04:57 -0700, Saeed Mahameed wrote:
>>> From: Huy Nguyen
>>>
>>> In this patch, we add dcbnl buffer attribute to allow user
>>> change the NIC's buffer con
On 05/20/2018 10:15 PM, Prashant Bhole wrote:
>
>
> On 5/19/2018 1:47 AM, John Fastabend wrote:
>> On 05/18/2018 12:17 AM, Prashant Bhole wrote:
>>> In order to reduce runtime of tests, recently timout for select() call
>>> was reduced from 1sec to 10usec. Thi
On 05/20/2018 10:15 PM, Prashant Bhole wrote:
>
>
> On 5/19/2018 1:45 AM, John Fastabend wrote:
>> On 05/18/2018 12:17 AM, Prashant Bhole wrote:
>>> In case of selftest mode, temporary cgroup environment is created but
>>> cgroup is not joined. It causes te
On 05/20/2018 10:13 PM, Prashant Bhole wrote:
>
>
> On 5/19/2018 1:42 AM, John Fastabend wrote:
>> On 05/18/2018 12:17 AM, Prashant Bhole wrote:
>>> This series fixes bugs in test_sockmap code. They weren't caught
>>> previously because failure in RX/TX t
reached
> - Fixed the value printed in case of verification failure
>
> Fixes: 16962b2404ac ("bpf: sockmap, add selftests")
> Signed-off-by: Prashant Bhole
> ---
Thanks!
Acked-by: John Fastabend
On 05/18/2018 12:17 AM, Prashant Bhole wrote:
> Print values of test options like apply, cork, start, end so that
> individual failed tests can be identified for manual run
>
> Signed-off-by: Prashant Bhole
> ---
Nice improvement.
Acked-by: John Fastabend
On 05/18/2018 12:17 AM, Prashant Bhole wrote:
> In order to reduce runtime of tests, recently timout for select() call
> was reduced from 1sec to 10usec. This was causing many tests failures.
> It was caught with failure handling commits in this series.
>
> Restoring the timeout from 10usec to 1se
igned-off-by: Prashant Bhole
> --
Thanks, LGTM. Should this be the first patch in the series though?
I wonder if after patch 1 if you would get failures without this
patch.
Acked-by: John Fastabend
On 05/18/2018 12:17 AM, Prashant Bhole wrote:
> This series fixes bugs in test_sockmap code. They weren't caught
> previously because failure in RX/TX thread was not notified to the
> main thread.
>
> Also fixed data verification logic and slightly improved test output
> such that parameters value
Add tests for BPF_PROG_TYPE_SK_MSG to test_verifier for read access
to new sk fields.
Signed-off-by: John Fastabend
Acked-by: Martin KaFai Lau
---
tools/include/uapi/linux/bpf.h |8 ++
tools/testing/selftests/bpf/test_verifier.c | 115 +++
2 files
Currently sk_msg programs only have access to the raw data. However,
it is often useful when building policies to have the policies specific
to the socket endpoint. This allows using the socket tuple as input
into filters, etc.
This patch adds ctx access to the sock fields.
Signed-off-by: John
er to read IMO. We can probably revisit the idea later
if we get more duplication.
v2: add errstr field to negative test_verifier test cases to ensure
we get the expected err string back from the verifier.
---
John Fastabend (2):
bpf: allow sk_msg programs to read sock fields
bpf
ned-off-by: John Fastabend
Acked-by: Martin KaFai Lau
---
kernel/bpf/sockmap.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c
index 098eca5..f03aaa8 100644
--- a/kernel/bpf/sockmap.c
+++ b/kernel/bpf/sockmap.c
@@ -1717,1
857d04601a ("bpf: sockmap, remove STRPARSER map_flags and add
multi-map support")
Reported-by: Daniel Borkmann
Signed-off-by: John Fastabend
Acked-by: Martin KaFai Lau
---
kernel/bpf/sockmap.c |6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/kernel/bpf/soc
On 05/17/2018 01:31 PM, Daniel Borkmann wrote:
> On 05/16/2018 11:46 PM, John Fastabend wrote:
>> In the sockmap design BPF programs (SK_SKB_STREAM_PARSER and
>> SK_SKB_STREAM_VERDICT) are attached to the sockmap map type and when
>> a sock is added to the map the programs a
On 05/17/2018 11:17 AM, Martin KaFai Lau wrote:
> On Thu, May 17, 2018 at 08:54:04AM -0700, John Fastabend wrote:
>> Currently sk_msg programs only have access to the raw data. However,
>> it is often useful when building policies to have the policies specific
>> to the
On 05/17/2018 11:57 AM, Martin KaFai Lau wrote:
> On Thu, May 17, 2018 at 08:54:10AM -0700, John Fastabend wrote:
>> Add tests for BPF_PROG_TYPE_SK_MSG to test_verifier for read access
>> to new sk fields.
>>
>> Signed-off-by: John Fastabend
>> ---
[...]
>&g
path to hit this case
is to add a sock to a map (without a BPF program) where the sock already
has been added to another map. I don't have any tests for the case with
socks in multiple maps so I'll add some to the selftests so I remember
this case.
The alternative fix would be to always &
pen when a user tries to add a kTLS socket to a
sockmap. We need to add some tests for kTLS + sockmap cases.
Acked-by: John Fastabend
Add tests for BPF_PROG_TYPE_SK_MSG to test_verifier for read access
to new sk fields.
Signed-off-by: John Fastabend
---
tools/include/uapi/linux/bpf.h |8 ++
tools/testing/selftests/bpf/test_verifier.c | 115 +++
2 files changed, 123 insertions(+)
diff
er to read IMO. We can probably revisit the idea later
if we get more duplication.
---
John Fastabend (2):
bpf: allow sk_msg programs to read sock fields
bpf: add sk_msg prog sk access tests to test_verifier
include/linux/filter.h |1
include/uapi/linux/
Currently sk_msg programs only have access to the raw data. However,
it is often useful when building policies to have the policies specific
to the socket endpoint. This allows using the socket tuple as input
into filters, etc.
This patch adds ctx access to the sock fields.
Signed-off-by: John
When an error happens in the update sockmap element logic also pass
the err up to the user.
Fixes: e5cd3abcb31a ("bpf: sockmap, refactor sockmap routines to work with
hashmap")
Signed-off-by: John Fastabend
---
kernel/bpf/sockmap.c |2 +-
1 file changed, 1 insertion(+), 1 deletio
ned-off-by: John Fastabend
---
kernel/bpf/sockmap.c | 12 ++--
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c
index 098eca5..f03aaa8 100644
--- a/kernel/bpf/sockmap.c
+++ b/kernel/bpf/sockmap.c
@@ -1717,10 +1717,10 @@
ockmap, remove STRPARSER map_flags and add
multi-map support")
Reported-by: Daniel Borkmann
Signed-off-by: John Fastabend
---
kernel/bpf/sockmap.c |4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c
index f03aaa8..583c
On 05/15/2018 12:19 PM, Daniel Borkmann wrote:
> On 05/14/2018 07:00 PM, John Fastabend wrote:
> [...]
[...]
>
> As you say in the comment above the function wrt locking notes that the
> __sock_map_ctx_update_elem() can be called concurrently.
>
> All operations oper
stack, so they cannot be
> + * larger than max stack size
> + */
> + return ERR_PTR(-E2BIG);
> +
> err = bpf_tcp_ulp_register();
> if (err && err != -EEXIST)
> return ERR_PTR(err);
>
Thanks!
Acked-by: John Fastabend
This adds the SOCKHASH map type to bpftools so that we get correct
pretty printing.
Signed-off-by: John Fastabend
Acked-by: David S. Miller
---
tools/bpf/bpftool/map.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
index af6766e..097b1a5
This runs existing SOCKMAP tests with SOCKHASH map type. To do this
we push programs into include file and build two BPF programs. One
for SOCKHASH and one for SOCKMAP.
We then run the entire test suite with each type.
Signed-off-by: John Fastabend
Acked-by: David S. Miller
---
tools/include
-M option
no longer tracks the rename of the test_sockmap_kern files for
some reason. I guess the diff has exceeded some threshold.
Just a note I pushed Dave's Acks through v4 into v5 due to small
size of changes.
John Fastabend (4):
bpf: sockmap, refactor sockmap routines to work wit
. This avoids storing the key in the metadata
which will be useful when keys can be longer than 4 bytes. We
rename the sk pointers to sk_redir at this point as well to
avoid any confusion between the current sk pointer and the
redirect pointer sk_redir.
Signed-off-by: John Fastabend
may want to use the 5-tuple
of the socket as the lookup key.
To support this add hash support.
Signed-off-by: John Fastabend
Acked-by: David S. Miller
---
include/linux/bpf.h | 8 +
include/linux/bpf_types.h | 1 +
include/uapi/linux/bpf.h | 52 -
kernel/bpf/core.c | 1
On 05/07/2018 03:22 AM, Jiong Wang wrote:
> If one bb is dominating its predecessor, then there is loop.
>
> Signed-off-by: Jiong Wang
> ---
> kernel/bpf/cfg.c | 22 ++
> kernel/bpf/cfg.h | 1 +
> kernel/bpf/verifier.c | 8
> 3 files changed, 31 insertion
. This avoids storing the key in the metadata
which will be useful when keys can be longer than 4 bytes. We
rename the sk pointers to sk_redir at this point as well to
avoid any confusion between the current sk pointer and the
redirect pointer sk_redir.
Signed-off-by: John Fastabend
This runs existing SOCKMAP tests with SOCKHASH map type. To do this
we push programs into include file and build two BPF programs. One
for SOCKHASH and one for SOCKMAP.
We then run the entire test suite with each type.
Signed-off-by: John Fastabend
Acked-by: David S. Miller
---
tools/include
may want to use the 5-tuple
of the socket as the lookup key.
To support this add hash support.
Signed-off-by: John Fastabend
Acked-by: David S. Miller
---
include/linux/bpf.h | 8 +
include/linux/bpf_types.h | 1 +
include/uapi/linux/bpf.h | 52 -
kernel/bpf/core.c | 1
This adds the SOCKHASH map type to bpftools so that we get correct
pretty printing.
Signed-off-by: John Fastabend
Acked-by: David S. Miller
---
tools/bpf/bpftool/map.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
index af6766e..097b1a5
provide only diffs +/- on that.
v4: Add documentation to UAPI bpf.h
v5: Add documentation to tools UAPI bpf.h
Just a note I pushed Dave's Acks through v4 into v5 due to small
size of change.
John Fastabend (4):
bpf: sockmap, refactor sockmap routines to work with hashmap
bpf: sockmap, add has
This adds the SOCKHASH map type to bpftools so that we get correct
pretty printing.
Signed-off-by: John Fastabend
---
tools/bpf/bpftool/map.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
index a6cdb64..4420b1a 100644
--- a/tools/bpf
This runs existing SOCKMAP tests with SOCKHASH map type. To do this
we push programs into include file and build two BPF programs. One
for SOCKHASH and one for SOCKMAP.
We then run the entire test suite with each type.
Signed-off-by: John Fastabend
---
tools/include/uapi/linux/bpf.h
may want to use the 5-tuple
of the socket as the lookup key.
To support this add hash support.
Signed-off-by: John Fastabend
---
include/linux/bpf.h | 8 +
include/linux/bpf_types.h | 1 +
include/uapi/linux/bpf.h | 53 -
kernel/bpf/core.c | 1 +
kernel/bpf/sockmap.c
provide only diffs +/- on that.
v4: Add documentation to UAPI bpf.h
John Fastabend (4):
bpf: sockmap, refactor sockmap routines to work with hashmap
bpf: sockmap, add hash map support
bpf: bpftool, support for sockhash
bpf: selftest additions for SOCKHASH
include/linux/bpf.h
. This avoids storing the key in the metadata
which will be useful when keys can be longer than 4 bytes. We
rename the sk pointers to sk_redir at this point as well to
avoid any confusion between the current sk pointer and the
redirect pointer sk_redir.
Signed-off-by: John Fastabend
memory.
The fix for this is simply to update the start index. To avoid
fixing this error in two locations we do a small refactor and
remove one case where it is open-coded. Then fix it in the
single function.
Signed-off-by: John Fastabend
---
kernel/bpf/sockmap.c | 28
. This is in the error path as well so in my
opinion lets have robust code over optimized error paths.
Signed-off-by: John Fastabend
---
kernel/bpf/sockmap.c | 15 +++
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c
index
these seem to be in working correctly.
v2: fix compiler warning, drop iterator variable 'i' that is no longer
used in patch 3.
---
John Fastabend (3):
bpf: sockmap, fix scatterlist update on error path in send with apply
bpf: sockmap, zero sg_size on error when buffer i
absolute scatterlist values rather than trying
to accumulate the totals and subtract at the end.
Reported-by: Alexei Starovoitov
Signed-off-by: John Fastabend
---
kernel/bpf/sockmap.c |5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf
memory.
The fix for this is simply to update the start index. To avoid
fixing this error in two locations we do a small refactor and
remove one case where it is open-coded. Then fix it in the
single function.
Signed-off-by: John Fastabend
---
kernel/bpf/sockmap.c | 26
. This is in the error path as well so in my
opinion lets have robust code over optimized error paths.
Signed-off-by: John Fastabend
---
kernel/bpf/sockmap.c | 15 +++
1 file changed, 11 insertions(+), 4 deletions(-)
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf/sockmap.c
index
these seem to be in working correctly.
---
John Fastabend (3):
bpf: sockmap, fix scatterlist update on error path in send with apply
bpf: sockmap, zero sg_size on error when buffer is released
bpf: sockmap, fix error handling in redirect failures
kernel/bpf/sockmap.c | 46
absolute scatterlist values rather than trying
to accumulate the totals and subtract at the end.
Reported-by: Alexei Starovoitov
Signed-off-by: John Fastabend
---
kernel/bpf/sockmap.c |5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/bpf/sockmap.c b/kernel/bpf
On 05/02/2018 09:59 AM, Jiong Wang wrote:
> On 01/05/2018 23:22, Alexei Starovoitov wrote:
> ...
>> [ 27.784931] ? bpf_int_jit_compile+0x7ac/0xab0
>> [ 27.785475] bpf_int_jit_compile+0x2b6/0xab0
>> [ 27.786001] ? do_jit+0x6020/0x6020
>> [ 27.786428] ? kasan_kmalloc+0xa0/0xd0
>> [ 27.7
On 04/29/2018 09:16 AM, Alexei Starovoitov wrote:
> On Sat, Apr 28, 2018 at 08:41:28PM -0700, John Fastabend wrote:
>> Sockmap is currently backed by an array and enforces keys to be
>> four bytes. This works well for many use cases and was originally
>> modeled after devmap
On 04/27/2018 05:10 PM, Alexei Starovoitov wrote:
> On Fri, Apr 27, 2018 at 04:24:43PM -0700, John Fastabend wrote:
>> This runs existing SOCKMAP tests with SOCKHASH map type. To do this
>> we push programs into include file and build two BPF programs. One
>> for SOCKHAS
This runs existing SOCKMAP tests with SOCKHASH map type. To do this
we push programs into include file and build two BPF programs. One
for SOCKHASH and one for SOCKMAP.
We then run the entire test suite with each type.
Signed-off-by: John Fastabend
---
tools/include/uapi/linux/bpf.h
This adds the SOCKHASH map type to bpftools so that we get correct
pretty printing.
Signed-off-by: John Fastabend
---
tools/bpf/bpftool/map.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c
index a6cdb64..4420b1a 100644
--- a/tools/bpf
may want to use the 5-tuple
of the socket as the lookup key.
To support this add hash support.
Signed-off-by: John Fastabend
---
include/linux/bpf.h | 8 +
include/linux/bpf_types.h | 1 +
include/uapi/linux/bpf.h | 6 +-
kernel/bpf/core.c | 1 +
kernel/bpf/sockmap.c
provide only diffs +/- on that.
John Fastabend (4):
bpf: sockmap, refactor sockmap routines to work with hashmap
bpf: sockmap, add hash map support
bpf: bpftool, support for sockhash
bpf: selftest additions for SOCKHASH
include/linux/bpf.h| 8 +
include/linux
. This avoids storing the key in the metadata
which will be useful when keys can be longer than 4 bytes. We
rename the sk pointers to sk_redir at this point as well to
avoid any confusion between the current sk pointer and the
redirect pointer sk_redir.
Signed-off-by: John Fastabend
may want to use the 5-tuple
of the socket as the lookup key.
To support this add hash support.
Signed-off-by: John Fastabend
---
include/linux/bpf.h|8 +
include/linux/bpf_types.h |1
include/uapi/linux/bpf.h |6
kernel/bpf/core.c |1
kernel
. This avoids storing the key in the metadata
which will be useful when keys can be longer than 4 bytes. We
rename the sk pointers to sk_redir at this point as well to
avoid any confusion between the current sk pointer and the
redirect pointer sk_redir.
Signed-off-by: John Fastabend
This runs existing SOCKMAP tests with SOCKHASH map type. To do this
we push programs into include file and build two BPF programs. One
for SOCKHASH and one for SOCKMAP.
We then run the entire test suite with each type.
Signed-off-by: John Fastabend
---
tools/testing/selftests/bpf/Makefile
something else tricky.
To test this we duplicate all the sockmap testing except swap out
the sockmap with a sockhash.
v2: fix file stats and add v2 tag
---
John Fastabend (3):
bpf: sockmap, refactor sockmap routines to work with hashmap
bpf: sockmap, add hash map support
bpf: selftest
type which reuses almost
all the sockmap code except it needed a few special add/remove
handlers.
To test this we duplicate all the sockmap testing except swap out
the sockmap with a sockhash.
---
John Fastabend (3):
bpf: sockmap, refactor sockmap routines to work with hashmap
bpf
On 04/27/2018 03:54 PM, Alexei Starovoitov wrote:
> On Fri, Apr 27, 2018 at 10:51 PM, John Fastabend
> wrote:
>> In the original sockmap implementation we got away with using an
>> array similar to devmap. However, unlike devmap where an ifindex
>> has a nice 1:1 funct
type which reuses almost
all the sockmap code except it needed a few special add/remove
handlers.
To test this we duplicate all the sockmap testing except swap out
the sockmap with a sockhash.
---
John Fastabend (3):
bpf: sockmap, refactor sockmap routines to work with hashmap
bpf
This runs existing SOCKMAP tests with SOCKHASH map type. To do this
we push programs into include file and build two BPF programs. One
for SOCKHASH and one for SOCKMAP.
We then run the entire test suite with each type.
Signed-off-by: John Fastabend
---
tools/testing/selftests/bpf/Makefile
may want to use the 5-tuple
of the socket as the lookup key.
To support this add hash support.
Signed-off-by: John Fastabend
---
tools/bpf/bpftool/map.c|1 +
tools/include/uapi/linux/bpf.h |6 +-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/include/linux/bpf.h
. This avoids storing the key in the metadata
which will be useful when keys can be longer than 4 bytes. We
rename the sk pointers to sk_redir at this point as well to
avoid any confusion between the current sk pointer and the
redirect pointer sk_redir.
Signed-off-by: John Fastabend
ed]
} else if (matches(subcmd, "pcap") == 0) {
Fixes: fd981e3c321a "filter: bpf_dbg: add minimal bpf debugger"
Signed-off-by: John Fastabend
---
tools/bpf/bpf_dbg.c |7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/tools/bpf/bpf_dbg.c b/tools/bpf/bpf_
le to make target `bpf_exp.yacc.o', needed by `bpf_asm'. Stop.
Fixes: 5a8997f20715 ("tools: bpf: respect output directory during build")
Signed-off-by: John Fastabend
---
tools/bpf/Makefile |2 ++
1 file changed, 2 insertions(+)
diff --git a/tools/bpf/Makefile b/tools/bpf/M
801 - 900 of 2039 matches
Mail list logo