Skip to contentSkip to conversation

tc_core: add size table

PATCH New Jussi Kivilinna 1 participant 2 messages Jul 10, 2008

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

PATCH v4 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 v4 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 |    5 +
 tc/q_hfsc.c               |  155 ++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 155 insertions(+), 5 deletions(-)
include/linux/pkt_sched.h +5 -0
index 5bf1444..46db55d 100644
@@ -303,6 +303,9 @@ struct tc_htb_xstats
 struct tc_hfsc_qopt
 {
 	__u16	defcls;		/* default class */
+	__u16	__reserved;
+	struct tc_sizespec szopts;
+	__u16	stab[512];
 };
 
 struct tc_service_curve
@@ -326,6 +329,8 @@ enum
 	TCA_HFSC_RSC,
 	TCA_HFSC_FSC,
 	TCA_HFSC_USC,
+	TCA_HFSC_SZOPTS,
+	TCA_HFSC_STAB,
 	__TCA_HFSC_MAX,
 };
 
tc/q_hfsc.c +150 -5

256 lines not on this page · raw message