Skip to contentSkip to conversation

Add tc(8) userspace support for SKB Priority qdisc

PATCH New Nishanth Devarajan 1 participant 1 message Jul 28, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add tc(8) userspace support for SKB Priority qdisc

sch_skbprio is a qdisc that prioritizes packets according to their skb->priority field. Under congestion, it drops already-enqueued lower priority packets to make space available for higher priority packets. Skbprio was conceived as a solution for denial-of-service defenses that need to route packets with different priorities as a means to overcome DoS attacks.

---
 include/uapi/linux/pkt_sched.h |  7 ++++
 man/man8/tc-skbprio.8          | 70 ++++++++++++++++++++++++++++++++++++
 tc/Makefile                    |  1 +
 tc/q_skbprio.c                 | 81 ++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 159 insertions(+)
 create mode 100644 man/man8/tc-skbprio.8
 create mode 100644 tc/q_skbprio.c
include/uapi/linux/pkt_sched.h +7 -0
index 37b5096..81af99e 100644
@@ -124,6 +124,12 @@ struct tc_fifo_qopt {
 	__u32	limit;	/* Queue length: bytes for bfifo, packets for pfifo */
 };
 
+/* SKBPRIO section */
+
+struct tc_skbprio_qopt {
+	__u32	limit;		/* Queue length in packets. */
+};
+
 /* PRIO section */
 
 #define TCQ_PRIO_BANDS	16
@@ -256,6 +262,7 @@ struct tc_red_qopt {
 #define TC_RED_ECN		1
 #define TC_RED_HARDDROP		2
 #define TC_RED_ADAPTATIVE	4
+#define TC_RED_OFFLOADED	8
 };
 
 struct tc_red_xstats {
man/man8/tc-skbprio.8 new file +70 -0

70 lines not on this page · raw message

tc/Makefile +1 -0
index dfd0026..7646105 100644
@@ -71,6 +71,7 @@ TCMODULES += q_clsact.o
 TCMODULES += e_bpf.o
 TCMODULES += f_matchall.o
 TCMODULES += q_cbs.o
+TCMODULES += q_skbprio.o
 
 TCSO :=
 ifeq ($(TC_CONFIG_ATM),y)
tc/q_skbprio.c new file +81 -0

81 lines not on this page · raw message

Signature · 1 line
1.9.1