summaryrefslogtreecommitdiffstats
path: root/drivers/net/bonding/bond_options.c
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@redhat.com>2014-01-22 14:53:38 +0100
committerDavid S. Miller <davem@davemloft.net>2014-01-22 15:38:44 -0800
commit105c8fb6c55e9c5055798184cbb5ef61343139b4 (patch)
tree10ed2ce36463669b5404d871ded923884dd64ca4 /drivers/net/bonding/bond_options.c
parent3df011625135fa1c670cb8e24618fc7ca38e00b0 (diff)
downloadop-kernel-dev-105c8fb6c55e9c5055798184cbb5ef61343139b4.zip
op-kernel-dev-105c8fb6c55e9c5055798184cbb5ef61343139b4.tar.gz
bonding: convert resend_igmp to use the new option API
This patch adds the necessary changes so resend_igmp would use the new bonding option API. Signed-off-by: Nikolay Aleksandrov <nikolay@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/bonding/bond_options.c')
-rw-r--r--drivers/net/bonding/bond_options.c29
1 files changed, 19 insertions, 10 deletions
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index 7fafc34..1373093 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -111,6 +111,13 @@ static struct bond_opt_value bond_all_slaves_active_tbl[] = {
{ NULL, -1, 0}
};
+static struct bond_opt_value bond_resend_igmp_tbl[] = {
+ { "off", 0, 0},
+ { "maxval", 255, BOND_VALFLAG_MAX},
+ { "default", 1, BOND_VALFLAG_DEFAULT},
+ { NULL, -1, 0}
+};
+
static struct bond_option bond_opts[] = {
[BOND_OPT_MODE] = {
.id = BOND_OPT_MODE,
@@ -274,6 +281,13 @@ static struct bond_option bond_opts[] = {
.values = bond_all_slaves_active_tbl,
.set = bond_option_all_slaves_active_set
},
+ [BOND_OPT_RESEND_IGMP] = {
+ .id = BOND_OPT_RESEND_IGMP,
+ .name = "resend_igmp",
+ .desc = "Number of IGMP membership reports to send on link failure",
+ .values = bond_resend_igmp_tbl,
+ .set = bond_option_resend_igmp_set
+ },
{ }
};
@@ -1038,17 +1052,12 @@ int bond_option_xmit_hash_policy_set(struct bonding *bond,
return 0;
}
-int bond_option_resend_igmp_set(struct bonding *bond, int resend_igmp)
+int bond_option_resend_igmp_set(struct bonding *bond,
+ struct bond_opt_value *newval)
{
- if (resend_igmp < 0 || resend_igmp > 255) {
- pr_err("%s: Invalid resend_igmp value %d not in range 0-255; rejected.\n",
- bond->dev->name, resend_igmp);
- return -EINVAL;
- }
-
- bond->params.resend_igmp = resend_igmp;
- pr_info("%s: Setting resend_igmp to %d.\n",
- bond->dev->name, resend_igmp);
+ pr_info("%s: Setting resend_igmp to %llu.\n",
+ bond->dev->name, newval->value);
+ bond->params.resend_igmp = newval->value;
return 0;
}
OpenPOWER on IntegriCloud