Skip to contentSkip to conversation

tc_core: add size table

PATCH Superseded Jussi Kivilinna 1 participant 2 messages Jul 3, 2008

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 1/2 tc_core: add size table

Patch adds size table that is similiar to rate table, with difference that size table stores link layer packet size. It's needed for HFSC link layer adaption patch as it converts skb->len to link layer packet size directly, unlike HTB/CFQ/etc that convert packet length to link layer transfer time using rate tables.

---

 include/linux/pkt_sched.h |   10 ++++++
 tc/tc_core.c              |   70 +++++++++++++++++++++++++++++++++++----------
 tc/tc_core.h              |    2 +
 3 files changed, 67 insertions(+), 15 deletions(-)
include/linux/pkt_sched.h +10 -0
index dbb7ac3..5bf1444 100644
@@ -85,6 +85,16 @@ struct tc_ratespec
 
 #define TC_RTAB_SIZE	1024
 
+struct tc_sizespec {
+	unsigned char	cell_log;
+	unsigned char	size_log;
+	short		overhead;
+	short		cell_align;
+	unsigned short	mpu;
+};
+
+#define TC_STAB_SIZE	1024
+
 /* FIFO section */
 
 struct tc_fifo_qopt
tc/tc_core.c +55 -15

94 lines not on this page · raw message

tc/tc_core.h +2 -0
index 9f835e8..97a4894 100644
@@ -21,6 +21,8 @@ unsigned tc_calc_xmittime(unsigned rate, unsigned size);
 unsigned tc_calc_xmitsize(unsigned rate, unsigned ticks);
 int tc_calc_rtable(struct tc_ratespec *r, __u32 *rtab,
 		   int cell_log, unsigned mtu, enum link_layer link_layer);
+int tc_calc_stable(struct tc_sizespec *r, __u16 *stab,
+		   int cell_log, unsigned mtu, enum link_layer link_layer);
 
 int tc_setup_estimator(unsigned A, unsigned time_const, struct tc_estimator *est);
 
#1 lore raw

PATCH v3 2/2 hfsc: add link layer overhead adaption

Patch adds 'mpu', 'mtu', 'overhead' and 'linklayer' options to hfsc. These options are used to create size table for sch_hfsc. Size table is only used and passed to kernel if these options are used.

---

 include/linux/pkt_sched.h |    2 +
 tc/q_hfsc.c               |   72 ++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 73 insertions(+), 1 deletions(-)
include/linux/pkt_sched.h +2 -0
index 5bf1444..6a2cbc4 100644
@@ -326,6 +326,8 @@ enum
 	TCA_HFSC_RSC,
 	TCA_HFSC_FSC,
 	TCA_HFSC_USC,
+	TCA_HFSC_SZOPTS,
+	TCA_HFSC_STAB,
 	__TCA_HFSC_MAX,
 };
 
tc/q_hfsc.c +71 -1

121 lines not on this page · raw message