aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/if_team.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/if_team.h')
-rw-r--r--include/linux/if_team.h41
1 files changed, 24 insertions, 17 deletions
diff --git a/include/linux/if_team.h b/include/linux/if_team.h
index 6960fc1841a7..6d88a7f57680 100644
--- a/include/linux/if_team.h
+++ b/include/linux/if_team.h
@@ -67,6 +67,9 @@ struct team_port {
67 struct netpoll *np; 67 struct netpoll *np;
68#endif 68#endif
69 69
70 s32 priority; /* lower number ~ higher priority */
71 u16 queue_id;
72 struct list_head qom_list; /* node in queue override mapping list */
70 long mode_priv[0]; 73 long mode_priv[0];
71}; 74};
72 75
@@ -96,21 +99,6 @@ static inline void team_netpoll_send_skb(struct team_port *port,
96} 99}
97#endif 100#endif
98 101
99static inline int team_dev_queue_xmit(struct team *team, struct team_port *port,
100 struct sk_buff *skb)
101{
102 BUILD_BUG_ON(sizeof(skb->queue_mapping) !=
103 sizeof(qdisc_skb_cb(skb)->slave_dev_queue_mapping));
104 skb_set_queue_mapping(skb, qdisc_skb_cb(skb)->slave_dev_queue_mapping);
105
106 skb->dev = port->dev;
107 if (unlikely(netpoll_tx_running(port->dev))) {
108 team_netpoll_send_skb(port, skb);
109 return 0;
110 }
111 return dev_queue_xmit(skb);
112}
113
114struct team_mode_ops { 102struct team_mode_ops {
115 int (*init)(struct team *team); 103 int (*init)(struct team *team);
116 void (*exit)(struct team *team); 104 void (*exit)(struct team *team);
@@ -120,7 +108,7 @@ struct team_mode_ops {
120 bool (*transmit)(struct team *team, struct sk_buff *skb); 108 bool (*transmit)(struct team *team, struct sk_buff *skb);
121 int (*port_enter)(struct team *team, struct team_port *port); 109 int (*port_enter)(struct team *team, struct team_port *port);
122 void (*port_leave)(struct team *team, struct team_port *port); 110 void (*port_leave)(struct team *team, struct team_port *port);
123 void (*port_change_mac)(struct team *team, struct team_port *port); 111 void (*port_change_dev_addr)(struct team *team, struct team_port *port);
124 void (*port_enabled)(struct team *team, struct team_port *port); 112 void (*port_enabled)(struct team *team, struct team_port *port);
125 void (*port_disabled)(struct team *team, struct team_port *port); 113 void (*port_disabled)(struct team *team, struct team_port *port);
126}; 114};
@@ -130,6 +118,7 @@ enum team_option_type {
130 TEAM_OPTION_TYPE_STRING, 118 TEAM_OPTION_TYPE_STRING,
131 TEAM_OPTION_TYPE_BINARY, 119 TEAM_OPTION_TYPE_BINARY,
132 TEAM_OPTION_TYPE_BOOL, 120 TEAM_OPTION_TYPE_BOOL,
121 TEAM_OPTION_TYPE_S32,
133}; 122};
134 123
135struct team_option_inst_info { 124struct team_option_inst_info {
@@ -146,6 +135,7 @@ struct team_gsetter_ctx {
146 u32 len; 135 u32 len;
147 } bin_val; 136 } bin_val;
148 bool bool_val; 137 bool bool_val;
138 s32 s32_val;
149 } data; 139 } data;
150 struct team_option_inst_info *info; 140 struct team_option_inst_info *info;
151}; 141};
@@ -197,9 +187,26 @@ struct team {
197 187
198 const struct team_mode *mode; 188 const struct team_mode *mode;
199 struct team_mode_ops ops; 189 struct team_mode_ops ops;
190 bool queue_override_enabled;
191 struct list_head *qom_lists; /* array of queue override mapping lists */
200 long mode_priv[TEAM_MODE_PRIV_LONGS]; 192 long mode_priv[TEAM_MODE_PRIV_LONGS];
201}; 193};
202 194
195static inline int team_dev_queue_xmit(struct team *team, struct team_port *port,
196 struct sk_buff *skb)
197{
198 BUILD_BUG_ON(sizeof(skb->queue_mapping) !=
199 sizeof(qdisc_skb_cb(skb)->slave_dev_queue_mapping));
200 skb_set_queue_mapping(skb, qdisc_skb_cb(skb)->slave_dev_queue_mapping);
201
202 skb->dev = port->dev;
203 if (unlikely(netpoll_tx_running(team->dev))) {
204 team_netpoll_send_skb(port, skb);
205 return 0;
206 }
207 return dev_queue_xmit(skb);
208}
209
203static inline struct hlist_head *team_port_index_hash(struct team *team, 210static inline struct hlist_head *team_port_index_hash(struct team *team,
204 int port_index) 211 int port_index)
205{ 212{
@@ -231,7 +238,7 @@ static inline struct team_port *team_get_port_by_index_rcu(struct team *team,
231 return NULL; 238 return NULL;
232} 239}
233 240
234extern int team_port_set_team_mac(struct team_port *port); 241extern int team_port_set_team_dev_addr(struct team_port *port);
235extern int team_options_register(struct team *team, 242extern int team_options_register(struct team *team,
236 const struct team_option *option, 243 const struct team_option *option,
237 size_t option_count); 244 size_t option_count);