Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp212591imm; Thu, 28 Jun 2018 18:23:40 -0700 (PDT) X-Google-Smtp-Source: ADUXVKK3unalmgvzN2nTRAaQL2SA9T6cVzx9AhgwU4p72TTg0IYl7kwTRe1UYVWlpctwdojbXwI5 X-Received: by 2002:a17:902:b693:: with SMTP id c19-v6mr12988071pls.165.1530235420025; Thu, 28 Jun 2018 18:23:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530235420; cv=none; d=google.com; s=arc-20160816; b=KEb8WFULKP8kQptbIoD5LnJosOPOPNTOnB0b/KbwQAvxA6Whga5+lq2YLkINUUMyZm IQhgYHSscFzGiFx8+5dsB3+NOd7yB5z7JhZrHbOM8Q81soaUcjGmp4JrDujTsCr8IN3s 4In1xXe4UEQwDI+6Rr4GyvINL+02oMx8LuRm7RpFvI6wDQ7a5U65GscTVdJ0JsXUIKiT KFLOpsNPS25FbhpS8qOq/gxN950QnWbarWQTI3S1jKuFm4hsokiSll0b8hazpYUnQ5Ic C31/oxuNg5fZFMXR4sMXAXu93F4eSrTMH4vlXbMikBCe0lZgIWSzy1TFBKmpMbBI85/d FAuQ== 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=XhxGSb64sYBWasecotBSjDYXKEDObbaHRY4LK2I+LMhvmBtk9p2HicPskbGaj/6HVw Rxg+zuBFD/FcZjU/OiWZP+/klp0DhB+5vy3u5JE3lNF6tJSTwyyQzYWAk0FnVB98ue7I P7pJyJyX4l/eZ9Oco30+LhfP/Jewo2o0yJGZU040rF7O1sVeI6Ep4EtEadiLMPZ+dJTS WH9Glt19WPE5OJeCG4ZraF94JK2ISx2KwXxAy5uozJzg5GlcIaUm/yz/cXOK/Ip44C6a rtaSZ6HInZvfl/9eomQy8FpbdhSG4EMSZEaHuLQiQcNPD1yHoCmDEEDTqyEDrxo3gZxW HuJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=CuHlPTsz; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=F9EM0uDe; 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 y4-v6si7734945plp.120.2018.06.28.18.22.51; Thu, 28 Jun 2018 18:23:39 -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=CuHlPTsz; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=F9EM0uDe; 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 S935881AbeF1QuC (ORCPT + 99 others); Thu, 28 Jun 2018 12:50:02 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:56956 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S935796AbeF1Qsd (ORCPT ); Thu, 28 Jun 2018 12:48:33 -0400 Received: from pps.filterd (m0001255.ppops.net [127.0.0.1]) by mx0b-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w5SGkYvf013481; Thu, 28 Jun 2018 09:48:14 -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=CuHlPTszo/5kKA4q6gOxq0a09fAEiSYvz/k0YsQTo4lVHBWlRDCh90I/1ii+u4MwJsm5 qe3nBOJjNGV4vJvwZ/bdfqK3fIQT6W7K9fuW5Pu8zuWivrRdLFetLWM/ecTt1Wk7RSsh 1eWOcbI5egpDY0C6SnPEYB/jE8wsW+p0Xeg= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0b-00082601.pphosted.com with ESMTP id 2jw2u00757-2 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 28 Jun 2018 09:48:13 -0700 Received: from NAM02-BL2-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.26) with Microsoft SMTP Server (TLS) id 14.3.361.1; Thu, 28 Jun 2018 12:48:10 -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=F9EM0uDeIt4r4KX0xGMDJyaXJxNHgFN1uLJpc3yibWqrRmDbH0+c0mGjuCYYjBKu87mGeuuY6ITPJLA5gR3idAW9ryHISDaJ44ILB/p2rIAyLX36/NIl6x+Xa67+sFS7motFQM8aYg8dwOFqNQM0Zg98/LzmG3tyxg6UPktG+74= Received: from castle.thefacebook.com (2620:10d:c090:200::4:4716) by DM3PR15MB1081.namprd15.prod.outlook.com (2603:10b6:0:12::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.884.24; Thu, 28 Jun 2018 16:48:08 +0000 From: Roman Gushchin To: CC: , , , Roman Gushchin , Alexei Starovoitov , Daniel Borkmann Subject: [PATCH bpf-next 11/14] bpf/test_run: support cgroup local storage Date: Thu, 28 Jun 2018 09:47:16 -0700 Message-ID: <20180628164719.28215-12-guro@fb.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180628164719.28215-1-guro@fb.com> References: <20180628164719.28215-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c090:200::4:4716] X-ClientProxiedBy: MW2PR16CA0046.namprd16.prod.outlook.com (2603:10b6:907:1::23) To DM3PR15MB1081.namprd15.prod.outlook.com (2603:10b6:0:12::7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1cddd9c3-d1e7-4356-c9ee-08d5dd16edab X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652034)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600026)(711020)(2017052603328)(7153060)(7193020);SRVR:DM3PR15MB1081; X-Microsoft-Exchange-Diagnostics: 1;DM3PR15MB1081;3:AxRhajtYXT60kMwyUS5UCy5XwAYb/L2G/4M15G3wYAB+BdPsEkzg0KCHuzCC7b3e7EILK/xlnqSfDS3LaFk+GWk9eYxVbWlURFaZEBmoM8CibrGJoRsgK560cZkhIhvA0OAvriFyMo1EwLRb0SeIlGxcQvtp2/5gZJMJe1h8U/rbhCfgxjMTNI0G9GNi763WbZpamBo0W5F6SGdLGnBKTNmydFnZ8xWkwMuhV+FVWusv/oskkK3ZbHZqgrEy0H0r;25:xvdo/mbmmybbV70Sip1WhROlf7BIIPxSY7h7FwiMAo2pmEQa1BoEJo7blpEopTWNIdHDhlbvE6GtyaIE3zCderncBResVgWpzOQ0U/NykD0q/5UJ5XAHY5CROWjF8kJAOLyCFUs/kBvnLkuE5sh0KEc9N1b2GDBIySQ9uSdZCTIPzSwmym12+xg0zWtFzIwKRIxj4HEdtb8QYv5tFmMD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+I91eMXn9TGhfMdFskLFnJH8wigq4QMrScZc6OnjtIoF0UKpjwLc9ufOErS/FP+Zxhph3iQt/SYUYd5tjMjVw7OYTwFmMCdqKLGnN1L2PaXbZqQkP7+6adGZNDHiWl2E/vlS3+5pNMWBi6hu0GvjVcXkfnoZpSIPNj+SFqUvIPMFicavGA7Js531134reh3vJ3nOJhQE 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)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(3231254)(11241501184)(944501410)(52105095)(149027)(150027)(6041310)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011)(7699016);SRVR:DM3PR15MB1081;BCL:0;PCL:0;RULEID:;SRVR:DM3PR15MB1081; X-Forefront-PRVS: 0717E25089 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(136003)(396003)(346002)(39860400002)(376002)(366004)(189003)(199004)(8676002)(6512007)(4326008)(81166006)(81156014)(69596002)(97736004)(52116002)(2361001)(51416003)(8936002)(76176011)(305945005)(53416004)(186003)(16526019)(6506007)(386003)(106356001)(105586002)(2906002)(25786009)(36756003)(52396003)(7736002)(68736007)(50226002)(5660300001)(6666003)(53936002)(6916009)(48376002)(50466002)(478600001)(6486002)(1076002)(47776003)(6116002)(86362001)(5024004)(14444005)(16586007)(54906003)(46003)(476003)(486006)(446003)(2351001)(11346002)(2616005)(316002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:DM3PR15MB1081;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;DM3PR15MB1081;23:hJzaqf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j1dDCbgufKD/rOuR7p4JqFuqu2bdAIn1zBQGvbhMRO7oQjVKCFXQYO19EnsCBfpIM4luiPQn/n5lvwkWwgLscdVV0MhYvk= X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2018 16:48:08.0520 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1cddd9c3-d1e7-4356-c9ee-08d5dd16edab X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR15MB1081 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-28_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