summaryrefslogtreecommitdiffstats
path: root/drivers/net/team
diff options
context:
space:
mode:
authorJiri Pirko <jiri@resnulli.us>2012-07-27 06:28:54 +0000
committerDavid S. Miller <davem@davemloft.net>2012-08-03 20:40:12 -0700
commita86fc6b7d603992070c04bd7a8c217d55688b077 (patch)
treea8b26b7ec12de9d59f3a0ffcd8d2ecccd1ab9d2e /drivers/net/team
parent69821638b27407d8648cb04de01b06b30a291bde (diff)
downloadop-kernel-dev-a86fc6b7d603992070c04bd7a8c217d55688b077.zip
op-kernel-dev-a86fc6b7d603992070c04bd7a8c217d55688b077.tar.gz
team: add per port priority option
Allow userspace to set port priority. Signed-off-by: Jiri Pirko <jiri@resnulli.us> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/team')
-rw-r--r--drivers/net/team/team.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c
index 70752e6..a30b7c1 100644
--- a/drivers/net/team/team.c
+++ b/drivers/net/team/team.c
@@ -1092,6 +1092,24 @@ static int team_user_linkup_en_option_set(struct team *team,
return 0;
}
+static int team_priority_option_get(struct team *team,
+ struct team_gsetter_ctx *ctx)
+{
+ struct team_port *port = ctx->info->port;
+
+ ctx->data.s32_val = port->priority;
+ return 0;
+}
+
+static int team_priority_option_set(struct team *team,
+ struct team_gsetter_ctx *ctx)
+{
+ struct team_port *port = ctx->info->port;
+
+ port->priority = ctx->data.s32_val;
+ return 0;
+}
+
static const struct team_option team_options[] = {
{
.name = "mode",
@@ -1120,6 +1138,13 @@ static const struct team_option team_options[] = {
.getter = team_user_linkup_en_option_get,
.setter = team_user_linkup_en_option_set,
},
+ {
+ .name = "priority",
+ .type = TEAM_OPTION_TYPE_S32,
+ .per_port = true,
+ .getter = team_priority_option_get,
+ .setter = team_priority_option_set,
+ },
};
static struct lock_class_key team_netdev_xmit_lock_key;
OpenPOWER on IntegriCloud