Commit 55556dd5 authored by Daniel Borkmann's avatar Daniel Borkmann Committed by David S. Miller

bpf: drop useless bpf_fd member from cls/act

After setup we don't need to keep user space fd number around anymore, as
it also has no useful meaning for anyone, just remove it.
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Acked-by: default avatarAlexei Starovoitov <ast@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 88575199
...@@ -28,7 +28,6 @@ struct tcf_bpf_cfg { ...@@ -28,7 +28,6 @@ struct tcf_bpf_cfg {
struct bpf_prog *filter; struct bpf_prog *filter;
struct sock_filter *bpf_ops; struct sock_filter *bpf_ops;
const char *bpf_name; const char *bpf_name;
u32 bpf_fd;
u16 bpf_num_ops; u16 bpf_num_ops;
bool is_ebpf; bool is_ebpf;
}; };
...@@ -118,9 +117,6 @@ static int tcf_bpf_dump_bpf_info(const struct tcf_bpf *prog, ...@@ -118,9 +117,6 @@ static int tcf_bpf_dump_bpf_info(const struct tcf_bpf *prog,
static int tcf_bpf_dump_ebpf_info(const struct tcf_bpf *prog, static int tcf_bpf_dump_ebpf_info(const struct tcf_bpf *prog,
struct sk_buff *skb) struct sk_buff *skb)
{ {
if (nla_put_u32(skb, TCA_ACT_BPF_FD, prog->bpf_fd))
return -EMSGSIZE;
if (prog->bpf_name && if (prog->bpf_name &&
nla_put_string(skb, TCA_ACT_BPF_NAME, prog->bpf_name)) nla_put_string(skb, TCA_ACT_BPF_NAME, prog->bpf_name))
return -EMSGSIZE; return -EMSGSIZE;
...@@ -233,7 +229,6 @@ static int tcf_bpf_init_from_efd(struct nlattr **tb, struct tcf_bpf_cfg *cfg) ...@@ -233,7 +229,6 @@ static int tcf_bpf_init_from_efd(struct nlattr **tb, struct tcf_bpf_cfg *cfg)
} }
} }
cfg->bpf_fd = bpf_fd;
cfg->bpf_name = name; cfg->bpf_name = name;
cfg->filter = fp; cfg->filter = fp;
cfg->is_ebpf = true; cfg->is_ebpf = true;
...@@ -332,8 +327,6 @@ static int tcf_bpf_init(struct net *net, struct nlattr *nla, ...@@ -332,8 +327,6 @@ static int tcf_bpf_init(struct net *net, struct nlattr *nla,
if (cfg.bpf_num_ops) if (cfg.bpf_num_ops)
prog->bpf_num_ops = cfg.bpf_num_ops; prog->bpf_num_ops = cfg.bpf_num_ops;
if (cfg.bpf_fd)
prog->bpf_fd = cfg.bpf_fd;
prog->tcf_action = parm->action; prog->tcf_action = parm->action;
rcu_assign_pointer(prog->filter, cfg.filter); rcu_assign_pointer(prog->filter, cfg.filter);
......
...@@ -45,10 +45,7 @@ struct cls_bpf_prog { ...@@ -45,10 +45,7 @@ struct cls_bpf_prog {
u32 gen_flags; u32 gen_flags;
struct tcf_exts exts; struct tcf_exts exts;
u32 handle; u32 handle;
union {
u32 bpf_fd;
u16 bpf_num_ops; u16 bpf_num_ops;
};
struct sock_filter *bpf_ops; struct sock_filter *bpf_ops;
const char *bpf_name; const char *bpf_name;
struct tcf_proto *tp; struct tcf_proto *tp;
...@@ -377,7 +374,6 @@ static int cls_bpf_prog_from_efd(struct nlattr **tb, struct cls_bpf_prog *prog, ...@@ -377,7 +374,6 @@ static int cls_bpf_prog_from_efd(struct nlattr **tb, struct cls_bpf_prog *prog,
} }
prog->bpf_ops = NULL; prog->bpf_ops = NULL;
prog->bpf_fd = bpf_fd;
prog->bpf_name = name; prog->bpf_name = name;
prog->filter = fp; prog->filter = fp;
...@@ -561,9 +557,6 @@ static int cls_bpf_dump_bpf_info(const struct cls_bpf_prog *prog, ...@@ -561,9 +557,6 @@ static int cls_bpf_dump_bpf_info(const struct cls_bpf_prog *prog,
static int cls_bpf_dump_ebpf_info(const struct cls_bpf_prog *prog, static int cls_bpf_dump_ebpf_info(const struct cls_bpf_prog *prog,
struct sk_buff *skb) struct sk_buff *skb)
{ {
if (nla_put_u32(skb, TCA_BPF_FD, prog->bpf_fd))
return -EMSGSIZE;
if (prog->bpf_name && if (prog->bpf_name &&
nla_put_string(skb, TCA_BPF_NAME, prog->bpf_name)) nla_put_string(skb, TCA_BPF_NAME, prog->bpf_name))
return -EMSGSIZE; return -EMSGSIZE;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment