Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3138599imm; Fri, 20 Jul 2018 10:47:54 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcYPnSkHkgUoJWvcrZoBemGAweQWAS/CDQxqNpKCzMiyrUOCeShnRz9lzUtUC7ExWvk1P// X-Received: by 2002:a63:4a61:: with SMTP id j33-v6mr2953313pgl.436.1532108874130; Fri, 20 Jul 2018 10:47:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532108874; cv=none; d=google.com; s=arc-20160816; b=GW1JI1o8Afr1sEu6jHQ16e1q6ciKPeLwEDg7bI1gLHbcl1o7WdjTix1v6rDk/3fw6Y +WteqYI1JQ6unSu35Scq+dVBSMmmdtpOZvAt5pICuN0nV0KVjrQP0BlWB7xUExQlG1zK pdh2k5um9aAp9kQgk21otbwrW6a47BXXTF7HYOIVgXXygq4LgVAP4PvkQR6SIUTlmEA9 bQ1rMjLqO3CJ8LAXoSgj8me3IYUJNo4yzkMkGO40BHCGE9IGvgDrOIlfdAUXDa8/Gltf AaAdtWZV8vbEJenOb1pjqISSqiDGpYQDi/KVv4fCSUCxU8DkD20Du9jqc1OqgfBXVQog a2eA== 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=fwm0fDgLWOPme7qsRFrTjWbzveZxUVlgBrIhy3Eg4XQ4EFaYM4btIxgHsvG4rVgwex wvTEzNyCecO7XlR5EMc5gAXb92mPfHZfBDmyfiA5qL+xmS49MChWNp8qUcc+INkAhlD1 EvNFGkLOras3G3iFbu9JyAwXAwE31dA6YyjnJVDFCYGbq1fGXgj8jtcPDGDteC6+nSY7 zRv4iu7zVaAA8JBPZjxlVXJa4qoFO7GKZ6Y27PBzNNmMI2NVSUWVvQwi7gkwgdZmj20b BXhiakc8NOMb2TTm3gDIyEteiITJ/dD7yYF+AQtwner5s+63snHOtzmLdyCUcSLsGoO4 8HiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=l8AHkW2T; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=LIFBCPFG; 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 r23-v6si2373469pgb.623.2018.07.20.10.47.38; Fri, 20 Jul 2018 10:47:54 -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=l8AHkW2T; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=LIFBCPFG; 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 S2388508AbeGTSgO (ORCPT + 99 others); Fri, 20 Jul 2018 14:36:14 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:51870 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388414AbeGTSgM (ORCPT ); Fri, 20 Jul 2018 14:36:12 -0400 Received: from pps.filterd (m0109334.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6KHhhnX031415; Fri, 20 Jul 2018 10:46:31 -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=l8AHkW2Te7HvJ4rJTDGgD7Llo0Unl+5e6gG05xSBTK/fKWOPkJP3bYo1T0fOBJa4Oxgj D/ktY2NwYg6RLvu4GH/nHOvqvZgQZW//lImLFaMKRd4lJw7VBr5zKRHD21no9TPX3tRH ljWzQZ0QmO6XfvXx+I33OAEwMwPp3AkQ3hQ= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2kbj23rknq-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 20 Jul 2018 10:46:30 -0700 Received: from NAM03-BY2-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.31) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 20 Jul 2018 13:46:29 -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=LIFBCPFGGFOZrZpBBWX8381wzfz5VgDUQs3soPY0DHse3CNKkFzU4oQ/T2jE7cs+GJNea2cOlZWXZ4qPaZ+0gVQlQ6Zcc8EqBUY+M0Ab37/+POZZyWqSMzsiFo8OXACjfkX2QoTEEk70n/FoIfEJ+srDsMOD17c6UJoWpbGXJng= Received: from castle.thefacebook.com (2620:10d:c090:200::6:ca05) by SN1PR15MB0175.namprd15.prod.outlook.com (2a01:111:e400:58cf::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.973.21; Fri, 20 Jul 2018 17:46:25 +0000 From: Roman Gushchin To: CC: , , Roman Gushchin , Alexei Starovoitov , Daniel Borkmann Subject: [PATCH v3 bpf-next 11/14] bpf/test_run: support cgroup local storage Date: Fri, 20 Jul 2018 10:45:55 -0700 Message-ID: <20180720174558.5829-12-guro@fb.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180720174558.5829-1-guro@fb.com> References: <20180720174558.5829-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c090:200::6:ca05] X-ClientProxiedBy: MWHPR17CA0096.namprd17.prod.outlook.com (2603:10b6:300:c2::34) To SN1PR15MB0175.namprd15.prod.outlook.com (2a01:111:e400:58cf::14) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: bfda2d98-db7f-4f4a-9a5b-08d5ee68b774 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600067)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:SN1PR15MB0175; X-Microsoft-Exchange-Diagnostics: 1;SN1PR15MB0175;3:Fs5YN1wFPDakYRL9sWgqnoyyfBGFeSLJ3I5kCGi2IcWjfBtu3Vt8KKcl6ngOajn5IriUkm7F3ZHLwOyVevl4mD1a1lOjUmFXOrnu8xUt/licNISb9Ko9N70bsDrJyWRKD3jlKAabvlbobVuQ5QOTi2I8oLSp9STsJNRWXvSoBpJ0MhkRUlfciU1kSl22YAX/m1o7kZjalR+cVWtiGzKG4IZZTNxQk/6bRXL6OgvPLDWZaWBLClVMTsOjbpJJK2V4;25:Ci9eQtcgLCv224FTkXNEkVMMFH3idMij7m/lOYgHd2fgm8B3maHhl2yNah70bWGWPrIg4WScfxvAwCWgfA4n79HKUtrHkhrytHok9Q3lMNa0IQqSfKdtJft2c12AkAJlmt3vpxPECn0hGqbi8ZUcRlLpzrLdKjiy3YpwwnuGKUOK0B06P+10ZLV74vVyd2extrw0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Fpc1112NT6A4V4z0FgNgEDVbI0/b6hUs38GvfRlZUdVVAjDM4XacPmvlErLNGJqzYCd5DmWR+x9dQOxibhTsNoep8DTmWYkqUQENgvq/HmN9GiyPFUAoGPQ9IRqp5mQPWRRtJoixvVGSd7P+cjLLm2Dg2tSUgb0DpSxsxpNVgYu3KyONmZkkDY9qoDvYzjEoyIFy8Oqom7thaaWrwXQ4FDTS2CLKni 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)(93006095)(93001095)(3231311)(11241501184)(944501410)(52105095)(10201501046)(3002001)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123560045)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:SN1PR15MB0175;BCL:0;PCL:0;RULEID:;SRVR:SN1PR15MB0175; X-Forefront-PRVS: 073966E86B X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(346002)(39860400002)(366004)(136003)(376002)(396003)(189003)(199004)(2906002)(6666003)(50466002)(81166006)(53416004)(8676002)(48376002)(2351001)(68736007)(81156014)(106356001)(8936002)(25786009)(105586002)(1076002)(5660300001)(6512007)(6486002)(36756003)(478600001)(86362001)(69596002)(7736002)(6116002)(305945005)(97736004)(2361001)(16586007)(316002)(52116002)(51416003)(52396003)(446003)(50226002)(46003)(54906003)(14444005)(47776003)(2616005)(5024004)(476003)(486006)(6916009)(11346002)(386003)(76176011)(16526019)(53936002)(6506007)(186003)(4326008)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:SN1PR15MB0175;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?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yCVO+zocwdXll3RRgThlaum4U?= =?us-ascii?Q?foNyzO5CLUokbsXFd0QG2C9s7ACRqb6u1b0t6UGbgklDKaf3dptob+EG+xxv?= =?us-ascii?Q?VXOvmoMPRBztuYGpdxlsjxD7QiljFcgm//xu6eh6JPsfw2iMiLaxCdsGbXt2?= =?us-ascii?Q?nvo74oBhACRhjLsV1ED+4pmjHxhz41JLQkoTz+LBK2S0+4jPLWzHMwLATtNj?= =?us-ascii?Q?nluCmjmYYEhZTxBPFwmr9HOZ9w7n0E62dcN9SfUCAxy3mUUKby5xLzSdmfq7?= =?us-ascii?Q?nQGCSjGA/2YAeKoJneZFmFgKT5KMnApPOjvRwTKCmDIWlNs7vjNmKtCkdPUc?= =?us-ascii?Q?q78ha6DeuVVrwIskSlmFOj9rILU71IK9jAvBiFmHI6sdUKAk+ifbbg9D91W2?= =?us-ascii?Q?1YywsvbYNuSO7yJ9sH3iEgTy3sufxu/Kfsj6PAv+yLicG+qjYkG0w04REGBQ?= =?us-ascii?Q?MckjDsbvgN/r1Zv/TbHJKU=3D?= X-Microsoft-Antispam-Message-Info: gOguBOZP1MNDDHPmJTfphZPpj1NjfxAWcCA7hRtOD7Fe8FKNebpFxJFPj2O5SownhcS4zSF7j/TtUMOFkK28ChIfv9m6QP4g9nlZ+mol2Nho51riO8qKw+zvSwyppBxCwLjOYfXfOXUyZaniw2rU3yRSW33llGqW6gBy/LYdC3FIIimBCGzhGQBuKrn7JrhhVH1/Ox6VZ+ZLJ42/h55Ystz3K+wtvLmcW+/20n0Cvefowi0+OuhZcdctMO9ZRwsEkIMzx5JV+ZsMnZX+C8IDRnMv8qVanMz6kbTiTvre41pMqNDDl5Hz0DvwaCeIg9QdUlyaT94dzX02GTcYSf2vWFAseAMr4ReLahb8OaeNwPk= X-Microsoft-Exchange-Diagnostics: 1;SN1PR15MB0175;6:uUtt3WTRfKVhrka36kxeeKIxafj2IrHZKZg0PoVOHk2hhv8V+yf38GT+tujzhXEouFlfzxV/CNSrPuAR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rossTenant-OriginalArrivalTime: 20 Jul 2018 17:46:25.7639 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: bfda2d98-db7f-4f4a-9a5b-08d5ee68b774 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR15MB0175 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-20_05:,, 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