Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1408810imm; Wed, 1 Aug 2018 15:40:16 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcxKzrz84dVUehQELNxlshPmRZG5xpn+Ua4HBhhLL5nxzZLwVIgW7eqNFL1p23CG1jNPew/ X-Received: by 2002:a17:902:8a87:: with SMTP id p7-v6mr168197plo.281.1533163216907; Wed, 01 Aug 2018 15:40:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533163216; cv=none; d=google.com; s=arc-20160816; b=eUK1IgAB4FCshAHS1zH9qvMy7keAlcBCfIGhFth76Ymgh3bEZ3QSvJcN6S50Qkz09a zAMgALUo7tnYns0oH8DejZSZmv0l9lVSFaY/0RNui6cDOfzvC9rGlUERx4ej3iOcEjQd +qsEjWCPmc/5sAah+Uhz3mtwMMgMZ8YWEzt84mB5SzIEZTAuSZo4v80m7Ti4Ho+ziNWt D03vRIIxb5pS0F3OPqqCCIOcAo1bVtzM41oCXaX+zv6EKaw0k1xUt9VA5nAdoEIgwjng DOw4EdXjTAwM6ENS1JA/rl/DLbJAOQY3BvhOjJCErOlvlTYi0n2dZEXmoVZaoTeKp+H7 5Snw== 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=sgGXbrdugL6eMOukXWx9gxCL3wfTYLV5Rg7NE3kE1z0=; b=ADHtlnmOEPRyvPpLLpZSxMNy4MjV1XGmpwwMzEiEkMbBFeaToecFMyttWMOItIt+jF efJ78MFh9fEpw6sQDP4C6AO7Eve3CMc3JVwBDGzSEKlkwQ2ovD0EtXL5sBMp5ENMiTCd BacVPmEPlXZYmIWjQ+bm5dSMI/gn8eo0KSHQE8YF73BhSb3NVskZaM7DShgaQkHcZrNI WXV6oeveEEPzXhXqg+L16vmRN0wbV62G6Ffw+XJ+uJb+Y0CN+++zmmqVtQ1vhhgsJHNt iv5qVZjHqz2Y655FfxB3n7HQAmBW2o5ZgPR+0ifBvrqdCE1Q4ZaE+vzjznYgC5VkNJEE +30w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=ILJgRzWI; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=Jq9PPjGA; 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 e15-v6si169444pli.149.2018.08.01.15.40.02; Wed, 01 Aug 2018 15:40:16 -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=ILJgRzWI; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=Jq9PPjGA; 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 S2388141AbeHBA05 (ORCPT + 99 others); Wed, 1 Aug 2018 20:26:57 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:38812 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387630AbeHBA0x (ORCPT ); Wed, 1 Aug 2018 20:26:53 -0400 Received: from pps.filterd (m0109333.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w71MZ0oJ020865; Wed, 1 Aug 2018 15:38:30 -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=sgGXbrdugL6eMOukXWx9gxCL3wfTYLV5Rg7NE3kE1z0=; b=ILJgRzWIwCUnUhTfGiFXEATcFZdjI428QA49kt88HvzU5+g+4Q0xPzg9df76hI+WW11/ RBXv8Uir0IeSTrxLBXC5CgnvxDTYaSbHf0USEeirG7K3M4XIGbuibiA75b6H6hmM3zpG 5fS19HE02YMCOUtSaVZyY8EnfV5ibTDPFTU= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2kkmqb05qt-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Wed, 01 Aug 2018 15:38:30 -0700 Received: from NAM02-SN1-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; Wed, 1 Aug 2018 18:38:28 -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=sgGXbrdugL6eMOukXWx9gxCL3wfTYLV5Rg7NE3kE1z0=; b=Jq9PPjGAkCxecNjlrkDAVnBHTzn4xQnCcH3qL82wppOE+1X6fijIbEgtojYGuI4PtZ1x83SqckQKgY+dsiWKB9R50l814ub7RbhBy0cvOmejTFRbIsGcNQQzMgLOiUnTV5CLcsfkiUduT8ZPvg+NvQYsiZceZ4metY8untxcBEI= Received: from castle.thefacebook.com (2620:10d:c090:200::5:7cca) by SN1PR15MB0176.namprd15.prod.outlook.com (2a01:111:e400:58cf::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.19; Wed, 1 Aug 2018 22:38:25 +0000 From: Roman Gushchin To: CC: , , Roman Gushchin , Alexei Starovoitov , Daniel Borkmann Subject: [PATCH v6 bpf-next 11/14] bpf/test_run: support cgroup local storage Date: Wed, 1 Aug 2018 15:37:37 -0700 Message-ID: <20180801223740.11252-12-guro@fb.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180801223740.11252-1-guro@fb.com> References: <20180801223740.11252-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c090:200::5:7cca] X-ClientProxiedBy: MWHPR1601CA0016.namprd16.prod.outlook.com (2603:10b6:300:da::26) To SN1PR15MB0176.namprd15.prod.outlook.com (2a01:111:e400:58cf::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fab5237d-96d0-4c5a-39b8-08d5f7ff7ec2 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:SN1PR15MB0176; X-Microsoft-Exchange-Diagnostics: 1;SN1PR15MB0176;3:Y+syTrpIP7uosIE7xx1AL3C8IE5Nho2iAoeAQoH3IaLSa93O46Vb1mxZ3YiB/oiekAnhPiXUCnGZkAHUYSKzTyyqu0Pg3neU9Gp5ziBid1IMNHVRaU+VrepXmYzzwRGw9PqMwceeJYW92W9IVKlX0uF4knXPdshAvLgJwfOlPw+0jVIxUq7eWM/yS1EZPvc9fCFCKBO4P3GIBSWfdBBRSjg7OZ0apgZKz1NAkjRz1B1MoIMGHIq7ZgZ8UzwIkdVG;25:xCgq/D222nuY6QVTN3TbfcjU7hWAa7IV8e4LI0VsQhYCA0G29RV6eNjq8WSTg7PMtcOdELDttaVldLDlL3GjrGSBUiYzLrKbLh+xh4IhxiZkQn5DucSPicJM2bTZNc+kzoYd4j2zjzux+gOdboSMorwwEpkXpyIhqCvAkd2YXgW+hryAI+3pwvoBVkB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p1T2aO6rKcXjcyuxurKbwSEUF/RU0dMvnbMSjwqBx0yUk8MQ1++j7dik7mu9OjpQeqI0RSoSItjqZaAyPbaPxjQfYG6rtavsTDi9njmcHQW00h4DrHQlZ4gmhvcT1RNPumPMB+70a4aXyQwYQy23KHFMDFkuRplMv5PoDzTf2hSP+C5JqhhdNcdxPolF6/p9APkph2UcVEYMEhIBjOJHpnUVpOYB7zC4Q0T4eTGhIP9HY9 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)(3231311)(11241501184)(944501410)(52105095)(3002001)(93006095)(93001095)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123560045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:SN1PR15MB0176;BCL:0;PCL:0;RULEID:;SRVR:SN1PR15MB0176; X-Forefront-PRVS: 0751474A44 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(366004)(376002)(39860400002)(346002)(396003)(136003)(199004)(189003)(11346002)(6486002)(6512007)(50226002)(6916009)(2361001)(5660300001)(53416004)(68736007)(6666003)(386003)(106356001)(6506007)(76176011)(105586002)(52116002)(51416003)(86362001)(36756003)(486006)(2616005)(8936002)(81166006)(16586007)(54906003)(478600001)(50466002)(316002)(81156014)(6116002)(2351001)(69596002)(7736002)(1076002)(52396003)(14444005)(5024004)(16526019)(46003)(8676002)(4326008)(476003)(97736004)(47776003)(305945005)(446003)(186003)(2906002)(48376002)(25786009)(53936002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR15MB0176;H:castle.thefacebook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; Received-SPF: None (protection.outlook.com: fb.com does not designate permitted sender hosts) X-Microsoft-Exchange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YTRjgwF6IvuiQeziaETHLUBmqSz59elocFw= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Aug 2018 22:38:25.1966 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fab5237d-96d0-4c5a-39b8-08d5f7ff7ec2 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR15MB0176 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-08-01_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 22a78eedf4b1..f4078830ea50 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