BPF List
 help / color / mirror / Atom feed
From: Cong Wang <xiyou.wangcong@gmail.com>
To: netdev@vger.kernel.org
Cc: bpf@vger.kernel.org, Cong Wang <cong.wang@bytedance.com>
Subject: [RFC Patch v5 2/5] bpf: move map in map declarations to bpf.h
Date: Wed,  1 Jun 2022 21:10:25 -0700	[thread overview]
Message-ID: <20220602041028.95124-3-xiyou.wangcong@gmail.com> (raw)
In-Reply-To: <20220602041028.95124-1-xiyou.wangcong@gmail.com>

From: Cong Wang <cong.wang@bytedance.com>

Signed-off-by: Cong Wang <cong.wang@bytedance.com>
---
 include/linux/bpf.h     |  6 ++++++
 kernel/bpf/arraymap.c   |  2 --
 kernel/bpf/hashtab.c    |  1 -
 kernel/bpf/map_in_map.c |  2 --
 kernel/bpf/map_in_map.h | 19 -------------------
 5 files changed, 6 insertions(+), 24 deletions(-)
 delete mode 100644 kernel/bpf/map_in_map.h

diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 8e6092d0ea95..cf04ddce2c2d 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -341,6 +341,12 @@ int map_check_no_btf(const struct bpf_map *map,
 
 bool bpf_map_meta_equal(const struct bpf_map *meta0,
 			const struct bpf_map *meta1);
+struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd);
+void bpf_map_meta_free(struct bpf_map *map_meta);
+void *bpf_map_fd_get_ptr(struct bpf_map *map, struct file *map_file,
+			 int ufd);
+void bpf_map_fd_put_ptr(void *ptr);
+u32 bpf_map_fd_sys_lookup_elem(void *ptr);
 
 extern const struct bpf_map_ops bpf_map_offload_ops;
 
diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c
index fe40d3b9458f..65ba21e4b707 100644
--- a/kernel/bpf/arraymap.c
+++ b/kernel/bpf/arraymap.c
@@ -13,8 +13,6 @@
 #include <linux/rcupdate_trace.h>
 #include <linux/btf_ids.h>
 
-#include "map_in_map.h"
-
 #define ARRAY_CREATE_FLAG_MASK \
 	(BPF_F_NUMA_NODE | BPF_F_MMAPABLE | BPF_F_ACCESS_MASK | \
 	 BPF_F_PRESERVE_ELEMS | BPF_F_INNER_MAP)
diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c
index 17fb69c0e0dc..f0a2464c1669 100644
--- a/kernel/bpf/hashtab.c
+++ b/kernel/bpf/hashtab.c
@@ -13,7 +13,6 @@
 #include <linux/btf_ids.h>
 #include "percpu_freelist.h"
 #include "bpf_lru_list.h"
-#include "map_in_map.h"
 
 #define HTAB_CREATE_FLAG_MASK						\
 	(BPF_F_NO_PREALLOC | BPF_F_NO_COMMON_LRU | BPF_F_NUMA_NODE |	\
diff --git a/kernel/bpf/map_in_map.c b/kernel/bpf/map_in_map.c
index 135205d0d560..8a537f6b2abd 100644
--- a/kernel/bpf/map_in_map.c
+++ b/kernel/bpf/map_in_map.c
@@ -5,8 +5,6 @@
 #include <linux/bpf.h>
 #include <linux/btf.h>
 
-#include "map_in_map.h"
-
 struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd)
 {
 	struct bpf_map *inner_map, *inner_map_meta;
diff --git a/kernel/bpf/map_in_map.h b/kernel/bpf/map_in_map.h
deleted file mode 100644
index bcb7534afb3c..000000000000
--- a/kernel/bpf/map_in_map.h
+++ /dev/null
@@ -1,19 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/* Copyright (c) 2017 Facebook
- */
-#ifndef __MAP_IN_MAP_H__
-#define __MAP_IN_MAP_H__
-
-#include <linux/types.h>
-
-struct file;
-struct bpf_map;
-
-struct bpf_map *bpf_map_meta_alloc(int inner_map_ufd);
-void bpf_map_meta_free(struct bpf_map *map_meta);
-void *bpf_map_fd_get_ptr(struct bpf_map *map, struct file *map_file,
-			 int ufd);
-void bpf_map_fd_put_ptr(void *ptr);
-u32 bpf_map_fd_sys_lookup_elem(void *ptr);
-
-#endif
-- 
2.34.1


  parent reply	other threads:[~2022-06-02  4:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02  4:10 [RFC Patch v5 0/5] net_sched: introduce eBPF based Qdisc Cong Wang
2022-06-02  4:10 ` [RFC Patch v5 1/5] net: introduce skb_rbtree_walk_safe() Cong Wang
2022-06-02  4:10 ` Cong Wang [this message]
2022-06-02  4:10 ` [RFC Patch v5 3/5] bpf: introduce skb map and flow map Cong Wang
2022-06-02  4:10 ` [RFC Patch v5 4/5] net_sched: introduce eBPF based Qdisc Cong Wang
2022-06-03 23:14   ` Cong Wang
2022-06-02  4:10 ` [RFC Patch v5 5/5] net_sched: introduce helper bpf_skb_tc_classify() Cong Wang
2022-06-24 16:52 ` [RFC Patch v5 0/5] net_sched: introduce eBPF based Qdisc Toke Høiland-Jørgensen
2022-06-24 17:35   ` Dave Taht
2022-06-24 20:51 ` sdf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220602041028.95124-3-xiyou.wangcong@gmail.com \
    --to=xiyou.wangcong@gmail.com \
    --cc=bpf@vger.kernel.org \
    --cc=cong.wang@bytedance.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox