Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6877fcf authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'ebpf-next'



Daniel Borkmann says:

====================
This set adds native eBPF support also to act_bpf and thus covers tc
with eBPF in the classifier *and* action part.

A link to iproute2 preview has been provided in patch 2 and the code
will be pushed out after Stephen has processed the classifier part
and helper bits for tc.

This set depends on ced585c8 ("act_bpf: allow non-default TC_ACT
opcodes as BPF exec outcome"), so a net into net-next merge would be
required first. Hope that's fine by you, Dave. ;)
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 0fa74a4b a8cb5f55
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -16,9 +16,13 @@
struct tcf_bpf {
struct tcf_bpf {
	struct tcf_common	common;
	struct tcf_common	common;
	struct bpf_prog		*filter;
	struct bpf_prog		*filter;
	struct sock_filter	*bpf_ops;
	union {
		u32		bpf_fd;
		u16		bpf_num_ops;
		u16		bpf_num_ops;
	};
	};
	struct sock_filter	*bpf_ops;
	const char		*bpf_name;
};
#define to_bpf(a) \
#define to_bpf(a) \
	container_of(a->priv, struct tcf_bpf, common)
	container_of(a->priv, struct tcf_bpf, common)


+1 −0
Original line number Original line Diff line number Diff line
@@ -119,6 +119,7 @@ enum bpf_prog_type {
	BPF_PROG_TYPE_UNSPEC,
	BPF_PROG_TYPE_UNSPEC,
	BPF_PROG_TYPE_SOCKET_FILTER,
	BPF_PROG_TYPE_SOCKET_FILTER,
	BPF_PROG_TYPE_SCHED_CLS,
	BPF_PROG_TYPE_SCHED_CLS,
	BPF_PROG_TYPE_SCHED_ACT,
};
};


#define BPF_PSEUDO_MAP_FD	1
#define BPF_PSEUDO_MAP_FD	1
+2 −0
Original line number Original line Diff line number Diff line
@@ -24,6 +24,8 @@ enum {
	TCA_ACT_BPF_PARMS,
	TCA_ACT_BPF_PARMS,
	TCA_ACT_BPF_OPS_LEN,
	TCA_ACT_BPF_OPS_LEN,
	TCA_ACT_BPF_OPS,
	TCA_ACT_BPF_OPS,
	TCA_ACT_BPF_FD,
	TCA_ACT_BPF_NAME,
	__TCA_ACT_BPF_MAX,
	__TCA_ACT_BPF_MAX,
};
};
#define TCA_ACT_BPF_MAX (__TCA_ACT_BPF_MAX - 1)
#define TCA_ACT_BPF_MAX (__TCA_ACT_BPF_MAX - 1)
+1 −0
Original line number Original line Diff line number Diff line
@@ -1180,6 +1180,7 @@ static bool may_access_skb(enum bpf_prog_type type)
	switch (type) {
	switch (type) {
	case BPF_PROG_TYPE_SOCKET_FILTER:
	case BPF_PROG_TYPE_SOCKET_FILTER:
	case BPF_PROG_TYPE_SCHED_CLS:
	case BPF_PROG_TYPE_SCHED_CLS:
	case BPF_PROG_TYPE_SCHED_ACT:
		return true;
		return true;
	default:
	default:
		return false;
		return false;
+6 −0
Original line number Original line Diff line number Diff line
@@ -1263,10 +1263,16 @@ static struct bpf_prog_type_list sched_cls_type __read_mostly = {
	.type = BPF_PROG_TYPE_SCHED_CLS,
	.type = BPF_PROG_TYPE_SCHED_CLS,
};
};


static struct bpf_prog_type_list sched_act_type __read_mostly = {
	.ops = &sk_filter_ops,
	.type = BPF_PROG_TYPE_SCHED_ACT,
};

static int __init register_sk_filter_ops(void)
static int __init register_sk_filter_ops(void)
{
{
	bpf_register_prog_type(&sk_filter_type);
	bpf_register_prog_type(&sk_filter_type);
	bpf_register_prog_type(&sched_cls_type);
	bpf_register_prog_type(&sched_cls_type);
	bpf_register_prog_type(&sched_act_type);


	return 0;
	return 0;
}
}
Loading