From mboxrd@z Thu Jan 1 00:00:00 1970 From: Quentin Monnet Subject: Re: [PATCH bpf-next v4 3/4] bpf: selftest additions for SOCKHASH Date: Fri, 4 May 2018 11:11:26 +0100 Message-ID: References: <1525372108-8690-1-git-send-email-john.fastabend@gmail.com> <1525372108-8690-4-git-send-email-john.fastabend@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Cc: netdev@vger.kernel.org To: John Fastabend , borkmann@iogearbox.net, ast@kernel.org Return-path: Received: from mail-wm0-f66.google.com ([74.125.82.66]:33907 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750707AbeEDKL3 (ORCPT ); Fri, 4 May 2018 06:11:29 -0400 Received: by mail-wm0-f66.google.com with SMTP id a137-v6so6372021wme.1 for ; Fri, 04 May 2018 03:11:29 -0700 (PDT) In-Reply-To: <1525372108-8690-4-git-send-email-john.fastabend@gmail.com> Content-Language: en-US Sender: netdev-owner@vger.kernel.org List-ID: 2018-05-03 11:28:27 UTC-0700 ~ 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/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