Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp1056748imm; Thu, 5 Jul 2018 13:56:08 -0700 (PDT) X-Google-Smtp-Source: AAOMgpe4vPXwODKPWrL0DN/QQ6rCzMV3tjKiAYJqrA3gQBb1hBqfe00izKDwwnteMnLL/ZEitz+q X-Received: by 2002:a17:902:714e:: with SMTP id u14-v6mr7699170plm.289.1530824168566; Thu, 05 Jul 2018 13:56:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530824168; cv=none; d=google.com; s=arc-20160816; b=C8vthPP7CPO2nqM91Q6o4Xoc3vQxwk0apfce4LY31zRZ5zZ/LfG8hNALLhMm4HdX+1 Eh8ntABb8ncM+6cE3fTwj3rko++7jRvXS2uGLtN6mxsDZU4FnFS9vAskaW301IbIfn7B HfL+ag0XLOMyc2sbw75KoE5+T2ktpGRA1xrCRyaOUR6WCsLleppyMXCE2Bsp2Xp+yjcW fVEyT2VPD8e/b+OJWYELFXL04qS/aydwOsZfyOpEKWFP3YfDviofmXbbCvh00bHS6zd6 K5WpBEnpGsODTUefr/UiGATaJZQjrWeOjJLzrYFSG5xkLO2tEPkcAyun/+sXj0ru95ft 4Odg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-signature :arc-authentication-results; bh=bORC1JD0YP835z1QFQWDyQXRjeP3qHZESb5m6qq3qEU=; b=gSzFh2xExC8pW/liLuVrY8MX0HERXdvPDcwxPyhldslctof/WeIlTkK+flHoioCJ+y WXJgXIKBbI8kYsi9onucjt7R0e6IjJ+2eBCyEcsFj7prc61jsxVrHSKxSx+abKaL+4CE RS8ASEvfrHZO1anx85hjEjNYbARwyjEk7Fkobt6Tw/syO+DI0VnAAxLZslWVCbRWYvM9 mNZeRIpyJULHreETvPWXlzPi5mnvnBSFacT7bFbvcWTHQDDAI0oWq4dACRBi9aAzYJYI 3VxdnAj/XnNikC3eNi0hIT41ERBLOgSzmo4QI2jfE/Rhsehpoyr1Ae3hP9tIg1zxF8wM F0fA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=lk+26anv; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=jCJwkbxw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bc4-v6si6256277plb.254.2018.07.05.13.55.54; Thu, 05 Jul 2018 13:56:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=lk+26anv; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=jCJwkbxw; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=fb.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932412AbeGEUxo (ORCPT + 99 others); Thu, 5 Jul 2018 16:53:44 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:51718 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754357AbeGEUwo (ORCPT ); Thu, 5 Jul 2018 16:52:44 -0400 Received: from pps.filterd (m0109331.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w65Km7es005933; Thu, 5 Jul 2018 13:52:23 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=bORC1JD0YP835z1QFQWDyQXRjeP3qHZESb5m6qq3qEU=; b=lk+26anvMdCPug6eiJ1Y6ZZCYg7HJHG02kcOeZKZnPBxO23uIYY8tdT89UijJMKEin0i +2qMbrQYscGvoPosSAzI7iE3awIUejl1fAZ4/OVnsSiRh+Q1Qv5GarCPjJ8PJb4KXnM1 Qi5AQ7W4t0bnZyG62GDXsB2gwUKQrTEg9R8= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2k1pub8spk-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 05 Jul 2018 13:52:23 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.23) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 5 Jul 2018 16:52:22 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fb.onmicrosoft.com; s=selector1-fb-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=bORC1JD0YP835z1QFQWDyQXRjeP3qHZESb5m6qq3qEU=; b=jCJwkbxwo+GiUNxH4ewVf7VTmpz1tbmxFn7Llkz6yzGDM4oD5RNnfELS2t/kbbBkBvaiivdcT2ti6jxVQRTzF/SxQtEkGsIvQWdYolQ6Um6Y3dj1viQpa1anGRRI5S4gr9IjoSDK1W161igECXJxBoKsMrMhTV48RaAzn5voYMA= Received: from castle.thefacebook.com (2620:10d:c090:200::4:9a3d) by BY2PR15MB0166.namprd15.prod.outlook.com (2a01:111:e400:58e0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.26; Thu, 5 Jul 2018 20:52:18 +0000 From: Roman Gushchin To: CC: , , , Roman Gushchin , Alexei Starovoitov , Daniel Borkmann Subject: [PATCH v2 bpf-next 11/14] bpf/test_run: support cgroup local storage Date: Thu, 5 Jul 2018 13:51:36 -0700 Message-ID: <20180705205139.3462-12-guro@fb.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180705205139.3462-1-guro@fb.com> References: <20180705205139.3462-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c090:200::4:9a3d] X-ClientProxiedBy: MWHPR13CA0025.namprd13.prod.outlook.com (2603:10b6:300:95::11) To BY2PR15MB0166.namprd15.prod.outlook.com (2a01:111:e400:58e0::12) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dfb29d49-7e49-40fb-5916-08d5e2b932b3 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:BY2PR15MB0166; X-Microsoft-Exchange-Diagnostics: 1;BY2PR15MB0166;3:7tKza6Utw2WFYjnOBCGx2G8iVOkg7UgeOZdiI5dw32purv6J+jd6WFs7ce5Xvb2fQeoZazTA8RYc8WozURgDlz2UCr1J7Ix+cKa8l5ZmrTUp0eafRa7bQetroRTjGfMi72dvCy99Qw4yisMRHnlf2op2IIF7gKoWx6tRUsnZGeyyG85/hbTgSmaebfKAsm9S9PYmMpTQqPfVOj17zqBj4UxB0lBMmAhHu060bXJpt7zguvb543wFP25Uf2huSkie;25:uRYBy/s4C3e/A5QLQWkPnNlHa6hkWbLf9CWrPzAO7pr1yJXrQ535Ep3n6OxMwwM5CRNaWKz1VndlRWK52U27PugOIefH6TwTtpSVYCvN4ibXtLzn1jFFQhdOItbFk5FB2YKdN1EA6BAR76Km9DkMDbMa6R056kjtbjYockxi5lG6CsT6+7wjB/3LFMTt5SSOO0xm+ZFKodNg1OnPrZ/9bTiKxGpQ0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AXg6TqYW6mbGH+jX2Qmz5txTLme5tAL9zVPU2C5tSFY73BhgJtcSzP+ConjPByG+jN3DLBLHuGi0AfoiWML3aGRuULotiGGmNaDZFVcZjyamlQyswPDP4O78J3nNpHL2Ujw2gJMjNMNYo+0OSkyGVnSkbcjzEpMcVjAzs9u/LyKZ4F99/ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(67672495146484); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231254)(11241501184)(944501410)(52105095)(149027)(150027)(6041310)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:BY2PR15MB0166;BCL:0;PCL:0;RULEID:;SRVR:BY2PR15MB0166; X-Forefront-PRVS: 0724FCD4CD X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(136003)(376002)(346002)(366004)(396003)(39860400002)(189003)(199004)(11346002)(446003)(5660300001)(25786009)(6512007)(4326008)(53936002)(6916009)(6666003)(6116002)(7736002)(16526019)(50466002)(8936002)(48376002)(105586002)(53416004)(486006)(316002)(54906003)(68736007)(1076002)(186003)(16586007)(47776003)(476003)(2616005)(478600001)(106356001)(81166006)(5024004)(69596002)(8676002)(81156014)(305945005)(14444005)(97736004)(51416003)(86362001)(2906002)(46003)(2351001)(50226002)(6506007)(2361001)(52396003)(36756003)(6486002)(76176011)(52116002)(386003)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR15MB0166;H:castle.thefacebook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BY2PR15MB0166;23:m1Be/1hYXUcuWHAEY0E+kvh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MwtvvVhwL4lhcYO4od6Hj9bxSVijpvjqEMXuF6LcpUjkD6/S71leTHQ3ke8yRg= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2018 20:52:18.4449 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dfb29d49-7e49-40fb-5916-08d5e2b932b3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR15MB0166 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-05_08:,, signatures=0 X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Allocate a temporary cgroup storage to use for bpf program test runs. Because the test program is not actually attached to a cgroup, the storage is allocated manually just for the execution of the bpf program. If the program is executed multiple times, the storage is not zeroed on each run, emulating multiple runs of the program, attached to a real cgroup. Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau --- net/bpf/test_run.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c index 68c3578343b4..74971a9b7cfb 100644 --- a/net/bpf/test_run.c +++ b/net/bpf/test_run.c @@ -11,12 +11,14 @@ #include #include -static __always_inline u32 bpf_test_run_one(struct bpf_prog *prog, void *ctx) +static __always_inline u32 bpf_test_run_one(struct bpf_prog *prog, void *ctx, + struct bpf_cgroup_storage *storage) { u32 ret; preempt_disable(); rcu_read_lock(); + bpf_cgroup_storage_set(storage); ret = BPF_PROG_RUN(prog, ctx); rcu_read_unlock(); preempt_enable(); @@ -26,14 +28,19 @@ static __always_inline u32 bpf_test_run_one(struct bpf_prog *prog, void *ctx) static u32 bpf_test_run(struct bpf_prog *prog, void *ctx, u32 repeat, u32 *time) { + struct bpf_cgroup_storage *storage = NULL; u64 time_start, time_spent = 0; u32 ret = 0, i; + storage = bpf_cgroup_storage_alloc(prog); + if (IS_ERR(storage)) + return PTR_ERR(storage); + if (!repeat) repeat = 1; time_start = ktime_get_ns(); for (i = 0; i < repeat; i++) { - ret = bpf_test_run_one(prog, ctx); + ret = bpf_test_run_one(prog, ctx, storage); if (need_resched()) { if (signal_pending(current)) break; @@ -46,6 +53,8 @@ static u32 bpf_test_run(struct bpf_prog *prog, void *ctx, u32 repeat, u32 *time) do_div(time_spent, repeat); *time = time_spent > U32_MAX ? U32_MAX : (u32)time_spent; + bpf_cgroup_storage_free(storage); + return ret; } -- 2.14.4