Re: [RFC PATCH net-next] bonding: Use notifiers for slave link state detection
From: Jay Vosburgh <hidden>
Date: 2016-01-08 06:12:57
zhuyj [off-list ref] wrote:
Hi, Jay Thank for your help. I made a new patch based on the latest linux kernel. Now it is in the attachment. When I run "make", the following errors will pop up.
[...]
drivers/net/bonding/bond_main.c:1996:3: error: too many arguments to function ‘bond_set_slave_link_state’ include/net/bonding.h:507:20: note: declared here
My patch was generated against the current net-next git
repository. I suspect you're using an older kernel; since commit
5d397061ca20 ("bonding: allow notifications for bond_set_slave_link_state")
the bond_set_slave_link_state function has three arguments.
This commit was added 3 Dec 2015.
For example, from your patch:
- bond_set_slave_link_state(slave, BOND_LINK_FAIL);
[...]
+ bond_set_slave_link_state(slave, BOND_LINK_FAIL, BOND_SLAVE_NOTIFY_LATER);
For your kernel version, you'll need to change the patched code to remove the third argument to bond_set_slave_link_state.
And I can not find notifier callbacks in the patch.
The bond_slave_netdev_event function is bonding's notifier callback; the patch adds a call there for NETDEV_UP, NETDEV_CHANGE and NETDEV_DOWN events to check link state:
case NETDEV_DOWN: + if (bond_miimon_inspect_slave(bond, slave)) + bond_miimon_commit(bond); +
-J --- -Jay Vosburgh, jay.vosburgh@canonical.com