Skip to content
Permalink
Browse files
sch_bpf: draft
Signed-off-by: Cong Wang <cong.wang@bytedance.com>
  • Loading branch information
congwang authored and Cong Wang committed Aug 12, 2021
1 parent 3e85c8d commit aa61f170d88b706060a1977b7b7bef9d08e33ff1
Show file tree
Hide file tree
Showing 5 changed files with 551 additions and 0 deletions.
@@ -36,6 +36,7 @@
#include <linux/splice.h>
#include <linux/in6.h>
#include <linux/if_packet.h>
#include <linux/priority_queue.h>
#include <net/flow.h>
#include <net/page_pool.h>
#if IS_ENABLED(CONFIG_NF_CONNTRACK)
@@ -735,6 +736,7 @@ struct sk_buff {
};
};
struct rb_node rbnode; /* used in netem, ip4 defrag, and tcp stack */
struct pq_node pqnode; /* used in ebpf qdisc */
struct list_head list;
};

@@ -1263,4 +1263,17 @@ enum {

#define TCA_ETS_MAX (__TCA_ETS_MAX - 1)

enum {
TCA_SCH_BPF_UNSPEC,
TCA_SCH_BPF_ENQUEUE_PROG_NAME, /* string */
TCA_SCH_BPF_ENQUEUE_PROG_ID, /* u32 */
TCA_SCH_BPF_ENQUEUE_PROG_TAG, /* data */
TCA_SCH_BPF_DEQUEUE_PROG_NAME, /* string */
TCA_SCH_BPF_DEQUEUE_PROG_ID, /* u32 */
TCA_SCH_BPF_DEQUEUE_PROG_TAG, /* data */
__TCA_SCH_BPF_MAX,
};

#define TCA_SCH_BPF_MAX (__TCA_SCH_BPF_MAX - 1)

#endif
@@ -439,6 +439,21 @@ config NET_SCH_ETS

If unsure, say N.

config NET_SCH_BPF
tristate "eBPF based programmable queue discipline"
help
This eBPF based queue discipline offers a way to program your
own packet scheduling algorithm. This is a classful qdisc which
also allows you to decide the hierachy.

Say Y here if you want to use the eBPF based programmable queue
discipline.

To compile this driver as a module, choose M here: the module
will be called sch_bpf.

If unsure, say N.

menuconfig NET_SCH_DEFAULT
bool "Allow override default queue discipline"
help
@@ -65,6 +65,7 @@ obj-$(CONFIG_NET_SCH_FQ_PIE) += sch_fq_pie.o
obj-$(CONFIG_NET_SCH_CBS) += sch_cbs.o
obj-$(CONFIG_NET_SCH_ETF) += sch_etf.o
obj-$(CONFIG_NET_SCH_TAPRIO) += sch_taprio.o
obj-$(CONFIG_NET_SCH_BPF) += sch_bpf.o

obj-$(CONFIG_NET_CLS_U32) += cls_u32.o
obj-$(CONFIG_NET_CLS_ROUTE4) += cls_route.o

0 comments on commit aa61f17

Please sign in to comment.