Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1299695imm; Fri, 27 Jul 2018 14:54:36 -0700 (PDT) X-Google-Smtp-Source: AAOMgperttXfMNldKj0PYxGFjbvVI8tvZdb38TWhDCDudIBdvAOHeCMIZhYp7jfCNZo93NJk6iDv X-Received: by 2002:a63:710d:: with SMTP id m13-v6mr7603648pgc.66.1532728476123; Fri, 27 Jul 2018 14:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532728476; cv=none; d=google.com; s=arc-20160816; b=HykDbGxGaFJomsLbSwFku2rloVX/fxqUydBTwG3YX5blXCe5KP8zd8w//KQDvZrfA8 gmLiVaZRNDvtxD6c2MIC/wfetf/+kRdMSwAkz/m5lMwnXDZDD0YaaoguAKdt1Y7mJ0Lr ZhpJkac+5EolCPZfkhHPFDfVYKm2+bwgzThvbJ9D65Fk3a6gxNoHPsg/Fm4eHS31NBCE fcnXBqUQL2RnaLVtET+e0pRE2S+CZPSuZGMKAMBDMJGQxf1ySo4TyPBDhPhxuEq+9ihC +T4CCpL/sKEbchW+LFuaBKRe75IQdQ7obdGAPurysdF5PVbwwYHZngeDM5N/PYPuTTNb 52Tg== 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=aaL6jEaAKv6xk2HSLA2YpOKJojDVFyvDTGqOyzafF1c=; b=U608z7k38Uulj00H+pdKm97b36BkY7yU9EXxiZP0FO3s3/l43MoEJEwtDmuMl2h3/T JCf15Co84MtFdhLWmJ+tzDMYVsDpemAu6lV9xBifJDgzERAewDvZ3UgcIl0++EzAwOQh +OvJhGQ4lnlUIve3U8pUZSBMSa2HDfvNFBO6scyPRr1BoaMXWgbxwqi+H+2nsMBRP5PF XGOvVojKfO+wtfvSLGjwwkwnOXkSHjmALNFvpMR64R6P522uDRCJ5JKe15lnYGkszAUD re5eYUT7vddqZHrxt0CuC1lBAeF7C9/Iyheg4AdvA/cX0SBRbRF9CpGBJxoAvhlmpp6q MvQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@fb.com header.s=facebook header.b=p0m48c3Q; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=kxmbeeIV; 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 c22-v6si4393322plo.271.2018.07.27.14.54.21; Fri, 27 Jul 2018 14:54:36 -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=p0m48c3Q; dkim=pass header.i=@fb.onmicrosoft.com header.s=selector1-fb-com header.b=kxmbeeIV; 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 S2389957AbeG0XRT (ORCPT + 99 others); Fri, 27 Jul 2018 19:17:19 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:52342 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389889AbeG0XRS (ORCPT ); Fri, 27 Jul 2018 19:17:18 -0400 Received: from pps.filterd (m0044012.ppops.net [127.0.0.1]) by mx0a-00082601.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w6RLjQuF006591; Fri, 27 Jul 2018 14:53:07 -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=aaL6jEaAKv6xk2HSLA2YpOKJojDVFyvDTGqOyzafF1c=; b=p0m48c3QMElsuVzfAB6NL8MURNAm5uMpv7ZBvgUACb2Xwv5Cp/93HBdffesENXfim+uq 5yH1B2Js8y31IIRTXpg15ge+QNoJjaOgHpD2HyPff2g4eQADZXw0TcfdKKo5LZaPg5/o DaViQfee23kI0mjeVIqypDKUt6b0lD5Ry+U= Received: from maileast.thefacebook.com ([199.201.65.23]) by mx0a-00082601.pphosted.com with ESMTP id 2kgb58r2md-2 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Fri, 27 Jul 2018 14:53:07 -0700 Received: from NAM04-CO1-obe.outbound.protection.outlook.com (192.168.183.28) by o365-in.thefacebook.com (192.168.177.28) with Microsoft SMTP Server (TLS) id 14.3.361.1; Fri, 27 Jul 2018 17:53:05 -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=aaL6jEaAKv6xk2HSLA2YpOKJojDVFyvDTGqOyzafF1c=; b=kxmbeeIVinKw2GU9KuMOQKUmQBXv59rZa65h1gJMGWacPTuKk9gNJhdf0cexEuUcy4VMJMVEzg/KOmfLmgj9XbFX0Hvt9yk2kJvmqAWmo9W6r/6xv+cSUMMnKx9crpELPgyZ4dafElODBcOko7REKcEtHTlEsvNj0Wjrr1ds22A= Received: from castle.thefacebook.com (2620:10d:c090:200::5:fd07) by CY1PR15MB0171.namprd15.prod.outlook.com (2a01:111:e400:58bb::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.17; Fri, 27 Jul 2018 21:53:02 +0000 From: Roman Gushchin To: CC: , , Roman Gushchin , Alexei Starovoitov , Daniel Borkmann Subject: [PATCH v4 bpf-next 03/14] bpf: pass a pointer to a cgroup storage using pcpu variable Date: Fri, 27 Jul 2018 14:52:32 -0700 Message-ID: <20180727215243.3850-4-guro@fb.com> X-Mailer: git-send-email 2.14.4 In-Reply-To: <20180727215243.3850-1-guro@fb.com> References: <20180727215243.3850-1-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [2620:10d:c090:200::5:fd07] X-ClientProxiedBy: MWHPR11CA0020.namprd11.prod.outlook.com (2603:10b6:301:1::30) To CY1PR15MB0171.namprd15.prod.outlook.com (2a01:111:e400:58bb::17) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8fdd1e5b-6633-461c-25c5-08d5f40b538d X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600074)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:CY1PR15MB0171; X-Microsoft-Exchange-Diagnostics: 1;CY1PR15MB0171;3:pUMJVu75p3xbYTFQi0AZwC5obGuQpVa3K9cNtrnolvbSknnTd8B8NnxI4PFh0a+xW+MrI84pAGpWKlrS1QslWEbr84npteLZg91IOKPMo/D9qTyJsSa9rEAyprZZznSmY7JacMn8Sg3ZVYvN8TBT1YecHzC9jlLkhiXteN76ZGggQ5jrBbWCn5eNwXoA5bUwStOPGySx+lMjSTcUJ+lZ7Udr6QtSUgmk0jsNy7Vbvfg7b143OE7ccjVpUQ9/16UG;25:zhDU+2jQF9SixL/EoCAX5dVs8QSSnAnrzlHRuhuhZGeEUw4tz7IA4L1tIVrA9Cncd2dN/Umir+cMTVmK1oq+fhaRMHl04mGLuj/eHlhkmN0bQiGKdRvtP4nsQ+O508qJFORRJRKz3IZiugEqbWWlusLKsVAFpWycBd1HGoFGOXfLhc6QGE4L3aNDZe3iHGy816Uyd/5/de6hYqgAKCQ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bczHrYsX0z/o6miTt9ixGjLDDw8p3C7gOIZC0V/yPsJSKFUF+sKdOUC5K4o7odfOjFiAsf393k5mex1PIOjN/EBBwEHKphxiPMw/6QIx9QyFPzQewnW4pnXwjLWMUAtR4+HDsXr+LewKuHLQloHMHBMhRYXmda23tXgGzR6aw9ibLPanQJVvCRJOLV4QDA+W+8gsUTF51jJIeyc7 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)(3231311)(11241501184)(944501410)(52105095)(10201501046)(3002001)(93006095)(93001095)(149027)(150027)(6041310)(20161123562045)(20161123560045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016);SRVR:CY1PR15MB0171;BCL:0;PCL:0;RULEID:;SRVR:CY1PR15MB0171; X-Forefront-PRVS: 07467C4D33 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(366004)(39860400002)(136003)(376002)(346002)(396003)(199004)(189003)(478600001)(36756003)(52116002)(76176011)(106356001)(52396003)(316002)(50226002)(53416004)(51416003)(6512007)(68736007)(50466002)(48376002)(105586002)(2361001)(4326008)(53936002)(25786009)(16586007)(54906003)(2351001)(97736004)(6506007)(386003)(305945005)(7736002)(11346002)(446003)(46003)(486006)(2616005)(69596002)(6666003)(186003)(16526019)(5660300001)(47776003)(476003)(6486002)(6916009)(8936002)(5024004)(86362001)(6116002)(14444005)(1076002)(81156014)(8676002)(81166006)(2906002)(42262002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY1PR15MB0171;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-Diagnostics: =?us-ascii?Q?1;CY1PR15MB0171;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rivalTime: 27 Jul 2018 21:53:02.1876 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8fdd1e5b-6633-461c-25c5-08d5f40b538d X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 8ae927fe-1255-47a7-a2af-5f3a069daaa2 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR15MB0171 X-OriginatorOrg: fb.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-07-27_09:,, 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 This commit introduces the bpf_cgroup_storage_set() helper, which will be used to pass a pointer to a cgroup storage to the bpf helper. Signed-off-by: Roman Gushchin Cc: Alexei Starovoitov Cc: Daniel Borkmann Acked-by: Martin KaFai Lau --- include/linux/bpf-cgroup.h | 15 +++++++++++++++ kernel/bpf/local_storage.c | 2 ++ 2 files changed, 17 insertions(+) diff --git a/include/linux/bpf-cgroup.h b/include/linux/bpf-cgroup.h index 7d00d58869ed..9a144ddbbc8f 100644 --- a/include/linux/bpf-cgroup.h +++ b/include/linux/bpf-cgroup.h @@ -4,6 +4,7 @@ #include #include +#include #include #include @@ -21,6 +22,8 @@ struct bpf_cgroup_storage; extern struct static_key_false cgroup_bpf_enabled_key; #define cgroup_bpf_enabled static_branch_unlikely(&cgroup_bpf_enabled_key) +DECLARE_PER_CPU(void*, bpf_cgroup_storage); + struct bpf_cgroup_storage_map; struct bpf_storage_buffer { @@ -97,6 +100,17 @@ int __cgroup_bpf_run_filter_sock_ops(struct sock *sk, int __cgroup_bpf_check_dev_permission(short dev_type, u32 major, u32 minor, short access, enum bpf_attach_type type); +static inline void bpf_cgroup_storage_set(struct bpf_cgroup_storage *storage) +{ + struct bpf_storage_buffer *buf; + + if (!storage) + return; + + buf = READ_ONCE(storage->buf); + this_cpu_write(bpf_cgroup_storage, &buf->data[0]); +} + struct bpf_cgroup_storage *bpf_cgroup_storage_alloc(struct bpf_prog *prog); void bpf_cgroup_storage_free(struct bpf_cgroup_storage *storage); void bpf_cgroup_storage_link(struct bpf_cgroup_storage *storage, @@ -250,6 +264,7 @@ static inline int cgroup_bpf_prog_query(const union bpf_attr *attr, return -EINVAL; } +static inline void bpf_cgroup_storage_set(struct bpf_cgroup_storage *storage) {} static inline int bpf_cgroup_storage_assign(struct bpf_prog *prog, struct bpf_map *map) { return 0; } static inline void bpf_cgroup_storage_release(struct bpf_prog *prog, diff --git a/kernel/bpf/local_storage.c b/kernel/bpf/local_storage.c index 395e7278ec75..62feded85e6b 100644 --- a/kernel/bpf/local_storage.c +++ b/kernel/bpf/local_storage.c @@ -7,6 +7,8 @@ #include #include +DEFINE_PER_CPU(void*, bpf_cgroup_storage); + #ifdef CONFIG_CGROUP_BPF struct bpf_cgroup_storage_map { -- 2.14.4