Skip to content

Commit

Permalink
bonding: improve event debug usability
Browse files Browse the repository at this point in the history
Seeing bonding debug log data along the lines of "event: 5" is a bit spartan,
and often requires a lookup table if you don't remember what every event is.
Make use of netdev_cmd_to_name for an improved debugging experience, so for
the prior example, you'll see: "bond_netdev_event received NETDEV_REGISTER"
instead (both are prefixed with the device for which the event pertains).

CC: Jay Vosburgh <[email protected]>
CC: Veaceslav Falico <[email protected]>
CC: Andy Gospodarek <[email protected]>
CC: [email protected]
Signed-off-by: Jarod Wilson <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
jarodwilson authored and davem330 committed Jun 9, 2019
1 parent 517a772 commit 75466dc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -3223,7 +3223,8 @@ static int bond_netdev_event(struct notifier_block *this,
{
struct net_device *event_dev = netdev_notifier_info_to_dev(ptr);

netdev_dbg(event_dev, "event: %lx\n", event);
netdev_dbg(event_dev, "%s received %s\n",
__func__, netdev_cmd_to_name(event));

if (!(event_dev->priv_flags & IFF_BONDING))
return NOTIFY_DONE;
Expand Down

0 comments on commit 75466dc

Please sign in to comment.