Commit 267bed77 authored by Veaceslav Falico's avatar Veaceslav Falico Committed by David S. Miller

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: default avatarVeaceslav Falico <vfalico@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent d1e2e5cd
...@@ -4113,7 +4113,7 @@ static int bond_check_params(struct bond_params *params) ...@@ -4113,7 +4113,7 @@ static int bond_check_params(struct bond_params *params)
} }
/* reset values for 802.3ad/TLB/ALB */ /* reset values for 802.3ad/TLB/ALB */
if (BOND_NO_USES_ARP(bond_mode)) { if (!bond_mode_uses_arp(bond_mode)) {
if (!miimon) { if (!miimon) {
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"); 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");
pr_warn("Forcing miimon to 100msec\n"); pr_warn("Forcing miimon to 100msec\n");
......
...@@ -672,7 +672,7 @@ const struct bond_option *bond_opt_get(unsigned int option) ...@@ -672,7 +672,7 @@ const struct bond_option *bond_opt_get(unsigned int option)
int bond_option_mode_set(struct bonding *bond, const struct bond_opt_value *newval) int bond_option_mode_set(struct bonding *bond, const struct bond_opt_value *newval)
{ {
if (BOND_NO_USES_ARP(newval->value) && bond->params.arp_interval) { if (!bond_mode_uses_arp(newval->value) && bond->params.arp_interval) {
pr_info("%s: %s mode is incompatible with arp monitoring, start mii monitoring\n", pr_info("%s: %s mode is incompatible with arp monitoring, start mii monitoring\n",
bond->dev->name, newval->string); bond->dev->name, newval->string);
/* disable arp monitoring */ /* disable arp monitoring */
......
...@@ -60,11 +60,6 @@ ...@@ -60,11 +60,6 @@
((mode) == BOND_MODE_TLB) || \ ((mode) == BOND_MODE_TLB) || \
((mode) == BOND_MODE_ALB)) ((mode) == BOND_MODE_ALB))
#define BOND_NO_USES_ARP(mode) \
(((mode) == BOND_MODE_8023AD) || \
((mode) == BOND_MODE_TLB) || \
((mode) == BOND_MODE_ALB))
#define IS_IP_TARGET_UNUSABLE_ADDRESS(a) \ #define IS_IP_TARGET_UNUSABLE_ADDRESS(a) \
((htonl(INADDR_BROADCAST) == a) || \ ((htonl(INADDR_BROADCAST) == a) || \
ipv4_is_zeronet(a)) ipv4_is_zeronet(a))
...@@ -292,6 +287,12 @@ static inline bool bond_is_lb(const struct bonding *bond) ...@@ -292,6 +287,12 @@ static inline bool bond_is_lb(const struct bonding *bond)
bond->params.mode == BOND_MODE_ALB; bond->params.mode == BOND_MODE_ALB;
} }
static inline bool bond_mode_uses_arp(int mode)
{
return mode != BOND_MODE_8023AD && mode != BOND_MODE_TLB &&
mode != BOND_MODE_ALB;
}
static inline void bond_set_active_slave(struct slave *slave) static inline void bond_set_active_slave(struct slave *slave)
{ {
if (slave->backup) { if (slave->backup) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment