linux/net/sched/sch_ets.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * net/sched/sch_ets.c         Enhanced Transmission Selection scheduler
 *
 * Description
 * -----------
 *
 * The Enhanced Transmission Selection scheduler is a classful queuing
 * discipline that merges functionality of PRIO and DRR qdiscs in one scheduler.
 * ETS makes it easy to configure a set of strict and bandwidth-sharing bands to
 * implement the transmission selection described in 802.1Qaz.
 *
 * Although ETS is technically classful, it's not possible to add and remove
 * classes at will. Instead one specifies number of classes, how many are
 * PRIO-like and how many DRR-like, and quanta for the latter.
 *
 * Algorithm
 * ---------
 *
 * The strict classes, if any, are tried for traffic first: first band 0, if it
 * has no traffic then band 1, etc.
 *
 * When there is no traffic in any of the strict queues, the bandwidth-sharing
 * ones are tried next. Each band is assigned a deficit counter, initialized to
 * "quantum" of that band. ETS maintains a list of active bandwidth-sharing
 * bands whose qdiscs are non-empty. A packet is dequeued from the band at the
 * head of the list if the packet size is smaller or equal to the deficit
 * counter. If the counter is too small, it is increased by "quantum" and the
 * scheduler moves on to the next band in the active list.
 */

#include <linux/module.h>
#include <net/gen_stats.h>
#include <net/netlink.h>
#include <net/pkt_cls.h>
#include <net/pkt_sched.h>
#include <net/sch_generic.h>

struct ets_class {};

struct ets_sched {};

static const struct nla_policy ets_policy[TCA_ETS_MAX + 1] =;

static const struct nla_policy ets_priomap_policy[TCA_ETS_MAX + 1] =;

static const struct nla_policy ets_quanta_policy[TCA_ETS_MAX + 1] =;

static const struct nla_policy ets_class_policy[TCA_ETS_MAX + 1] =;

static int ets_quantum_parse(struct Qdisc *sch, const struct nlattr *attr,
			     unsigned int *quantum,
			     struct netlink_ext_ack *extack)
{}

static struct ets_class *
ets_class_from_arg(struct Qdisc *sch, unsigned long arg)
{}

static u32 ets_class_id(struct Qdisc *sch, const struct ets_class *cl)
{}

static void ets_offload_change(struct Qdisc *sch)
{}

static void ets_offload_destroy(struct Qdisc *sch)
{}

static void ets_offload_graft(struct Qdisc *sch, struct Qdisc *new,
			      struct Qdisc *old, unsigned long arg,
			      struct netlink_ext_ack *extack)
{}

static int ets_offload_dump(struct Qdisc *sch)
{}

static bool ets_class_is_strict(struct ets_sched *q, const struct ets_class *cl)
{}

static int ets_class_change(struct Qdisc *sch, u32 classid, u32 parentid,
			    struct nlattr **tca, unsigned long *arg,
			    struct netlink_ext_ack *extack)
{}

static int ets_class_graft(struct Qdisc *sch, unsigned long arg,
			   struct Qdisc *new, struct Qdisc **old,
			   struct netlink_ext_ack *extack)
{}

static struct Qdisc *ets_class_leaf(struct Qdisc *sch, unsigned long arg)
{}

static unsigned long ets_class_find(struct Qdisc *sch, u32 classid)
{}

static void ets_class_qlen_notify(struct Qdisc *sch, unsigned long arg)
{}

static int ets_class_dump(struct Qdisc *sch, unsigned long arg,
			  struct sk_buff *skb, struct tcmsg *tcm)
{}

static int ets_class_dump_stats(struct Qdisc *sch, unsigned long arg,
				struct gnet_dump *d)
{}

static void ets_qdisc_walk(struct Qdisc *sch, struct qdisc_walker *arg)
{}

static struct tcf_block *
ets_qdisc_tcf_block(struct Qdisc *sch, unsigned long cl,
		    struct netlink_ext_ack *extack)
{}

static unsigned long ets_qdisc_bind_tcf(struct Qdisc *sch, unsigned long parent,
					u32 classid)
{}

static void ets_qdisc_unbind_tcf(struct Qdisc *sch, unsigned long arg)
{}

static struct ets_class *ets_classify(struct sk_buff *skb, struct Qdisc *sch,
				      int *qerr)
{}

static int ets_qdisc_enqueue(struct sk_buff *skb, struct Qdisc *sch,
			     struct sk_buff **to_free)
{}

static struct sk_buff *
ets_qdisc_dequeue_skb(struct Qdisc *sch, struct sk_buff *skb)
{}

static struct sk_buff *ets_qdisc_dequeue(struct Qdisc *sch)
{}

static int ets_qdisc_priomap_parse(struct nlattr *priomap_attr,
				   unsigned int nbands, u8 *priomap,
				   struct netlink_ext_ack *extack)
{}

static int ets_qdisc_quanta_parse(struct Qdisc *sch, struct nlattr *quanta_attr,
				  unsigned int nbands, unsigned int nstrict,
				  unsigned int *quanta,
				  struct netlink_ext_ack *extack)
{}

static int ets_qdisc_change(struct Qdisc *sch, struct nlattr *opt,
			    struct netlink_ext_ack *extack)
{}

static int ets_qdisc_init(struct Qdisc *sch, struct nlattr *opt,
			  struct netlink_ext_ack *extack)
{}

static void ets_qdisc_reset(struct Qdisc *sch)
{}

static void ets_qdisc_destroy(struct Qdisc *sch)
{}

static int ets_qdisc_dump(struct Qdisc *sch, struct sk_buff *skb)
{}

static const struct Qdisc_class_ops ets_class_ops =;

static struct Qdisc_ops ets_qdisc_ops __read_mostly =;
MODULE_ALIAS_NET_SCH();

static int __init ets_init(void)
{}

static void __exit ets_exit(void)
{}

module_init();
module_exit(ets_exit);
MODULE_LICENSE();
MODULE_DESCRIPTION();