Skip to contentSkip to conversation

update headers with CBS API [RFC]

RFC New Vinicius Costa Gomes 1 participant 2 messages Sep 1, 2017

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

RFC 1/2 update headers with CBS API [RFC]

---
 include/linux/pkt_sched.h | 29 +++++++++++++++++++++++++++++
 1 file changed, 29 insertions(+)
include/linux/pkt_sched.h +29 -0
index 099bf552..ba6c9a54 100644
@@ -871,4 +871,33 @@ struct tc_pie_xstats {
 	__u32 maxq;             /* maximum queue size */
 	__u32 ecn_mark;         /* packets marked with ecn*/
 };
+
+/* CBS */
+/* FIXME: this is only for usage with ndo_setup_tc(), this should be
+ * in another header someplace else. Is pkt_cls.h the right place?
+ */
+struct tc_cbs_qopt_offload {
+	__u8		enable;
+	__s32		queue;
+	__s32		hicredit;
+	__s32		locredit;
+	__s32		idleslope;
+	__s32		sendslope;
+};
+
+struct tc_cbs_qopt {
+	__s32		hicredit;
+	__s32		locredit;
+	__s32		idleslope;
+	__s32		sendslope;
+};
+
+enum {
+	TCA_CBS_UNSPEC,
+	TCA_CBS_PARMS,
+	__TCA_CBS_MAX,
+};
+
+#define TCA_CBS_MAX (__TCA_CBS_MAX - 1)
+
 #endif
Signature · 1 line
2.14.1
#1 lore raw

RFC 2/2 tc: Add support for the CBS qdisc

The Credit Based Shaper (CBS) queueing discipline allows bandwidth reservation with sub-milisecond precision. It is defined by the 802.1Q-2014 specification (section 8.6.8.2 and Annex L).

The syntax is:

tc qdisc add dev DEV parent NODE cbs locredit <LOCREDIT> hicredit <HICREDIT> sendslope <SENDSLOPE> idleslope <IDLESLOPE>

---
 tc/Makefile |   1 +
 tc/q_cbs.c  | 134 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 135 insertions(+)
 create mode 100644 tc/q_cbs.c
tc/Makefile +1 -0
index a9b4b8e6..f0091217 100644
@@ -73,6 +73,7 @@ TCMODULES += q_hhf.o
 TCMODULES += q_clsact.o
 TCMODULES += e_bpf.o
 TCMODULES += f_matchall.o
+TCMODULES += q_cbs.o
 
 TCSO :=
 ifeq ($(TC_CONFIG_ATM),y)
tc/q_cbs.c new file +134 -0

134 lines not on this page · raw message

Signature · 1 line
2.14.1