Skip to content

Commit

Permalink
net: sched: add Flow Queue PIE packet scheduler
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Sachin D. Patil <[email protected]>
Signed-off-by: V. Saicharan <[email protected]>
Signed-off-by: Mohit Bhasi <[email protected]>
Signed-off-by: Leslie Monis <[email protected]>
Signed-off-by: Gautam Ramakrishnan <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
mohittahiliani authored and davem330 committed Jan 23, 2020
1 parent 5205ea0 commit ec97ecf
Show file tree
Hide file tree
Showing 5 changed files with 609 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/net/pie.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,11 @@ struct pie_stats {
/**
* struct pie_skb_cb - contains private skb vars
* @enqueue_time: timestamp when the packet is enqueued
* @mem_usage: size of the skb during enqueue
*/
struct pie_skb_cb {
psched_time_t enqueue_time;
u32 mem_usage;
};

static inline void pie_params_init(struct pie_params *params)
Expand Down
31 changes: 31 additions & 0 deletions include/uapi/linux/pkt_sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -971,6 +971,37 @@ struct tc_pie_xstats {
__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 */
struct tc_cbs_qopt {
__u8 offload;
Expand Down
13 changes: 13 additions & 0 deletions net/sched/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,19 @@ config NET_SCH_PIE

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
tristate "Ingress/classifier-action Qdisc"
depends on NET_CLS_ACT
Expand Down
1 change: 1 addition & 0 deletions net/sched/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ obj-$(CONFIG_NET_SCH_CAKE) += sch_cake.o
obj-$(CONFIG_NET_SCH_FQ) += sch_fq.o
obj-$(CONFIG_NET_SCH_HHF) += sch_hhf.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_ETF) += sch_etf.o
obj-$(CONFIG_NET_SCH_TAPRIO) += sch_taprio.o
Expand Down
Loading

0 comments on commit ec97ecf

Please sign in to comment.