From: Stanislav Fomichev Subject: Re: [PATCH bpf-next v2 0/5] support flow dissector in BPF_PROG_TEST_RUN Date: Wed, 5 Dec 2018 09:57:39 -0800 Message-ID: <20181205175739.GA22378@mini-arch.hsd1.ca.comcast.net> References: <20181204040100.243614-1-sdf@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Stanislav Fomichev , Networking , "David S . Miller" , Alexei Starovoitov , Daniel Borkmann , simon.horman@netronome.com To: Song Liu Return-path: Received: from mail-pg1-f193.google.com ([209.85.215.193]:33194 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727564AbeLER5m (ORCPT ); Wed, 5 Dec 2018 12:57:42 -0500 Received: by mail-pg1-f193.google.com with SMTP id z11so9373473pgu.0 for ; Wed, 05 Dec 2018 09:57:41 -0800 (PST) Content-Disposition: inline In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On 12/05, Song Liu wrote: > On Mon, Dec 3, 2018 at 8:01 PM Stanislav Fomichev wrote: > > > > This patch series adds support for testing flow dissector BPF programs by > > extending already existing BPF_PROG_TEST_RUN. The goal is to have a > > packet as an input and `struct bpf_flow_key' as an output. That way > > we can easily test flow dissector programs' behavior. > > I've also modified existing test_progs.c test to do a simple flow > > dissector run as well. > > > > * first patch introduces new __skb_flow_bpf_dissect to simplify > > sharing between __skb_flow_bpf_dissect and BPF_PROG_TEST_RUN > > * second patch adds actual BPF_PROG_TEST_RUN support > > * third patch converts BPF flow dissector to thoff > > * forth patch correctly caps nhoff and thoff returned from bpf flow > > dissector > > * fifth patch adds example usage to the selftests > > > > v2 changes: > > > > * new patch to use thoff instead of nhoff in bpf flow dissector > > * new patch to correctly cap thoff for BPF case > > * add missing memset(flow_keys, 0, ...) to __skb_flow_bpf_dissect > > * set test iterations to 10 > > > > Stanislav Fomichev (5): > > net/flow_dissector: move bpf case into __skb_flow_bpf_dissect > > bpf: add BPF_PROG_TEST_RUN support for flow dissector > > selftests/bpf: use thoff instead of nhoff in BPF flow dissector > > net/flow_dissector: correctly cap nhoff and thoff in case of BPF > > selftests/bpf: add simple BPF_PROG_TEST_RUN examples for flow > > dissector > > > > include/linux/bpf.h | 3 + > > include/linux/skbuff.h | 5 ++ > > net/bpf/test_run.c | 71 ++++++++++++++- > > net/core/filter.c | 1 + > > net/core/flow_dissector.c | 88 ++++++++++++------- > > tools/testing/selftests/bpf/Makefile | 3 + > > tools/testing/selftests/bpf/bpf_flow.c | 36 ++++---- > > .../selftests/bpf/flow_dissector_load.c | 43 ++------- > > .../selftests/bpf/flow_dissector_load.h | 55 ++++++++++++ > > tools/testing/selftests/bpf/test_progs.c | 78 +++++++++++++++- > > 10 files changed, 289 insertions(+), 94 deletions(-) > > create mode 100644 tools/testing/selftests/bpf/flow_dissector_load.h > > > > -- > > 2.20.0.rc1.387.gf8505762e3-goog > > > > For the series: > > Acked-by: Song Liu Thank you for a review!