Skip to content

Commit ec97ecf

Browse files
mohittahilianidavem330
authored andcommitted
net: sched: add Flow Queue PIE packet scheduler
Principles: - Packets are classified on flows. - This is a Stochastic model (as we use a hash, several flows might be hashed to the same slot) - Each flow has a PIE managed queue. - Flows are linked onto two (Round Robin) lists, so that new flows have priority on old ones. - For a given flow, packets are not reordered. - Drops during enqueue only. - ECN capability is off by default. - ECN threshold (if ECN is enabled) is at 10% by default. - Uses timestamps to calculate queue delay by default. Usage: tc qdisc ... fq_pie [ limit PACKETS ] [ flows NUMBER ] [ target TIME ] [ tupdate TIME ] [ alpha NUMBER ] [ beta NUMBER ] [ quantum BYTES ] [ memory_limit BYTES ] [ ecnprob PERCENTAGE ] [ [no]ecn ] [ [no]bytemode ] [ [no_]dq_rate_estimator ] defaults: limit: 10240 packets, flows: 1024 target: 15 ms, tupdate: 15 ms (in jiffies) alpha: 1/8, beta : 5/4 quantum: device MTU, memory_limit: 32 Mb ecnprob: 10%, ecn: off bytemode: off, dq_rate_estimator: off Signed-off-by: Mohit P. Tahiliani <tahiliani@nitk.edu.in> Signed-off-by: Sachin D. Patil <sdp.sachin@gmail.com> Signed-off-by: V. Saicharan <vsaicharan1998@gmail.com> Signed-off-by: Mohit Bhasi <mohitbhasi1998@gmail.com> Signed-off-by: Leslie Monis <lesliemonis@gmail.com> Signed-off-by: Gautam Ramakrishnan <gautamramk@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 5205ea0 commit ec97ecf

File tree

5 files changed

+609
-0
lines changed

5 files changed

+609
-0
lines changed

include/net/pie.h

+2
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ struct pie_stats {
8181
/**
8282
* struct pie_skb_cb - contains private skb vars
8383
* @enqueue_time: timestamp when the packet is enqueued
84+
* @mem_usage: size of the skb during enqueue
8485
*/
8586
struct pie_skb_cb {
8687
psched_time_t enqueue_time;
88+
u32 mem_usage;
8789
};
8890

8991
static inline void pie_params_init(struct pie_params *params)

include/uapi/linux/pkt_sched.h

+31
Original file line numberDiff line numberDiff line change
@@ -971,6 +971,37 @@ struct tc_pie_xstats {
971971
__u32 ecn_mark; /* packets marked with ecn*/
972972
};
973973

974+
/* FQ PIE */
975+
enum {
976+
TCA_FQ_PIE_UNSPEC,
977+
TCA_FQ_PIE_LIMIT,
978+
TCA_FQ_PIE_FLOWS,
979+
TCA_FQ_PIE_TARGET,
980+
TCA_FQ_PIE_TUPDATE,
981+
TCA_FQ_PIE_ALPHA,
982+
TCA_FQ_PIE_BETA,
983+
TCA_FQ_PIE_QUANTUM,
984+
TCA_FQ_PIE_MEMORY_LIMIT,
985+
TCA_FQ_PIE_ECN_PROB,
986+
TCA_FQ_PIE_ECN,
987+
TCA_FQ_PIE_BYTEMODE,
988+
TCA_FQ_PIE_DQ_RATE_ESTIMATOR,
989+
__TCA_FQ_PIE_MAX
990+
};
991+
#define TCA_FQ_PIE_MAX (__TCA_FQ_PIE_MAX - 1)
992+
993+
struct tc_fq_pie_xstats {
994+
__u32 packets_in; /* total number of packets enqueued */
995+
__u32 dropped; /* packets dropped due to fq_pie_action */
996+
__u32 overlimit; /* dropped due to lack of space in queue */
997+
__u32 overmemory; /* dropped due to lack of memory in queue */
998+
__u32 ecn_mark; /* packets marked with ecn */
999+
__u32 new_flow_count; /* count of new flows created by packets */
1000+
__u32 new_flows_len; /* count of flows in new list */
1001+
__u32 old_flows_len; /* count of flows in old list */
1002+
__u32 memory_usage; /* total memory across all queues */
1003+
};
1004+
9741005
/* CBS */
9751006
struct tc_cbs_qopt {
9761007
__u8 offload;

net/sched/Kconfig

+13
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,19 @@ config NET_SCH_PIE
366366

367367
If unsure, say N.
368368

369+
config NET_SCH_FQ_PIE
370+
depends on NET_SCH_PIE
371+
tristate "Flow Queue Proportional Integral controller Enhanced (FQ-PIE)"
372+
help
373+
Say Y here if you want to use the Flow Queue Proportional Integral
374+
controller Enhanced (FQ-PIE) packet scheduling algorithm.
375+
For more information, please see https://tools.ietf.org/html/rfc8033
376+
377+
To compile this driver as a module, choose M here: the module
378+
will be called sch_fq_pie.
379+
380+
If unsure, say N.
381+
369382
config NET_SCH_INGRESS
370383
tristate "Ingress/classifier-action Qdisc"
371384
depends on NET_CLS_ACT

net/sched/Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ obj-$(CONFIG_NET_SCH_CAKE) += sch_cake.o
5959
obj-$(CONFIG_NET_SCH_FQ) += sch_fq.o
6060
obj-$(CONFIG_NET_SCH_HHF) += sch_hhf.o
6161
obj-$(CONFIG_NET_SCH_PIE) += sch_pie.o
62+
obj-$(CONFIG_NET_SCH_FQ_PIE) += sch_fq_pie.o
6263
obj-$(CONFIG_NET_SCH_CBS) += sch_cbs.o
6364
obj-$(CONFIG_NET_SCH_ETF) += sch_etf.o
6465
obj-$(CONFIG_NET_SCH_TAPRIO) += sch_taprio.o

0 commit comments

Comments
 (0)