* [bpf-next PATCH 0/3] Hash support for sock
@ 2018-04-27 23:20 John Fastabend
0 siblings, 0 replies; 4+ messages in thread
From: John Fastabend @ 2018-04-27 23:20 UTC (permalink / raw)
To: ast, daniel; +Cc: netdev
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 function into the map we have found some use cases
with sockets need to be referenced using longer keys.
This series adds support for a sockhash map 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: sockmap, add hash map support
bpf: selftest additions for SOCKHASH
include/linux/bpf.h | 8
include/linux/bpf_types.h | 1
include/linux/filter.h | 3
include/net/tcp.h | 3
include/uapi/linux/bpf.h | 6
kernel/bpf/core.c | 1
kernel/bpf/sockmap.c | 638 +++++++++++++++++++---
kernel/bpf/verifier.c | 14
net/core/filter.c | 89 ++-
tools/bpf/bpftool/map.c | 1
tools/include/uapi/linux/bpf.h | 6
tools/testing/selftests/bpf/Makefile | 3
tools/testing/selftests/bpf/test_sockhash_kern.c | 4
tools/testing/selftests/bpf/test_sockmap.c | 27 +
tools/testing/selftests/bpf/test_sockmap_kern.c | 340 ------------
tools/testing/selftests/bpf/test_sockmap_kern.h | 340 ++++++++++++
16 files changed, 1034 insertions(+), 450 deletions(-)
create mode 100644 tools/testing/selftests/bpf/test_sockhash_kern.c
create mode 100644 tools/testing/selftests/bpf/test_sockmap_kern.h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [bpf-next PATCH 0/3] Hash support for sock
2018-04-27 22:54 ` Alexei Starovoitov
@ 2018-04-27 23:15 ` John Fastabend
0 siblings, 0 replies; 4+ messages in thread
From: John Fastabend @ 2018-04-27 23:15 UTC (permalink / raw)
To: Alexei Starovoitov
Cc: Alexei Starovoitov, Daniel Borkmann, Network Development
On 04/27/2018 03:54 PM, Alexei Starovoitov wrote:
> On Fri, Apr 27, 2018 at 10:51 PM, John Fastabend
> <john.fastabend@gmail.com> 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 function into the map we have found some use cases
>> with sockets need to be referenced using longer keys.
>>
>> This series adds support for a sockhash map 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: sockmap, add hash map support
>> bpf: selftest additions for SOCKHASH
>>
>>
>> tools/bpf/bpftool/map.c | 1
>> tools/include/uapi/linux/bpf.h | 6
>> tools/testing/selftests/bpf/Makefile | 3
>> tools/testing/selftests/bpf/test_sockhash_kern.c | 4
>> tools/testing/selftests/bpf/test_sockmap.c | 27 +-
>> tools/testing/selftests/bpf/test_sockmap_kern.c | 340 ----------------------
>> tools/testing/selftests/bpf/test_sockmap_kern.h | 340 ++++++++++++++++++++++
>> 7 files changed, 374 insertions(+), 347 deletions(-)
>> create mode 100644 tools/testing/selftests/bpf/test_sockhash_kern.c
>> create mode 100644 tools/testing/selftests/bpf/test_sockmap_kern.h
>
> something wrong here.
> patch 1 changes include/linux/filter.h
> but it's not included in the above.
> Please fix and resubmit
>
Strange had to create a new branch to fix it. Anyways thanks
and v2 coming with correct stats.
.John
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [bpf-next PATCH 0/3] Hash support for sock
2018-04-27 22:51 John Fastabend
@ 2018-04-27 22:54 ` Alexei Starovoitov
2018-04-27 23:15 ` John Fastabend
0 siblings, 1 reply; 4+ messages in thread
From: Alexei Starovoitov @ 2018-04-27 22:54 UTC (permalink / raw)
To: John Fastabend; +Cc: Alexei Starovoitov, Daniel Borkmann, Network Development
On Fri, Apr 27, 2018 at 10:51 PM, John Fastabend
<john.fastabend@gmail.com> 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 function into the map we have found some use cases
> with sockets need to be referenced using longer keys.
>
> This series adds support for a sockhash map 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: sockmap, add hash map support
> bpf: selftest additions for SOCKHASH
>
>
> tools/bpf/bpftool/map.c | 1
> tools/include/uapi/linux/bpf.h | 6
> tools/testing/selftests/bpf/Makefile | 3
> tools/testing/selftests/bpf/test_sockhash_kern.c | 4
> tools/testing/selftests/bpf/test_sockmap.c | 27 +-
> tools/testing/selftests/bpf/test_sockmap_kern.c | 340 ----------------------
> tools/testing/selftests/bpf/test_sockmap_kern.h | 340 ++++++++++++++++++++++
> 7 files changed, 374 insertions(+), 347 deletions(-)
> create mode 100644 tools/testing/selftests/bpf/test_sockhash_kern.c
> create mode 100644 tools/testing/selftests/bpf/test_sockmap_kern.h
something wrong here.
patch 1 changes include/linux/filter.h
but it's not included in the above.
Please fix and resubmit
^ permalink raw reply [flat|nested] 4+ messages in thread
* [bpf-next PATCH 0/3] Hash support for sock
@ 2018-04-27 22:51 John Fastabend
2018-04-27 22:54 ` Alexei Starovoitov
0 siblings, 1 reply; 4+ messages in thread
From: John Fastabend @ 2018-04-27 22:51 UTC (permalink / raw)
To: ast, daniel; +Cc: netdev
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 function into the map we have found some use cases
with sockets need to be referenced using longer keys.
This series adds support for a sockhash map 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: sockmap, add hash map support
bpf: selftest additions for SOCKHASH
tools/bpf/bpftool/map.c | 1
tools/include/uapi/linux/bpf.h | 6
tools/testing/selftests/bpf/Makefile | 3
tools/testing/selftests/bpf/test_sockhash_kern.c | 4
tools/testing/selftests/bpf/test_sockmap.c | 27 +-
tools/testing/selftests/bpf/test_sockmap_kern.c | 340 ----------------------
tools/testing/selftests/bpf/test_sockmap_kern.h | 340 ++++++++++++++++++++++
7 files changed, 374 insertions(+), 347 deletions(-)
create mode 100644 tools/testing/selftests/bpf/test_sockhash_kern.c
create mode 100644 tools/testing/selftests/bpf/test_sockmap_kern.h
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-04-27 23:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-27 23:20 [bpf-next PATCH 0/3] Hash support for sock John Fastabend
-- strict thread matches above, loose matches on Subject: below --
2018-04-27 22:51 John Fastabend
2018-04-27 22:54 ` Alexei Starovoitov
2018-04-27 23:15 ` John Fastabend
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.