summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2004-01-28 20:15:03 -0800
committerPatrick McHardy <kaber@trash.net>2004-01-28 20:15:03 -0800
commit6e22ce74ea0666a869ce82f418ce78b5be089fb4 (patch)
tree8142b4f40582f076ed5854e20661baf0307554ea /include
parent53608418271c9192bd86743a2c67660e11788a92 (diff)
[NET_SCHED]: Add HFSC packet scheduler.
Diffstat (limited to 'include')
-rw-r--r--include/linux/pkt_sched.h31
-rw-r--r--include/net/pkt_sched.h3
2 files changed, 34 insertions, 0 deletions
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index d97edad0effc..8ae0e141cb05 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -290,6 +290,37 @@ struct tc_htb_xstats
__u32 ctokens;
};
+/* HFSC section */
+
+struct tc_hfsc_qopt
+{
+ __u16 defcls; /* default class */
+};
+
+struct tc_service_curve
+{
+ __u32 m1; /* slope of the first segment in bps */
+ __u32 d; /* x-projection of the first segment in us */
+ __u32 m2; /* slope of the second segment in bps */
+};
+
+struct tc_hfsc_stats
+{
+ __u64 work; /* total work done */
+ __u64 rtwork; /* work done by real-time criteria */
+ __u32 period; /* current period */
+ __u32 level; /* class level in hierarchy */
+};
+
+enum
+{
+ TCA_HFSC_UNSPEC,
+ TCA_HFSC_RSC,
+ TCA_HFSC_FSC,
+ TCA_HFSC_USC,
+ TCA_HFSC_MAX = TCA_HFSC_USC
+};
+
/* CBQ section */
#define TC_CBQ_MAXPRIO 8
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 270523896c4d..35f600ba43ba 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -203,6 +203,7 @@ typedef long psched_tdiff_t;
#define PSCHED_GET_TIME(stamp) do_gettimeofday(&(stamp))
#define PSCHED_US2JIFFIE(usecs) (((usecs)+(1000000/HZ-1))/(1000000/HZ))
+#define PSCHED_JIFFIE2US(delay) ((delay)*(1000000/HZ))
#define PSCHED_EXPORTLIST EXPORT_SYMBOL(psched_tod_diff);
@@ -251,6 +252,7 @@ extern PSCHED_WATCHER psched_time_mark;
#endif
#define PSCHED_US2JIFFIE(delay) (((delay)+(1<<PSCHED_JSCALE)-1)>>PSCHED_JSCALE)
+#define PSCHED_JIFFIE2US(delay) ((delay)<<PSCHED_JSCALE)
#elif PSCHED_CLOCK_SOURCE == PSCHED_CPU
@@ -261,6 +263,7 @@ extern int psched_clock_scale;
EXPORT_SYMBOL(psched_clock_scale);
#define PSCHED_US2JIFFIE(delay) (((delay)+psched_clock_per_hz-1)/psched_clock_per_hz)
+#define PSCHED_JIFFIE2US(delay) ((delay)*psched_clock_per_hz)
#ifdef CONFIG_X86_TSC