diff options
author | Jiri Pirko <jiri@resnulli.us> | 2012-07-27 02:28:54 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-08-03 23:40:12 -0400 |
commit | a86fc6b7d603992070c04bd7a8c217d55688b077 (patch) | |
tree | a8b26b7ec12de9d59f3a0ffcd8d2ecccd1ab9d2e /drivers/net/team | |
parent | 69821638b27407d8648cb04de01b06b30a291bde (diff) |
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.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/drivers/net/team/team.c b/drivers/net/team/team.c index 70752e631a12..a30b7c1bd9f6 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, | |||
1092 | return 0; | 1092 | return 0; |
1093 | } | 1093 | } |
1094 | 1094 | ||
1095 | static int team_priority_option_get(struct team *team, | ||
1096 | struct team_gsetter_ctx *ctx) | ||
1097 | { | ||
1098 | struct team_port *port = ctx->info->port; | ||
1099 | |||
1100 | ctx->data.s32_val = port->priority; | ||
1101 | return 0; | ||
1102 | } | ||
1103 | |||
1104 | static int team_priority_option_set(struct team *team, | ||
1105 | struct team_gsetter_ctx *ctx) | ||
1106 | { | ||
1107 | struct team_port *port = ctx->info->port; | ||
1108 | |||
1109 | port->priority = ctx->data.s32_val; | ||
1110 | return 0; | ||
1111 | } | ||
1112 | |||
1095 | static const struct team_option team_options[] = { | 1113 | static const struct team_option team_options[] = { |
1096 | { | 1114 | { |
1097 | .name = "mode", | 1115 | .name = "mode", |
@@ -1120,6 +1138,13 @@ static const struct team_option team_options[] = { | |||
1120 | .getter = team_user_linkup_en_option_get, | 1138 | .getter = team_user_linkup_en_option_get, |
1121 | .setter = team_user_linkup_en_option_set, | 1139 | .setter = team_user_linkup_en_option_set, |
1122 | }, | 1140 | }, |
1141 | { | ||
1142 | .name = "priority", | ||
1143 | .type = TEAM_OPTION_TYPE_S32, | ||
1144 | .per_port = true, | ||
1145 | .getter = team_priority_option_get, | ||
1146 | .setter = team_priority_option_set, | ||
1147 | }, | ||
1123 | }; | 1148 | }; |
1124 | 1149 | ||
1125 | static struct lock_class_key team_netdev_xmit_lock_key; | 1150 | static struct lock_class_key team_netdev_xmit_lock_key; |