2018-05-03 11:28:27 UTC-0700 ~ John Fastabend <john.fastab...@gmail.com>
> 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 <john.fastab...@gmail.com>
> ---
>  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 
> ++++++++++++++++------
>  .../{test_sockmap_kern.c => test_sockmap_kern.h}   | 10 ++++----
>  5 files changed, 36 insertions(+), 14 deletions(-)
>  create mode 100644 tools/testing/selftests/bpf/test_sockhash_kern.c
>  rename tools/testing/selftests/bpf/{test_sockmap_kern.c => 
> test_sockmap_kern.h} (97%)
> 
> diff --git a/tools/include/uapi/linux/bpf.h b/tools/include/uapi/linux/bpf.h
> index da77a93..5cb983d 100644
> --- a/tools/include/uapi/linux/bpf.h
> +++ b/tools/include/uapi/linux/bpf.h
> @@ -116,6 +116,7 @@ enum bpf_map_type {
>       BPF_MAP_TYPE_DEVMAP,
>       BPF_MAP_TYPE_SOCKMAP,
>       BPF_MAP_TYPE_CPUMAP,
> +     BPF_MAP_TYPE_SOCKHASH,
>  };
>  
>  enum bpf_prog_type {
> @@ -1835,7 +1836,10 @@ struct bpf_stack_build_id {
>       FN(msg_pull_data),              \
>       FN(bind),                       \
>       FN(xdp_adjust_tail),            \
> -     FN(skb_get_xfrm_state),
> +     FN(skb_get_xfrm_state),         \
> +     FN(sock_hash_update),           \
> +     FN(msg_redirect_hash),          \
> +     FN(sk_redirect_hash),
>  
>  /* integer value in 'imm' field of BPF_CALL instruction selects which helper
>   * function eBPF program intends to call

Thanks for documenting the helpers in include/uapi/linux/bpf.h! However
the doc is missing in the update to the bpf.h file under tools/ in this
patch, could you please fix it?

Best regards,
Quentin

Reply via email to