netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net RESEND] bonding: don't change to 802.3ad mode while ARP monitoring is running
@ 2013-11-16  6:30 Ding Tianhong
  2013-11-18 17:44 ` Dan Williams
  0 siblings, 1 reply; 15+ messages in thread
From: Ding Tianhong @ 2013-11-16  6:30 UTC (permalink / raw)
  To: Jay Vosburgh, Andy Gospodarek, David S. Miller,
	Nikolay Aleksandrov, Veaceslav Falico, Netdev

Because the ARP monitoring is not support for 802.3ad, but I still
could change the mode to 802.3ad from ab mode while ARP monitoring
is running, it is incorrect.

So add a check for 802.3ad in bonding_store_mode to fix the problem,
and make a new macro BOND_NO_USES_ARP() to simplify the code.

Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
---
 drivers/net/bonding/bond_options.c | 2 +-
 drivers/net/bonding/bonding.h      | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index 9a5223c..abb4218 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -45,7 +45,7 @@ int bond_option_mode_set(struct bonding *bond, int mode)
 		return -EPERM;
 	}
 
-	if (BOND_MODE_IS_LB(mode) && bond->params.arp_interval) {
+	if (BOND_NO_USES_ARP(mode) && bond->params.arp_interval) {
 		pr_err("%s: %s mode is incompatible with arp monitoring.\n",
 		       bond->dev->name, bond_mode_tbl[mode].modename);
 		return -EINVAL;
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 046a605..e2c11cb 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -63,6 +63,10 @@
 		(((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))
 /*
  * Less bad way to call ioctl from within the kernel; this needs to be
  * done some other way to get the call out of interrupt context.
-- 
1.7.12

^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2013-11-28 23:20 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-16  6:30 [PATCH net RESEND] bonding: don't change to 802.3ad mode while ARP monitoring is running Ding Tianhong
2013-11-18 17:44 ` Dan Williams
2013-11-18 20:48   ` David Miller
2013-11-18 22:50     ` Dan Williams
2013-11-19  1:48       ` Ding Tianhong
2013-11-19  2:31       ` Andy Gospodarek
2013-11-19  3:02         ` Ding Tianhong
2013-11-22  2:12         ` [PATCH net v2] bonding: disable arp and enable mii monitoring when bond change to no uses arp mode Ding Tianhong
2013-11-22 13:55           ` Nikolay Aleksandrov
2013-11-22 14:12             ` Ding Tianhong
2013-11-22 13:36         ` [PATCH net RESEND] bonding: don't change to 802.3ad mode while ARP monitoring is running Nikolay Aleksandrov
2013-11-22 14:28         ` [PATCH net v3] bonding: disable arp and enable mii monitoring when bond change to no uses arp mode Ding Tianhong
2013-11-22 19:07           ` Dan Williams
2013-11-22 20:01           ` Nikolay Aleksandrov
2013-11-28 23:20           ` David Miller

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).