aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVeaceslav Falico <vfalico@gmail.com>2014-05-15 15:39:53 -0400
committerDavid S. Miller <davem@davemloft.net>2014-05-16 16:34:32 -0400
commit267bed777a5f8a8f5acd50a9134c7341fc46d822 (patch)
treed80c9e21d1a2b5a64717ec41f9a86244f86c038a
parentd1e2e5cd4f8ed2ac7c43ce44feeb9ebc7d27cb4b (diff)
bonding: make BOND_NO_USES_ARP an inline function
Also, change its name to better reflect its scope, and skip the "no" part. CC: Jay Vosburgh <j.vosburgh@gmail.com> CC: Andy Gospodarek <andy@greyhouse.net> Signed-off-by: Veaceslav Falico <vfalico@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/bonding/bond_main.c2
-rw-r--r--drivers/net/bonding/bond_options.c2
-rw-r--r--drivers/net/bonding/bonding.h11
3 files changed, 8 insertions, 7 deletions
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 5c88c11a3ddd..2448e28f38bc 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4113,7 +4113,7 @@ static int bond_check_params(struct bond_params *params)
4113 } 4113 }
4114 4114
4115 /* reset values for 802.3ad/TLB/ALB */ 4115 /* reset values for 802.3ad/TLB/ALB */
4116 if (BOND_NO_USES_ARP(bond_mode)) { 4116 if (!bond_mode_uses_arp(bond_mode)) {
4117 if (!miimon) { 4117 if (!miimon) {
4118 pr_warn("Warning: miimon must be specified, otherwise bonding will not detect link failure, speed and duplex which are essential for 802.3ad operation\n"); 4118 pr_warn("Warning: miimon must be specified, otherwise bonding will not detect link failure, speed and duplex which are essential for 802.3ad operation\n");
4119 pr_warn("Forcing miimon to 100msec\n"); 4119 pr_warn("Forcing miimon to 100msec\n");
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index 6dc49da106d6..98c8801ddb67 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -672,7 +672,7 @@ const struct bond_option *bond_opt_get(unsigned int option)
672 672
673int bond_option_mode_set(struct bonding *bond, const struct bond_opt_value *newval) 673int bond_option_mode_set(struct bonding *bond, const struct bond_opt_value *newval)
674{ 674{
675 if (BOND_NO_USES_ARP(newval->value) && bond->params.arp_interval) { 675 if (!bond_mode_uses_arp(newval->value) && bond->params.arp_interval) {
676 pr_info("%s: %s mode is incompatible with arp monitoring, start mii monitoring\n", 676 pr_info("%s: %s mode is incompatible with arp monitoring, start mii monitoring\n",
677 bond->dev->name, newval->string); 677 bond->dev->name, newval->string);
678 /* disable arp monitoring */ 678 /* disable arp monitoring */
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index dca3dfdf42d3..105c552f96d8 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -60,11 +60,6 @@
60 ((mode) == BOND_MODE_TLB) || \ 60 ((mode) == BOND_MODE_TLB) || \
61 ((mode) == BOND_MODE_ALB)) 61 ((mode) == BOND_MODE_ALB))
62 62
63#define BOND_NO_USES_ARP(mode) \
64 (((mode) == BOND_MODE_8023AD) || \
65 ((mode) == BOND_MODE_TLB) || \
66 ((mode) == BOND_MODE_ALB))
67
68#define IS_IP_TARGET_UNUSABLE_ADDRESS(a) \ 63#define IS_IP_TARGET_UNUSABLE_ADDRESS(a) \
69 ((htonl(INADDR_BROADCAST) == a) || \ 64 ((htonl(INADDR_BROADCAST) == a) || \
70 ipv4_is_zeronet(a)) 65 ipv4_is_zeronet(a))
@@ -292,6 +287,12 @@ static inline bool bond_is_lb(const struct bonding *bond)
292 bond->params.mode == BOND_MODE_ALB; 287 bond->params.mode == BOND_MODE_ALB;
293} 288}
294 289
290static inline bool bond_mode_uses_arp(int mode)
291{
292 return mode != BOND_MODE_8023AD && mode != BOND_MODE_TLB &&
293 mode != BOND_MODE_ALB;
294}
295
295static inline void bond_set_active_slave(struct slave *slave) 296static inline void bond_set_active_slave(struct slave *slave)
296{ 297{
297 if (slave->backup) { 298 if (slave->backup) {