summaryrefslogtreecommitdiff
path: root/include/linux/if_team.h
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2012-04-10 09:15:42 +0400
committerDavid S. Miller <davem@davemloft.net>2012-04-11 18:03:51 +0400
commit80f7c6683fe0e891ef1db7c967d538b5fdddd22c (patch)
tree7252117971ea67654ede4e716b771bb1fe824e36 /include/linux/if_team.h
parent7a5cc24277b57ce38eb0afa6634b71d4d5cc671e (diff)
downloadlinux-80f7c6683fe0e891ef1db7c967d538b5fdddd22c.tar.xz
team: add support for per-port options
This patch allows to create per-port options. That becomes handy for all sorts of stuff, for example for userspace driven link-state, 802.3ad implementation and so on. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/if_team.h')
-rw-r--r--include/linux/if_team.h30
1 files changed, 17 insertions, 13 deletions
diff --git a/include/linux/if_team.h b/include/linux/if_team.h
index 41163ac14ab4..6f27c841c9a8 100644
--- a/include/linux/if_team.h
+++ b/include/linux/if_team.h
@@ -71,25 +71,27 @@ enum team_option_type {
TEAM_OPTION_TYPE_BINARY,
};
+struct team_gsetter_ctx {
+ union {
+ u32 u32_val;
+ const char *str_val;
+ struct {
+ const void *ptr;
+ u32 len;
+ } bin_val;
+ } data;
+ struct team_port *port;
+};
+
struct team_option {
struct list_head list;
const char *name;
+ bool per_port;
enum team_option_type type;
- int (*getter)(struct team *team, void *arg);
- int (*setter)(struct team *team, void *arg);
-
- /* Custom gennetlink interface related flags */
- bool changed;
- bool removed;
+ int (*getter)(struct team *team, struct team_gsetter_ctx *ctx);
+ int (*setter)(struct team *team, struct team_gsetter_ctx *ctx);
};
-struct team_option_binary {
- u32 data_len;
- void *data;
-};
-
-#define team_optarg_tbinary(arg) (*((struct team_option_binary **) arg))
-
struct team_mode {
struct list_head list;
const char *kind;
@@ -118,6 +120,7 @@ struct team {
struct list_head port_list;
struct list_head option_list;
+ struct list_head option_inst_list; /* list of option instances */
const struct team_mode *mode;
struct team_mode_ops ops;
@@ -224,6 +227,7 @@ enum {
TEAM_ATTR_OPTION_TYPE, /* u8 */
TEAM_ATTR_OPTION_DATA, /* dynamic */
TEAM_ATTR_OPTION_REMOVED, /* flag */
+ TEAM_ATTR_OPTION_PORT_IFINDEX, /* u32 */ /* for per-port options */
__TEAM_ATTR_OPTION_MAX,
TEAM_ATTR_OPTION_MAX = __TEAM_ATTR_OPTION_MAX - 1,