Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754245AbbHCQaI (ORCPT ); Mon, 3 Aug 2015 12:30:08 -0400 Received: from ns.iliad.fr ([212.27.33.1]:34230 "EHLO ns.iliad.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754006AbbHCQaG (ORCPT ); Mon, 3 Aug 2015 12:30:06 -0400 X-Greylist: delayed 379 seconds by postgrey-1.27 at vger.kernel.org; Mon, 03 Aug 2015 12:30:06 EDT Message-ID: <55BF9590.4080205@freebox.fr> Date: Mon, 03 Aug 2015 18:23:44 +0200 From: Nicolas Schichan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.8.0 MIME-Version: 1.0 To: Daniel Borkmann , Alexei Starovoitov , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/6] test_bpf: add module parameters to filter the tests to run. References: <1438610528-14245-1-git-send-email-nschichan@freebox.fr> <1438610528-14245-5-git-send-email-nschichan@freebox.fr> <55BF8F90.5030001@iogearbox.net> In-Reply-To: <55BF8F90.5030001@iogearbox.net> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1726 Lines: 57 On 08/03/2015 05:58 PM, Daniel Borkmann wrote: > On 08/03/2015 04:02 PM, Nicolas Schichan wrote: >> When developping on the interpreter or a particular JIT, it can be >> insteresting to restrict the test list to a specific test or a > > s/insteresting/interesting/ [...] > s/test_pbf/test_bpf/ [...] > s/test_pbf/test_bpf/ [...] > s/conver/cover/ Sorry for the various typos, I'll fix that in a V2. >> + */ >> + if (test_id >= ARRAY_SIZE(tests)) { >> + pr_err("test_bpf: invalid test_id specified.\n"); >> + return -EINVAL; >> + } > [...] >> @@ -4893,6 +4955,14 @@ static __init void destroy_bpf_tests(void) >> } >> } >> >> +static bool exclude_test(int test_id) >> +{ >> + if (test_range[0] >= 0 && >> + (test_id < test_range[0] || test_id > test_range[1])) >> + return true; >> + return false; > > Minor nit: could directly return it, f.e.: > > return test_range[0] >= 0 && (test_id < test_range[0] || > test_id > test_range[1]); I will change that. > Btw, for the range test in prepare_bpf_tests(), you could also reject > a negative lower bound index right there. I thought it was better to have all the sanity checks grouped in prepare_bpf_tests() (with the checking of the test_name and test_id parameters nearby) ? Also a negative lower bound is meaning that no range has been set so all tests should be run. Thanks, -- Nicolas Schichan Freebox SAS -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/