From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: netdev@vger.kernel.org
Cc: alexei.starovoitov@gmail.com, daniel@iogearbox.net,
Jakub Kicinski <jakub.kicinski@netronome.com>
Subject: [PATCH net 09/10] bpf: revert report offload info to user space
Date: Sun, 19 Nov 2017 20:55:21 -0800 [thread overview]
Message-ID: <20171120045522.2188-10-jakub.kicinski@netronome.com> (raw)
In-Reply-To: <20171120045522.2188-1-jakub.kicinski@netronome.com>
This reverts commit bd601b6ada11 ("bpf: report offload info to user
space"). The ifindex by itself is not sufficient, we should provide
information on which network namespace this ifindex belongs to.
After considering some options we concluded that it's best to just
remove this API for now, and rework it in -next.
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
---
include/linux/bpf.h | 1 -
include/uapi/linux/bpf.h | 6 ------
kernel/bpf/offload.c | 12 ------------
kernel/bpf/syscall.c | 5 -----
4 files changed, 24 deletions(-)
diff --git a/include/linux/bpf.h b/include/linux/bpf.h
index 37bbab8c0f56..76c577281d78 100644
--- a/include/linux/bpf.h
+++ b/include/linux/bpf.h
@@ -515,7 +515,6 @@ static inline struct bpf_prog *bpf_prog_get_type(u32 ufd,
int bpf_prog_offload_compile(struct bpf_prog *prog);
void bpf_prog_offload_destroy(struct bpf_prog *prog);
-u32 bpf_prog_offload_ifindex(struct bpf_prog *prog);
#if defined(CONFIG_NET) && defined(CONFIG_BPF_SYSCALL)
int bpf_prog_offload_init(struct bpf_prog *prog, union bpf_attr *attr);
diff --git a/include/uapi/linux/bpf.h b/include/uapi/linux/bpf.h
index 3f626df42516..4c223ab30293 100644
--- a/include/uapi/linux/bpf.h
+++ b/include/uapi/linux/bpf.h
@@ -897,10 +897,6 @@ enum sk_action {
#define BPF_TAG_SIZE 8
-enum bpf_prog_status {
- BPF_PROG_STATUS_DEV_BOUND = (1 << 0),
-};
-
struct bpf_prog_info {
__u32 type;
__u32 id;
@@ -914,8 +910,6 @@ struct bpf_prog_info {
__u32 nr_map_ids;
__aligned_u64 map_ids;
char name[BPF_OBJ_NAME_LEN];
- __u32 ifindex;
- __u32 status;
} __attribute__((aligned(8)));
struct bpf_map_info {
diff --git a/kernel/bpf/offload.c b/kernel/bpf/offload.c
index d4267c674fec..68ec884440b7 100644
--- a/kernel/bpf/offload.c
+++ b/kernel/bpf/offload.c
@@ -149,18 +149,6 @@ int bpf_prog_offload_compile(struct bpf_prog *prog)
return bpf_prog_offload_translate(prog);
}
-u32 bpf_prog_offload_ifindex(struct bpf_prog *prog)
-{
- struct bpf_dev_offload *offload = prog->aux->offload;
- u32 ifindex;
-
- rtnl_lock();
- ifindex = offload->netdev ? offload->netdev->ifindex : 0;
- rtnl_unlock();
-
- return ifindex;
-}
-
const struct bpf_prog_ops bpf_offload_prog_ops = {
};
diff --git a/kernel/bpf/syscall.c b/kernel/bpf/syscall.c
index 41509cf825d8..2c4cfeaa8d5e 100644
--- a/kernel/bpf/syscall.c
+++ b/kernel/bpf/syscall.c
@@ -1616,11 +1616,6 @@ static int bpf_prog_get_info_by_fd(struct bpf_prog *prog,
return -EFAULT;
}
- if (bpf_prog_is_dev_bound(prog->aux)) {
- info.status |= BPF_PROG_STATUS_DEV_BOUND;
- info.ifindex = bpf_prog_offload_ifindex(prog);
- }
-
done:
if (copy_to_user(uinfo, &info, info_len) ||
put_user(info_len, &uattr->info.info_len))
--
2.14.1
next prev parent reply other threads:[~2017-11-20 4:56 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-20 4:55 [PATCH net 00/10] bpf: offload: check netdev pointer in the drivers and namespace trouble Jakub Kicinski
2017-11-20 4:55 ` [PATCH net 01/10] bpf: offload: add comment warning developers about double destroy Jakub Kicinski
2017-11-20 4:55 ` [PATCH net 02/10] bpf: offload: limit offload to cls_bpf and xdp programs only Jakub Kicinski
2017-11-20 4:55 ` [PATCH net 03/10] bpf: offload: rename the ifindex field Jakub Kicinski
2017-11-20 4:55 ` [PATCH net 04/10] bpf: offload: move offload device validation out to the drivers Jakub Kicinski
2017-11-20 7:11 ` Jiri Pirko
2017-11-20 4:55 ` [PATCH net 05/10] net: xdp: don't allow device-bound programs in driver mode Jakub Kicinski
2017-11-20 14:36 ` David Ahern
2017-11-20 22:02 ` Jakub Kicinski
2017-11-20 22:21 ` Daniel Borkmann
2017-11-20 4:55 ` [PATCH net 06/10] bpf: turn bpf_prog_get_type() into a wrapper Jakub Kicinski
2017-11-20 4:55 ` [PATCH net 07/10] bpf: offload: ignore namespace moves Jakub Kicinski
2017-11-20 4:55 ` [PATCH net 08/10] bpftool: revert printing program device bound info Jakub Kicinski
2017-11-20 4:55 ` Jakub Kicinski [this message]
2017-11-20 4:55 ` [PATCH net 10/10] bpf: make bpf_prog_offload_verifier_prep() static inline Jakub Kicinski
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=20171120045522.2188-10-jakub.kicinski@netronome.com \
--to=jakub.kicinski@netronome.com \
--cc=alexei.starovoitov@gmail.com \
--cc=daniel@iogearbox.net \
--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;
as well as URLs for NNTP newsgroup(s).