tc_core: add size table
Subsystems (2)
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
@@ -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
@@ -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);
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
@@ -326,6 +326,8 @@ enumTCA_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
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.
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->lenon eth is payload + 14Andy.
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
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->lenon eth is payload + 14Andy.
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.
Re: [PATCH v2 2/2] [iproute2/tc] hfsc: add link layer overhead adaption
In reply to Jussi KivilinnaQuoted 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->lenon eth is payload + 14Andy.
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.
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->lenon eth is payload + 14Andy.
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.