Skip to contentSkip to conversation

tc_core: add size table

PATCH Superseded Jussi Kivilinna 3 participants 7 messages Jun 24, 2008 – Jun 26, 2008

Subsystems (2)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 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              |   73 ++++++++++++++++++++++++++++++++++++---------
 tc/tc_core.h              |    2 +
 3 files changed, 70 insertions(+), 15 deletions(-)
include/linux/pkt_sched.h +10 -0
index dbb7ac3..b8366fb 100644
@@ -85,6 +85,16 @@ struct tc_ratespec
 
 #define TC_RTAB_SIZE	1024
 
+struct tc_sizespec {
+	unsigned char	cell_log;
+	unsigned char	size_log;
+	unsigned short	overhead;
+	short		cell_align;
+	unsigned short	mpu;
+};
+
+#define TC_STAB_SIZE	1024
+
 /* FIFO section */
 
 struct tc_fifo_qopt
tc/tc_core.c +58 -15

91 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 v2 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               |   71 ++++++++++++++++++++++++++++++++++++++++++++-
 2 files changed, 72 insertions(+), 1 deletions(-)
include/linux/pkt_sched.h +2 -0
index b8366fb..43c11f2 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 +70 -1

120 lines not on this page · raw message

#2 lore raw

Re: [PATCH v2 2/2] [iproute2/tc] hfsc: add link layer overhead adaption

tc/q_hfsc.c hfsc_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, · line 160

Quoted 5 lines · Jussi Kivilinna

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.

tc/q_hfsc.c +1 -0
+	unsigned short overhead = 0, mpu = 0;

overhead may need to be negative because skb->len on eth is payload + 14

Andy.

#3 lore raw

Re: [PATCH v2 2/2] [iproute2/tc] hfsc: add link layer overhead adaption

Quoting Andy Furniss <[email protected]>:

Quoted 10 lines

tc/q_hfsc.c hfsc_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, · line 160

Quoted 5 lines · Jussi Kivilinna

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.

tc/q_hfsc.c +1 -0
+	unsigned short overhead = 0, mpu = 0;

overhead may need to be negative because skb->len on eth is payload + 14

Andy.

Ok, I made size tables use signed short for overhead instead. But this makes me think should htb/cfq/tfb be changed to support negative overhead too? Rate table they use have unsigned overhead.

- Jussi

#4 lore raw

Re: [PATCH v2 2/2] [iproute2/tc] hfsc: add link layer overhead adaption

Quoted 7 lines · Jussi Kivilinna

Quoting Andy Furniss <[email protected]>:

Quoted 5 lines
Quoted 3 lines · Jussi Kivilinna

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.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

+ unsigned short overhead = 0, mpu = 0;

overhead may need to be negative because skb->len on eth is payload + 14

Andy.

Ok, I made size tables use signed short for overhead instead. But this makes me think should htb/cfq/tfb be changed to support negative overhead too? Rate table they use have unsigned overhead.

Yea they should really, somehow - eventually :-) It was discussed here -

http://news.gmane.org/find-root.php?group=gmane.linux.network&article=90386

Andy.

#5 lore raw

Re: [PATCH v2 2/2] [iproute2/tc] hfsc: add link layer overhead adaption

In reply to Jussi Kivilinna
Quoted 7 lines · Jussi Kivilinna

Quoting Andy Furniss <[email protected]>:

Quoted 5 lines
Quoted 3 lines · Jussi Kivilinna

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.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

+ unsigned short overhead = 0, mpu = 0;

overhead may need to be negative because skb->len on eth is payload + 14

Andy.

Ok, I made size tables use signed short for overhead instead.

Please wait with resending until I get a chance to review the patches (probably later today) in case something else comes up.

#6 lore raw

Re: [PATCH v2 2/2] [iproute2/tc] hfsc: add link layer overhead adaption

Quoting Patrick McHardy <[email protected]>:

Quoted 11 lines
Quoted 10 lines · Jussi Kivilinna

Quoting Andy Furniss <[email protected]>:

Quoted 8 lines
Quoted 6 lines · Jussi Kivilinna

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.

+ unsigned short overhead = 0, mpu = 0;

Quoted 8 lines
Quoted 5 lines
Quoted 3 lines

overhead may need to be negative because skb->len on eth is payload + 14

Andy.

Ok, I made size tables use signed short for overhead instead.

Please wait with resending until I get a chance to review the patches (probably later today) in case something else comes up.

Ok.