Release 4.7 drivers/net/bonding/bond_debugfs.c
  
  
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/device.h>
#include <linux/netdevice.h>
#include <net/bonding.h>
#include <net/bond_alb.h>
#if defined(CONFIG_DEBUG_FS) && !defined(CONFIG_NET_NS)
#include <linux/debugfs.h>
#include <linux/seq_file.h>
static struct dentry *bonding_debug_root;
/* Show RLB hash table */
static int bond_debug_rlb_hash_show(struct seq_file *m, void *v)
{
	struct bonding *bond = m->private;
	struct alb_bond_info *bond_info = &(BOND_ALB_INFO(bond));
	struct rlb_client_info *client_info;
	u32 hash_index;
	if (BOND_MODE(bond) != BOND_MODE_ALB)
		return 0;
	seq_printf(m, "SourceIP        DestinationIP   "
			"Destination MAC   DEV\n");
	spin_lock_bh(&bond->mode_lock);
	hash_index = bond_info->rx_hashtbl_used_head;
	for (; hash_index != RLB_NULL_INDEX;
	     hash_index = client_info->used_next) {
		client_info = &(bond_info->rx_hashtbl[hash_index]);
		seq_printf(m, "%-15pI4 %-15pI4 %-17pM %s\n",
			&client_info->ip_src,
			&client_info->ip_dst,
			&client_info->mac_dst,
			client_info->slave->dev->name);
	}
	spin_unlock_bh(&bond->mode_lock);
	return 0;
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| taku izumi | taku izumi | 138 | 93.88% | 1 | 25.00% | 
| nikolay aleksandrov | nikolay aleksandrov | 4 | 2.72% | 1 | 25.00% | 
| veaceslav falico | veaceslav falico | 3 | 2.04% | 1 | 25.00% | 
| jiri bohac | jiri bohac | 2 | 1.36% | 1 | 25.00% | 
 | Total | 147 | 100.00% | 4 | 100.00% | 
static int bond_debug_rlb_hash_open(struct inode *inode, struct file *file)
{
	return single_open(file, bond_debug_rlb_hash_show, inode->i_private);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| taku izumi | taku izumi | 28 | 100.00% | 1 | 100.00% | 
 | Total | 28 | 100.00% | 1 | 100.00% | 
static const struct file_operations bond_debug_rlb_hash_fops = {
	.owner		= THIS_MODULE,
	.open		= bond_debug_rlb_hash_open,
	.read		= seq_read,
	.llseek		= seq_lseek,
	.release	= single_release,
};
void bond_debug_register(struct bonding *bond)
{
	if (!bonding_debug_root)
		return;
	bond->debug_dir =
		debugfs_create_dir(bond->dev->name, bonding_debug_root);
	if (!bond->debug_dir) {
		netdev_warn(bond->dev, "failed to register to debugfs\n");
		return;
	}
	debugfs_create_file("rlb_hash_table", 0400, bond->debug_dir,
				bond, &bond_debug_rlb_hash_fops);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| taku izumi | taku izumi | 63 | 95.45% | 2 | 66.67% | 
| veaceslav falico | veaceslav falico | 3 | 4.55% | 1 | 33.33% | 
 | Total | 66 | 100.00% | 3 | 100.00% | 
void bond_debug_unregister(struct bonding *bond)
{
	if (!bonding_debug_root)
		return;
	debugfs_remove_recursive(bond->debug_dir);
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| taku izumi | taku izumi | 23 | 100.00% | 1 | 100.00% | 
 | Total | 23 | 100.00% | 1 | 100.00% | 
void bond_debug_reregister(struct bonding *bond)
{
	struct dentry *d;
	if (!bonding_debug_root)
		return;
	d = debugfs_rename(bonding_debug_root, bond->debug_dir,
			   bonding_debug_root, bond->dev->name);
	if (d) {
		bond->debug_dir = d;
	} else {
		netdev_warn(bond->dev, "failed to reregister, so just unregister old one\n");
		bond_debug_unregister(bond);
	}
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| taku izumi | taku izumi | 66 | 95.65% | 1 | 50.00% | 
| veaceslav falico | veaceslav falico | 3 | 4.35% | 1 | 50.00% | 
 | Total | 69 | 100.00% | 2 | 100.00% | 
void bond_create_debugfs(void)
{
	bonding_debug_root = debugfs_create_dir("bonding", NULL);
	if (!bonding_debug_root) {
		pr_warn("Warning: Cannot create bonding directory in debugfs\n");
	}
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| taku izumi | taku izumi | 26 | 92.86% | 1 | 50.00% | 
| joe perches | joe perches | 2 | 7.14% | 1 | 50.00% | 
 | Total | 28 | 100.00% | 2 | 100.00% | 
void bond_destroy_debugfs(void)
{
	debugfs_remove_recursive(bonding_debug_root);
	bonding_debug_root = NULL;
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| taku izumi | taku izumi | 16 | 100.00% | 1 | 100.00% | 
 | Total | 16 | 100.00% | 1 | 100.00% | 
#else /* !CONFIG_DEBUG_FS */
void bond_debug_register(struct bonding *bond)
{
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| taku izumi | taku izumi | 9 | 100.00% | 1 | 100.00% | 
 | Total | 9 | 100.00% | 1 | 100.00% | 
void bond_debug_unregister(struct bonding *bond)
{
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| taku izumi | taku izumi | 9 | 100.00% | 1 | 100.00% | 
 | Total | 9 | 100.00% | 1 | 100.00% | 
void bond_debug_reregister(struct bonding *bond)
{
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| taku izumi | taku izumi | 9 | 100.00% | 1 | 100.00% | 
 | Total | 9 | 100.00% | 1 | 100.00% | 
void bond_create_debugfs(void)
{
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| taku izumi | taku izumi | 6 | 100.00% | 1 | 100.00% | 
 | Total | 6 | 100.00% | 1 | 100.00% | 
void bond_destroy_debugfs(void)
{
}
Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| taku izumi | taku izumi | 6 | 100.00% | 1 | 100.00% | 
 | Total | 6 | 100.00% | 1 | 100.00% | 
#endif /* CONFIG_DEBUG_FS */
Overall Contributors
 | Person | Tokens | Prop | Commits | CommitProp | 
| taku izumi | taku izumi | 467 | 93.78% | 2 | 20.00% | 
| eric w. biederman | eric w. biederman | 11 | 2.21% | 1 | 10.00% | 
| veaceslav falico | veaceslav falico | 9 | 1.81% | 2 | 20.00% | 
| nikolay aleksandrov | nikolay aleksandrov | 5 | 1.00% | 2 | 20.00% | 
| david s. miller | david s. miller | 2 | 0.40% | 1 | 10.00% | 
| joe perches | joe perches | 2 | 0.40% | 1 | 10.00% | 
| jiri bohac | jiri bohac | 2 | 0.40% | 1 | 10.00% | 
 | Total | 498 | 100.00% | 10 | 100.00% | 
  
Information contained on this website is for historical information purposes only and does not indicate or represent copyright ownership.