Commit a86fc6b7 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

team: add per port priority option

Allow userspace to set port priority.
Signed-off-by: default avatarJiri Pirko <jiri@resnulli.us>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 69821638
...@@ -1092,6 +1092,24 @@ static int team_user_linkup_en_option_set(struct team *team, ...@@ -1092,6 +1092,24 @@ static int team_user_linkup_en_option_set(struct team *team,
return 0; 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[] = { static const struct team_option team_options[] = {
{ {
.name = "mode", .name = "mode",
...@@ -1120,6 +1138,13 @@ static const struct team_option team_options[] = { ...@@ -1120,6 +1138,13 @@ static const struct team_option team_options[] = {
.getter = team_user_linkup_en_option_get, .getter = team_user_linkup_en_option_get,
.setter = team_user_linkup_en_option_set, .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; static struct lock_class_key team_netdev_xmit_lock_key;
......
...@@ -67,6 +67,7 @@ struct team_port { ...@@ -67,6 +67,7 @@ struct team_port {
struct netpoll *np; struct netpoll *np;
#endif #endif
s32 priority; /* lower number ~ higher priority */
long mode_priv[0]; long mode_priv[0];
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment