From patchwork Wed Apr 26 18:24:15 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hannes Frederic Sowa X-Patchwork-Id: 755587 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3wCpQM2M1Mz9s8W for ; Thu, 27 Apr 2017 04:24:43 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=stressinduktion.org header.i=@stressinduktion.org header.b="eKpDraoQ"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="KQkJCg6M"; dkim-atps=neutral Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933365AbdDZSYl (ORCPT ); Wed, 26 Apr 2017 14:24:41 -0400 Received: from out4-smtp.messagingengine.com ([66.111.4.28]:46027 "EHLO out4-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933327AbdDZSYj (ORCPT ); Wed, 26 Apr 2017 14:24:39 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 67F2721CFE; Wed, 26 Apr 2017 14:24:38 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute7.internal (MEProxy); Wed, 26 Apr 2017 14:24:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= stressinduktion.org; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=gDjdg6xsIZJryOqOmjnuA0YFekuLnoK3e1Nux5e4q VA=; b=eKpDraoQUJtFmD0QEh4xL1yAlbc+x2iUWPNGSlzesT4Yb+NuFjdTCbAAC zr0W6WJY2zj/H7rg5+VHdaDHeBSXvuLzkYTJkxC9g2FNLvwlrfOpNGL/FL2dBTLN BgD4M6GsQEGEevpBd/+zUs6wIp3O5XUHvY5qHYf9AUo2H00iVKJF0yzR9GQ+J9Hl 2LiT0KEuB/d8muTUXofcJLLtYwCWC0PvcfBKsVX8SKI6SPNO9hLUXp8hjcOe/TJH GhAQbUg+T9nFCIixP3Z8GuNG91KsnTfzj9dYJqdE9qQOUsAUTuS3FQJYOnjqde74 HICTaGo+Zb/7YhRBNfWX3Llz83eOA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc :x-sasl-enc; s=fm1; bh=gDjdg6xsIZJryOqOmjnuA0YFekuLnoK3e1Nux5e4q VA=; b=KQkJCg6MlVYxYpEFgRAcQ+rw0tsGC3Wk2h4re7yyUACg12zaqYr5/h27Q Ya6da6Kd3TSTzH0NW8Rq+t+p4bGHF+w+Qjc+1nvoqk5iQuvpW8AkCbBEMIyL/CNz 05fjYknfvm6BLRFIFRFkRoG9EJdhxL5T9hj0IL5hD0ab/gio/3P488ABiDh+f7hy lHcf5TJmHvERqIvvEAtFJTvLcBLrKjKnENlSm5HvaL+9MJIEtudHcG20yR91xWNX 1e1KxvD8jqFyABwdRGbQDBazkUx74ziL+Z1JfTGTrbNpgo4oBQ9MSYhLM9xv+515 3CQvLtSj7cJUDI+CE6yFgWh5bzIhQ== X-ME-Sender: X-Sasl-enc: t7B0JSPxQlI9O6UsgFkzTEDgfZKbizlACXnVM1GqvjN8 1493231077 Received: from m.localhost.localhost (unknown [213.55.211.100]) by mail.messagingengine.com (Postfix) with ESMTPA id AD7057E0A4; Wed, 26 Apr 2017 14:24:36 -0400 (EDT) From: Hannes Frederic Sowa To: netdev@vger.kernel.org Cc: ast@kernel.org, daniel@iogearbox.com, jbenc@redhat.com, aconole@bytheb.org Subject: [PATCH net-next 2/6] bpf: rename bpf_kallsyms to bpf_progs, ksym_lnode to bpf_progs_head Date: Wed, 26 Apr 2017 20:24:15 +0200 Message-Id: <20170426182419.14574-3-hannes@stressinduktion.org> X-Mailer: git-send-email 2.9.3 In-Reply-To: <20170426182419.14574-1-hannes@stressinduktion.org> References: <20170426182419.14574-1-hannes@stressinduktion.org> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org We will soon put all bpf programs on this list, thus use apropriate names. Signed-off-by: Hannes Frederic Sowa --- include/linux/bpf.h | 2 +- kernel/bpf/core.c | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/linux/bpf.h b/include/linux/bpf.h index 6bb38d76faf42a..0fbf6a76555cc9 100644 --- a/include/linux/bpf.h +++ b/include/linux/bpf.h @@ -172,7 +172,7 @@ struct bpf_prog_aux { u32 used_map_cnt; u32 max_ctx_offset; struct latch_tree_node ksym_tnode; - struct list_head ksym_lnode; + struct list_head bpf_progs_head; const struct bpf_verifier_ops *ops; struct bpf_map **used_maps; struct bpf_prog *prog; diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c index 6f81e0f5a0faa2..043f634ff58d87 100644 --- a/kernel/bpf/core.c +++ b/kernel/bpf/core.c @@ -98,7 +98,7 @@ struct bpf_prog *bpf_prog_alloc(unsigned int size, gfp_t gfp_extra_flags) fp->aux = aux; fp->aux->prog = fp; - INIT_LIST_HEAD_RCU(&fp->aux->ksym_lnode); + INIT_LIST_HEAD_RCU(&fp->aux->bpf_progs_head); return fp; } @@ -360,25 +360,25 @@ static const struct latch_tree_ops bpf_tree_ops = { }; static DEFINE_SPINLOCK(bpf_lock); -static LIST_HEAD(bpf_kallsyms); +static LIST_HEAD(bpf_progs); static struct latch_tree_root bpf_tree __cacheline_aligned; int bpf_jit_kallsyms __read_mostly; static void bpf_prog_ksym_node_add(struct bpf_prog_aux *aux) { - WARN_ON_ONCE(!list_empty(&aux->ksym_lnode)); - list_add_tail_rcu(&aux->ksym_lnode, &bpf_kallsyms); + WARN_ON_ONCE(!list_empty(&aux->bpf_progs_head)); + list_add_tail_rcu(&aux->bpf_progs_head, &bpf_progs); latch_tree_insert(&aux->ksym_tnode, &bpf_tree, &bpf_tree_ops); } static void bpf_prog_ksym_node_del(struct bpf_prog_aux *aux) { - if (list_empty(&aux->ksym_lnode)) + if (list_empty(&aux->bpf_progs_head)) return; latch_tree_erase(&aux->ksym_tnode, &bpf_tree, &bpf_tree_ops); - list_del_rcu(&aux->ksym_lnode); + list_del_rcu(&aux->bpf_progs_head); } static bool bpf_prog_kallsyms_candidate(const struct bpf_prog *fp) @@ -388,8 +388,8 @@ static bool bpf_prog_kallsyms_candidate(const struct bpf_prog *fp) static bool bpf_prog_kallsyms_verify_off(const struct bpf_prog *fp) { - return list_empty(&fp->aux->ksym_lnode) || - fp->aux->ksym_lnode.prev == LIST_POISON2; + return list_empty(&fp->aux->bpf_progs_head) || + fp->aux->bpf_progs_head.prev == LIST_POISON2; } void bpf_prog_kallsyms_add(struct bpf_prog *fp) @@ -473,7 +473,7 @@ int bpf_get_kallsym(unsigned int symnum, unsigned long *value, char *type, return ret; rcu_read_lock(); - list_for_each_entry_rcu(aux, &bpf_kallsyms, ksym_lnode) { + list_for_each_entry_rcu(aux, &bpf_progs, bpf_progs_head) { if (it++ != symnum) continue;