From: Veaceslav Falico <vfalico@gmail.com>
To: netdev@vger.kernel.org
Cc: Veaceslav Falico <vfalico@gmail.com>,
Jay Vosburgh <j.vosburgh@gmail.com>,
Andy Gospodarek <andy@greyhouse.net>
Subject: [PATCH v3 net-next 3/9] bonding: make BOND_NO_USES_ARP an inline function
Date: Thu, 15 May 2014 21:39:53 +0200 [thread overview]
Message-ID: <1400182799-22737-4-git-send-email-vfalico@gmail.com> (raw)
In-Reply-To: <1400182799-22737-1-git-send-email-vfalico@gmail.com>
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>
---
drivers/net/bonding/bond_main.c | 2 +-
drivers/net/bonding/bond_options.c | 2 +-
drivers/net/bonding/bonding.h | 11 ++++++-----
3 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 5c88c11..2448e28 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)
}
/* reset values for 802.3ad/TLB/ALB */
- if (BOND_NO_USES_ARP(bond_mode)) {
+ if (!bond_mode_uses_arp(bond_mode)) {
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("Forcing miimon to 100msec\n");
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index 6dc49da..98c8801 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)
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",
bond->dev->name, newval->string);
/* disable arp monitoring */
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index dca3dfd..105c552 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -60,11 +60,6 @@
((mode) == BOND_MODE_TLB) || \
((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) \
((htonl(INADDR_BROADCAST) == a) || \
ipv4_is_zeronet(a))
@@ -292,6 +287,12 @@ static inline bool bond_is_lb(const struct bonding *bond)
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)
{
if (slave->backup) {
--
1.8.4
next prev parent reply other threads:[~2014-05-15 19:44 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-15 19:39 [PATCH v3 net-next 0/9] bonding: simple macro cleanup Veaceslav Falico
2014-05-15 19:39 ` [PATCH v3 net-next 1/9] bonding: remove BOND_MODE_IS_LB macro Veaceslav Falico
2014-05-15 19:39 ` [PATCH v3 net-next 2/9] bonding: make TX_QUEUE_OVERRIDE() macro an inline function Veaceslav Falico
2014-05-15 19:39 ` Veaceslav Falico [this message]
2014-05-15 19:39 ` [PATCH v3 net-next 4/9] bonding: make USES_PRIMARY inline functions Veaceslav Falico
2014-05-15 19:39 ` [PATCH v3 net-next 5/9] bonding: create a macro for bond mode and use it Veaceslav Falico
2014-05-15 19:39 ` [PATCH v3 net-next 6/9] bonding: make IS_IP_TARGET_UNUSABLE_ADDRESS an inline function Veaceslav Falico
2014-05-15 19:39 ` [PATCH v3 net-next 7/9] bonding: convert IS_UP(slave->dev) to " Veaceslav Falico
2014-05-15 19:39 ` [PATCH v3 net-next 8/9] bonding: rename {,bond_}slave_can_tx and clean it up Veaceslav Falico
2014-05-15 19:39 ` [PATCH v3 net-next 9/9] bonding: replace SLAVE_IS_OK() with bond_slave_can_tx() Veaceslav Falico
2014-05-16 20:35 ` [PATCH v3 net-next 0/9] bonding: simple macro cleanup David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1400182799-22737-4-git-send-email-vfalico@gmail.com \
--to=vfalico@gmail.com \
--cc=andy@greyhouse.net \
--cc=j.vosburgh@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).