diff options
author | Jiri Pirko <jiri@resnulli.us> | 2013-10-18 11:43:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-10-19 18:58:45 -0400 |
commit | 72be35fee6eda2fad7122f7f0c959effa3b2b791 (patch) | |
tree | 7b944a0339519191f7e53927e5628bea4445916a /drivers/net/bonding/bonding.h | |
parent | 0a2a78c4a95240e658272bd7cd7422a529e4eb4a (diff) |
bonding: move mode setting into separate function
Signed-off-by: Jiri Pirko <jiri@resnulli.us>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bonding.h')
-rw-r--r-- | drivers/net/bonding/bonding.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index a2a353bf9ea6..7446849a20c4 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -58,6 +58,11 @@ | |||
58 | #define TX_QUEUE_OVERRIDE(mode) \ | 58 | #define TX_QUEUE_OVERRIDE(mode) \ |
59 | (((mode) == BOND_MODE_ACTIVEBACKUP) || \ | 59 | (((mode) == BOND_MODE_ACTIVEBACKUP) || \ |
60 | ((mode) == BOND_MODE_ROUNDROBIN)) | 60 | ((mode) == BOND_MODE_ROUNDROBIN)) |
61 | |||
62 | #define BOND_MODE_IS_LB(mode) \ | ||
63 | (((mode) == BOND_MODE_TLB) || \ | ||
64 | ((mode) == BOND_MODE_ALB)) | ||
65 | |||
61 | /* | 66 | /* |
62 | * Less bad way to call ioctl from within the kernel; this needs to be | 67 | * Less bad way to call ioctl from within the kernel; this needs to be |
63 | * done some other way to get the call out of interrupt context. | 68 | * done some other way to get the call out of interrupt context. |
@@ -259,8 +264,7 @@ static inline struct bonding *bond_get_bond_by_slave(struct slave *slave) | |||
259 | 264 | ||
260 | static inline bool bond_is_lb(const struct bonding *bond) | 265 | static inline bool bond_is_lb(const struct bonding *bond) |
261 | { | 266 | { |
262 | return (bond->params.mode == BOND_MODE_TLB || | 267 | return BOND_MODE_IS_LB(bond->params.mode); |
263 | bond->params.mode == BOND_MODE_ALB); | ||
264 | } | 268 | } |
265 | 269 | ||
266 | static inline void bond_set_active_slave(struct slave *slave) | 270 | static inline void bond_set_active_slave(struct slave *slave) |
@@ -422,6 +426,7 @@ void bond_setup(struct net_device *bond_dev); | |||
422 | unsigned int bond_get_num_tx_queues(void); | 426 | unsigned int bond_get_num_tx_queues(void); |
423 | int bond_netlink_init(void); | 427 | int bond_netlink_init(void); |
424 | void bond_netlink_fini(void); | 428 | void bond_netlink_fini(void); |
429 | int bond_option_mode_set(struct bonding *bond, int mode); | ||
425 | 430 | ||
426 | struct bond_net { | 431 | struct bond_net { |
427 | struct net * net; /* Associated network namespace */ | 432 | struct net * net; /* Associated network namespace */ |