summaryrefslogtreecommitdiff
path: root/drivers/net/bonding/bond_options.c
diff options
context:
space:
mode:
authorNikolay Aleksandrov <nikolay@redhat.com>2014-01-22 14:53:30 +0100
committerDavid S. Miller <davem@davemloft.net>2014-01-22 15:38:43 -0800
commitef56becbb37251f0371ad94210f50dc90e18830a (patch)
treed657b18b30389725142a2df35c8ba2ddefaae636 /drivers/net/bonding/bond_options.c
parent9e5f5eebe765b340af0318dba261e5de0f2aaf32 (diff)
bonding: convert num_peer_notif to use the new option API
This patch adds the necessary changes so num_peer_notif would use the new bonding option API. When the auto-sysfs generation is done an alias should be added for this option as there're currently 2 entries in sysfs for it. 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.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/net/bonding/bond_options.c b/drivers/net/bonding/bond_options.c
index 081ab9b5d48a..1bd19f1f1af2 100644
--- a/drivers/net/bonding/bond_options.c
+++ b/drivers/net/bonding/bond_options.c
@@ -85,6 +85,13 @@ static struct bond_opt_value bond_ad_select_tbl[] = {
{ NULL, -1, 0},
};
+static struct bond_opt_value bond_num_peer_notif_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,
@@ -186,6 +193,13 @@ static struct bond_option bond_opts[] = {
.values = bond_ad_select_tbl,
.set = bond_option_ad_select_set
},
+ [BOND_OPT_NUM_PEER_NOTIF] = {
+ .id = BOND_OPT_NUM_PEER_NOTIF,
+ .name = "num_unsol_na",
+ .desc = "Number of peer notifications to send on failover event",
+ .values = bond_num_peer_notif_tbl,
+ .set = bond_option_num_peer_notif_set
+ },
{ }
};
@@ -977,9 +991,11 @@ int bond_option_resend_igmp_set(struct bonding *bond, int resend_igmp)
return 0;
}
-int bond_option_num_peer_notif_set(struct bonding *bond, int num_peer_notif)
+int bond_option_num_peer_notif_set(struct bonding *bond,
+ struct bond_opt_value *newval)
{
- bond->params.num_peer_notif = num_peer_notif;
+ bond->params.num_peer_notif = newval->value;
+
return 0;
}