Commit ec97ecf1 authored by Mohit P. Tahiliani's avatar Mohit P. Tahiliani Committed by David S. Miller

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: default avatarMohit P. Tahiliani <tahiliani@nitk.edu.in>
Signed-off-by: default avatarSachin D. Patil <sdp.sachin@gmail.com>
Signed-off-by: default avatarV. Saicharan <vsaicharan1998@gmail.com>
Signed-off-by: default avatarMohit Bhasi <mohitbhasi1998@gmail.com>
Signed-off-by: default avatarLeslie Monis <lesliemonis@gmail.com>
Signed-off-by: default avatarGautam Ramakrishnan <gautamramk@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 5205ea00
...@@ -81,9 +81,11 @@ struct pie_stats { ...@@ -81,9 +81,11 @@ struct pie_stats {
/** /**
* struct pie_skb_cb - contains private skb vars * struct pie_skb_cb - contains private skb vars
* @enqueue_time: timestamp when the packet is enqueued * @enqueue_time: timestamp when the packet is enqueued
* @mem_usage: size of the skb during enqueue
*/ */
struct pie_skb_cb { struct pie_skb_cb {
psched_time_t enqueue_time; psched_time_t enqueue_time;
u32 mem_usage;
}; };
static inline void pie_params_init(struct pie_params *params) static inline void pie_params_init(struct pie_params *params)
......
...@@ -971,6 +971,37 @@ struct tc_pie_xstats { ...@@ -971,6 +971,37 @@ struct tc_pie_xstats {
__u32 ecn_mark; /* packets marked with ecn*/ __u32 ecn_mark; /* packets marked with ecn*/
}; };
/* FQ PIE */
enum {
TCA_FQ_PIE_UNSPEC,
TCA_FQ_PIE_LIMIT,
TCA_FQ_PIE_FLOWS,
TCA_FQ_PIE_TARGET,
TCA_FQ_PIE_TUPDATE,
TCA_FQ_PIE_ALPHA,
TCA_FQ_PIE_BETA,
TCA_FQ_PIE_QUANTUM,
TCA_FQ_PIE_MEMORY_LIMIT,
TCA_FQ_PIE_ECN_PROB,
TCA_FQ_PIE_ECN,
TCA_FQ_PIE_BYTEMODE,
TCA_FQ_PIE_DQ_RATE_ESTIMATOR,
__TCA_FQ_PIE_MAX
};
#define TCA_FQ_PIE_MAX (__TCA_FQ_PIE_MAX - 1)
struct tc_fq_pie_xstats {
__u32 packets_in; /* total number of packets enqueued */
__u32 dropped; /* packets dropped due to fq_pie_action */
__u32 overlimit; /* dropped due to lack of space in queue */
__u32 overmemory; /* dropped due to lack of memory in queue */
__u32 ecn_mark; /* packets marked with ecn */
__u32 new_flow_count; /* count of new flows created by packets */
__u32 new_flows_len; /* count of flows in new list */
__u32 old_flows_len; /* count of flows in old list */
__u32 memory_usage; /* total memory across all queues */
};
/* CBS */ /* CBS */
struct tc_cbs_qopt { struct tc_cbs_qopt {
__u8 offload; __u8 offload;
......
...@@ -366,6 +366,19 @@ config NET_SCH_PIE ...@@ -366,6 +366,19 @@ config NET_SCH_PIE
If unsure, say N. If unsure, say N.
config NET_SCH_FQ_PIE
depends on NET_SCH_PIE
tristate "Flow Queue Proportional Integral controller Enhanced (FQ-PIE)"
help
Say Y here if you want to use the Flow Queue Proportional Integral
controller Enhanced (FQ-PIE) packet scheduling algorithm.
For more information, please see https://tools.ietf.org/html/rfc8033
To compile this driver as a module, choose M here: the module
will be called sch_fq_pie.
If unsure, say N.
config NET_SCH_INGRESS config NET_SCH_INGRESS
tristate "Ingress/classifier-action Qdisc" tristate "Ingress/classifier-action Qdisc"
depends on NET_CLS_ACT depends on NET_CLS_ACT
......
...@@ -59,6 +59,7 @@ obj-$(CONFIG_NET_SCH_CAKE) += sch_cake.o ...@@ -59,6 +59,7 @@ obj-$(CONFIG_NET_SCH_CAKE) += sch_cake.o
obj-$(CONFIG_NET_SCH_FQ) += sch_fq.o obj-$(CONFIG_NET_SCH_FQ) += sch_fq.o
obj-$(CONFIG_NET_SCH_HHF) += sch_hhf.o obj-$(CONFIG_NET_SCH_HHF) += sch_hhf.o
obj-$(CONFIG_NET_SCH_PIE) += sch_pie.o obj-$(CONFIG_NET_SCH_PIE) += sch_pie.o
obj-$(CONFIG_NET_SCH_FQ_PIE) += sch_fq_pie.o
obj-$(CONFIG_NET_SCH_CBS) += sch_cbs.o obj-$(CONFIG_NET_SCH_CBS) += sch_cbs.o
obj-$(CONFIG_NET_SCH_ETF) += sch_etf.o obj-$(CONFIG_NET_SCH_ETF) += sch_etf.o
obj-$(CONFIG_NET_SCH_TAPRIO) += sch_taprio.o obj-$(CONFIG_NET_SCH_TAPRIO) += sch_taprio.o
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment