Message ID | 5285F12A.6030307@huawei.com |
---|---|
State | Changes Requested, archived |
Delegated to: | David Miller |
Headers | show |
From: Ding Tianhong <dingtianhong@huawei.com> Date: Fri, 15 Nov 2013 18:02:18 +0800 > Because the ARP monitor is not support for 802.3ad, but We still ^^^^^^^ "supported" No need to capitalize "We". > could change the mode to 802.3ad from ab mode while ARP monirot ^^^^^^^ "monitor" > is running, it is incorrect. > > So add a check for 802.3ad in bonding_store_mode to fix the problem, > and make a micro program to simplify the code. What is a "micro program"? -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
δΊ 2013/11/16 9:40, David Miller ει: > From: Ding Tianhong <dingtianhong@huawei.com> > Date: Fri, 15 Nov 2013 18:02:18 +0800 > >> Because the ARP monitor is not support for 802.3ad, but We still > ^^^^^^^ > > "supported" > > No need to capitalize "We". > >> could change the mode to 802.3ad from ab mode while ARP monirot > ^^^^^^^ > > "monitor" > >> is running, it is incorrect. >> >> So add a check for 802.3ad in bonding_store_mode to fix the problem, >> and make a micro program to simplify the code. > What is a "micro program"? sorry, not review the changelog yet,I will resend it and it will not be happend again. Regards Ding > -- > To unsubscribe from this list: send the line "unsubscribe netdev" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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.
Because the ARP monitor is not support for 802.3ad, but We still could change the mode to 802.3ad from ab mode while ARP monirot is running, it is incorrect. So add a check for 802.3ad in bonding_store_mode to fix the problem, and make a micro program 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(-)