linux/drivers/net/ifb.c

// SPDX-License-Identifier: GPL-2.0-or-later
/* drivers/net/ifb.c:

	The purpose of this driver is to provide a device that allows
	for sharing of resources:

	1) qdiscs/policies that are per device as opposed to system wide.
	ifb allows for a device which can be redirected to thus providing
	an impression of sharing.

	2) Allows for queueing incoming traffic for shaping instead of
	dropping.

	The original concept is based on what is known as the IMQ
	driver initially written by Martin Devera, later rewritten
	by Patrick McHardy and then maintained by Andre Correa.

	You need the tc action  mirror or redirect to feed this device
	packets.


	Authors:	Jamal Hadi Salim (2005)

*/


#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
#include <linux/ethtool.h>
#include <linux/etherdevice.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/moduleparam.h>
#include <linux/netfilter_netdev.h>
#include <net/pkt_sched.h>
#include <net/net_namespace.h>

#define TX_Q_LIMIT

struct ifb_q_stats {};

struct ifb_q_private {} ____cacheline_aligned_in_smp;

struct ifb_dev_private {};

/* For ethtools stats. */
struct ifb_q_stats_desc {};

#define IFB_Q_STAT(m)

static const struct ifb_q_stats_desc ifb_q_stats_desc[] =;

#define IFB_Q_STATS_LEN

static netdev_tx_t ifb_xmit(struct sk_buff *skb, struct net_device *dev);
static int ifb_open(struct net_device *dev);
static int ifb_close(struct net_device *dev);

static void ifb_update_q_stats(struct ifb_q_stats *stats, int len)
{}

static void ifb_ri_tasklet(struct tasklet_struct *t)
{}

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

static int ifb_dev_init(struct net_device *dev)
{}

static void ifb_get_strings(struct net_device *dev, u32 stringset, u8 *buf)
{}

static int ifb_get_sset_count(struct net_device *dev, int sset)
{}

static void ifb_fill_stats_data(u64 **data,
				struct ifb_q_stats *q_stats)
{}

static void ifb_get_ethtool_stats(struct net_device *dev,
				  struct ethtool_stats *stats, u64 *data)
{}

static const struct net_device_ops ifb_netdev_ops =;

static const struct ethtool_ops ifb_ethtool_ops =;

#define IFB_FEATURES

static void ifb_dev_free(struct net_device *dev)
{}

static void ifb_setup(struct net_device *dev)
{}

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

static int ifb_close(struct net_device *dev)
{}

static int ifb_open(struct net_device *dev)
{}

static int ifb_validate(struct nlattr *tb[], struct nlattr *data[],
			struct netlink_ext_ack *extack)
{}

static struct rtnl_link_ops ifb_link_ops __read_mostly =;

/* Number of ifb devices to be set up by this module.
 * Note that these legacy devices have one queue.
 * Prefer something like : ip link add ifb10 numtxqueues 8 type ifb
 */
static int numifbs =;
module_param(numifbs, int, 0);
MODULE_PARM_DESC();

static int __init ifb_init_one(int index)
{}

static int __init ifb_init_module(void)
{}

static void __exit ifb_cleanup_module(void)
{}

module_init();
module_exit(ifb_cleanup_module);
MODULE_LICENSE();
MODULE_DESCRIPTION();
MODULE_AUTHOR();
MODULE_ALIAS_RTNL_LINK();