linux/net/sched/sch_teql.c

// SPDX-License-Identifier: GPL-2.0-or-later
/* net/sched/sch_teql.c	"True" (or "trivial") link equalizer.
 *
 * Authors:	Alexey Kuznetsov, <[email protected]>
 */

#include <linux/module.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/if_arp.h>
#include <linux/netdevice.h>
#include <linux/init.h>
#include <linux/skbuff.h>
#include <linux/moduleparam.h>
#include <net/dst.h>
#include <net/neighbour.h>
#include <net/pkt_sched.h>

/*
   How to setup it.
   ----------------

   After loading this module you will find a new device teqlN
   and new qdisc with the same name. To join a slave to the equalizer
   you should just set this qdisc on a device f.e.

   # tc qdisc add dev eth0 root teql0
   # tc qdisc add dev eth1 root teql0

   That's all. Full PnP 8)

   Applicability.
   --------------

   1. Slave devices MUST be active devices, i.e., they must raise the tbusy
      signal and generate EOI events. If you want to equalize virtual devices
      like tunnels, use a normal eql device.
   2. This device puts no limitations on physical slave characteristics
      f.e. it will equalize 9600baud line and 100Mb ethernet perfectly :-)
      Certainly, large difference in link speeds will make the resulting
      eqalized link unusable, because of huge packet reordering.
      I estimate an upper useful difference as ~10 times.
   3. If the slave requires address resolution, only protocols using
      neighbour cache (IPv4/IPv6) will work over the equalized link.
      Other protocols are still allowed to use the slave device directly,
      which will not break load balancing, though native slave
      traffic will have the highest priority.  */

struct teql_master {};

struct teql_sched_data {};

#define NEXT_SLAVE(q)

#define FMASK

/* "teql*" qdisc routines */

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

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

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

static void
teql_reset(struct Qdisc *sch)
{}

static void
teql_destroy(struct Qdisc *sch)
{}

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


static int
__teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res,
	       struct net_device *dev, struct netdev_queue *txq,
	       struct dst_entry *dst)
{}

static inline int teql_resolve(struct sk_buff *skb,
			       struct sk_buff *skb_res,
			       struct net_device *dev,
			       struct netdev_queue *txq)
{}

static netdev_tx_t teql_master_xmit(struct sk_buff *skb, struct net_device *dev)
{}

static int teql_master_open(struct net_device *dev)
{}

static int teql_master_close(struct net_device *dev)
{}

static void teql_master_stats64(struct net_device *dev,
				struct rtnl_link_stats64 *stats)
{}

static int teql_master_mtu(struct net_device *dev, int new_mtu)
{}

static const struct net_device_ops teql_netdev_ops =;

static __init void teql_master_setup(struct net_device *dev)
{}

static LIST_HEAD(master_dev_list);
static int max_equalizers =;
module_param(max_equalizers, int, 0);
MODULE_PARM_DESC();

static int __init teql_init(void)
{}

static void __exit teql_exit(void)
{}

module_init();
module_exit(teql_exit);

MODULE_LICENSE();
MODULE_DESCRIPTION();