提交 df2bcc4a 编写于 作者: A Amerigo Wang 提交者: David S. Miller

bonding: show all the link status of slaves

There are four link statuses of a bonding slave, the procfs
code shows a wrong status when using downdelay/updelay:

	(slave->link == BOND_LINK_UP) ?  "up" : "down"

It doesn't respect the rest two statuses. This patch fixes it.

Cc: Jay Vosburgh <fubar@us.ibm.com>
Cc: Andy Gospodarek <andy@greyhouse.net>
Cc: "David S. Miller" <davem@davemloft.net>
Signed-off-by: NCong Wang <amwang@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 86a2f415
......@@ -150,14 +150,25 @@ static void bond_info_show_master(struct seq_file *seq)
}
}
static const char *bond_slave_link_status(s8 link)
{
static const char * const status[] = {
[BOND_LINK_UP] = "up",
[BOND_LINK_FAIL] = "going down",
[BOND_LINK_DOWN] = "down",
[BOND_LINK_BACK] = "going back",
};
return status[link];
}
static void bond_info_show_slave(struct seq_file *seq,
const struct slave *slave)
{
struct bonding *bond = seq->private;
seq_printf(seq, "\nSlave Interface: %s\n", slave->dev->name);
seq_printf(seq, "MII Status: %s\n",
(slave->link == BOND_LINK_UP) ? "up" : "down");
seq_printf(seq, "MII Status: %s\n", bond_slave_link_status(slave->link));
if (slave->speed == SPEED_UNKNOWN)
seq_printf(seq, "Speed: %s\n", "Unknown");
else
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册