diff options
author | Or Gerlitz <ogerlitz@voltaire.com> | 2008-06-13 21:12:00 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-06-17 23:59:41 -0400 |
commit | c1da4ac752b8b0411791d26c678fcf23d2eed242 (patch) | |
tree | 294fdfa9180e3094d0f3537255594feaf345bd8c | |
parent | 743d32ad3688a6035374885809e1e982adbf16b1 (diff) |
net/core: add NETDEV_BONDING_FAILOVER event
Add NETDEV_BONDING_FAILOVER event to be used in a successive patch
by bonding to announce fail-over for the active-backup mode through the
netdev events notifier chain mechanism. Such an event can be of use for the
RDMA CM (communication manager) to let native RDMA ULPs (eg NFS-RDMA, iSER)
always be aligned with the IP stack, in the sense that they use the same
ports/links as the stack does. More usages can be done to allow monitoring
tools based on netlink events being aware to bonding fail-over.
Signed-off-by: Or Gerlitz <ogerlitz@voltaire.com>
Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
-rw-r--r-- | include/linux/netdevice.h | 1 | ||||
-rw-r--r-- | include/linux/notifier.h | 1 | ||||
-rw-r--r-- | net/core/dev.c | 6 |
3 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index f27fd2009334..e92fc839ab1d 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1479,6 +1479,7 @@ extern void __dev_addr_unsync(struct dev_addr_list **to, int *to_count, struct | |||
1479 | extern void dev_set_promiscuity(struct net_device *dev, int inc); | 1479 | extern void dev_set_promiscuity(struct net_device *dev, int inc); |
1480 | extern void dev_set_allmulti(struct net_device *dev, int inc); | 1480 | extern void dev_set_allmulti(struct net_device *dev, int inc); |
1481 | extern void netdev_state_change(struct net_device *dev); | 1481 | extern void netdev_state_change(struct net_device *dev); |
1482 | extern void netdev_bonding_change(struct net_device *dev); | ||
1482 | extern void netdev_features_change(struct net_device *dev); | 1483 | extern void netdev_features_change(struct net_device *dev); |
1483 | /* Load a device via the kmod */ | 1484 | /* Load a device via the kmod */ |
1484 | extern void dev_load(struct net *net, const char *name); | 1485 | extern void dev_load(struct net *net, const char *name); |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index 0ff6224d172a..bd3d72ddf333 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
@@ -197,6 +197,7 @@ static inline int notifier_to_errno(int ret) | |||
197 | #define NETDEV_GOING_DOWN 0x0009 | 197 | #define NETDEV_GOING_DOWN 0x0009 |
198 | #define NETDEV_CHANGENAME 0x000A | 198 | #define NETDEV_CHANGENAME 0x000A |
199 | #define NETDEV_FEAT_CHANGE 0x000B | 199 | #define NETDEV_FEAT_CHANGE 0x000B |
200 | #define NETDEV_BONDING_FAILOVER 0x000C | ||
200 | 201 | ||
201 | #define SYS_DOWN 0x0001 /* Notify of system down */ | 202 | #define SYS_DOWN 0x0001 /* Notify of system down */ |
202 | #define SYS_RESTART SYS_DOWN | 203 | #define SYS_RESTART SYS_DOWN |
diff --git a/net/core/dev.c b/net/core/dev.c index 68d8df0992ab..0e45742e7158 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -961,6 +961,12 @@ void netdev_state_change(struct net_device *dev) | |||
961 | } | 961 | } |
962 | } | 962 | } |
963 | 963 | ||
964 | void netdev_bonding_change(struct net_device *dev) | ||
965 | { | ||
966 | call_netdevice_notifiers(NETDEV_BONDING_FAILOVER, dev); | ||
967 | } | ||
968 | EXPORT_SYMBOL(netdev_bonding_change); | ||
969 | |||
964 | /** | 970 | /** |
965 | * dev_load - load a network module | 971 | * dev_load - load a network module |
966 | * @net: the applicable net namespace | 972 | * @net: the applicable net namespace |