From patchwork Wed Feb 28 16:39:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Eric Dumazet X-Patchwork-Id: 879212 X-Patchwork-Delegate: bpf@iogearbox.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="T0iZBJMa"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zs1Vm44G6z9s1X for ; Thu, 1 Mar 2018 03:39:28 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932888AbeB1QjZ (ORCPT ); Wed, 28 Feb 2018 11:39:25 -0500 Received: from mail-pf0-f193.google.com ([209.85.192.193]:35604 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932090AbeB1QjW (ORCPT ); Wed, 28 Feb 2018 11:39:22 -0500 Received: by mail-pf0-f193.google.com with SMTP id y186so1214524pfb.2 for ; Wed, 28 Feb 2018 08:39:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=azeqgjnytkCpmCCbUqK+GTctyNlzv/IdKpfbQiBte04=; b=T0iZBJMawne+A6+YSZunDTC+glf+E+0KizrtmZgtLf9QFyFDPt+DE/fbuvHLmvYWD1 g1BYPJVz1OUyuHGTnnyjKJqSmnBkTM7TSQWEH6qjo/hqmEuO4vjPauTqAHZ/sDRRUHTC efAUml23OTiJ5NqqwSWaDl/NiVJP1Qz/FseVpej5cF8anbSeRJEclBdA/+pC6ZDBrKhu ltUU+k8ZndlxQ4nZ/09ib+p9bjPl3rbAdJGZzEpBkgaycJ29slCD02+AWu5cJN5IAIFN ZJEyhuqWXyJ4WWcxBgoeZ3/THmZDKaUy+BHh+D8FJeGH8wsUkb4j1da5XXKnzG/FM735 kDhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=azeqgjnytkCpmCCbUqK+GTctyNlzv/IdKpfbQiBte04=; b=kI+vqhGq98RCW4JzaL2lkJxDb0WidOLCZCPRdI60otz5H85QMzJP7l6LVs2OOpH54V gxWBalp4A76hgimwGT7VVqe4GJ1ujQJZ0bHaM7Up1rXZ0ub7cAMI7NS9PquzprFIArnZ Fb9I9XhuXmxF9r/ApgNiobLtaNBK0UCVi61mTK2fFIXi4nOPJmphW7Fnb9RNwAsShRPD eErWZL14nQzflK/k18RtNQn8BSATA2vX/nvqNqSemjMSjRnsQ6o5TzElE9ZvqvayHhZu HGZCz6XE2a3aPQLwmfB4GfYC8iXGUjKeq3DEQWTPG+Q7k0/ibtbglGLoxLVIYI8n3EfZ UL6A== X-Gm-Message-State: APf1xPCks0n2ilBPRjr/HKgGRsLdCdv1djBmvPjZo5KBDG22t8tNoFFp SretqStNZWN+QUDoYNF+e5w= X-Google-Smtp-Source: AH8x226cl1CauL0AsjHzibIgFRmhsO78MPb9/k3Unr+X24t1kricjKznCHpdTlm4CkGzy0HD5pqduQ== X-Received: by 10.98.147.156 with SMTP id r28mr18494700pfk.204.1519835962140; Wed, 28 Feb 2018 08:39:22 -0800 (PST) Received: from ?IPv6:2a00:79e1:abc:100:124a:7dff:fece:8894? ([2a00:79e1:abc:100:124a:7dff:fece:8894]) by smtp.googlemail.com with ESMTPSA id q87sm4736521pfa.29.2018.02.28.08.39.21 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 28 Feb 2018 08:39:21 -0800 (PST) Message-ID: <1519835960.30253.3.camel@gmail.com> Subject: [PATCH net] test_bpf: reduce MAX_TESTRUNS From: Eric Dumazet To: Daniel Borkmann , Alexei Starovoitov Cc: netdev Date: Wed, 28 Feb 2018 08:39:20 -0800 In-Reply-To: <1519690325.3258.12.camel@gmail.com> References: <1519671166.3258.10.camel@gmail.com> <1519690325.3258.12.camel@gmail.com> X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Eric Dumazet For tests that are using the maximal number of BPF instruction, each run takes 20 usec. Looping 10,000 times on them totals 200 ms, which is bad when the loop is not preemptible. test_bpf: #264 BPF_MAXINSNS: Call heavy transformations jited:1 19248 18548 PASS test_bpf: #269 BPF_MAXINSNS: ld_abs+get_processor_id jited:1 20896 PASS Lets divide by ten the number of iterations, so that max latency is 20ms. We could use need_resched() to break the loop earlier if we believe 20 ms is too much. Signed-off-by: Eric Dumazet Acked-by: David S. Miller ---  lib/test_bpf.c |    2 +-  1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/test_bpf.c b/lib/test_bpf.c index b4e22345963f339ffe05c974bc111ae7da9dc58f..d8dc618b223bb5168b0c7e9d9f4316eef3fbfa34 100644 --- a/lib/test_bpf.c +++ b/lib/test_bpf.c @@ -27,7 +27,7 @@ /* General test specific settings */ #define MAX_SUBTESTS 3 -#define MAX_TESTRUNS 10000 +#define MAX_TESTRUNS 1000 #define MAX_DATA 128 #define MAX_INSNS 512 #define MAX_K 0xffffFFFF