Lines Matching +full:port +full:- +full:mapping +full:- +full:mode

1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * include/linux/if_team.h - Network team device driver header
33 int index; /* index of enabled port. If disabled, it's set to -1 */
55 * become a port.
68 struct list_head qom_list; /* node in queue override mapping list */
75 return rcu_dereference(dev->rx_handler_data); in team_port_get_rcu()
78 static inline bool team_port_enabled(struct team_port *port) in team_port_enabled() argument
80 return port->index != -1; in team_port_enabled()
83 static inline bool team_port_txable(struct team_port *port) in team_port_txable() argument
85 return port->linkup && team_port_enabled(port); in team_port_txable()
90 struct team_port *port; in team_port_dev_txable() local
94 port = team_port_get_rcu(port_dev); in team_port_dev_txable()
95 txable = port ? team_port_txable(port) : false; in team_port_dev_txable()
102 static inline void team_netpoll_send_skb(struct team_port *port, in team_netpoll_send_skb() argument
105 netpoll_send_skb(port->np, skb); in team_netpoll_send_skb()
108 static inline void team_netpoll_send_skb(struct team_port *port, in team_netpoll_send_skb() argument
118 struct team_port *port,
121 int (*port_enter)(struct team *team, struct team_port *port);
122 void (*port_leave)(struct team *team, struct team_port *port);
123 void (*port_change_dev_addr)(struct team *team, struct team_port *port);
124 void (*port_enabled)(struct team *team, struct team_port *port);
125 void (*port_disabled)(struct team *team, struct team_port *port);
128 extern int team_modeop_port_enter(struct team *team, struct team_port *port);
130 struct team_port *port);
142 struct team_port *port; /* != NULL if per-port */ member
194 struct mutex lock; /* used for overall locking, e.g. port lists write */
207 const struct team_mode *mode; member
211 struct list_head *qom_lists; /* array of queue override mapping lists */
230 static inline int team_dev_queue_xmit(struct team *team, struct team_port *port, in team_dev_queue_xmit() argument
233 BUILD_BUG_ON(sizeof(skb->queue_mapping) != in team_dev_queue_xmit()
234 sizeof(qdisc_skb_cb(skb)->slave_dev_queue_mapping)); in team_dev_queue_xmit()
235 skb_set_queue_mapping(skb, qdisc_skb_cb(skb)->slave_dev_queue_mapping); in team_dev_queue_xmit()
237 skb->dev = port->dev; in team_dev_queue_xmit()
238 if (unlikely(netpoll_tx_running(team->dev))) { in team_dev_queue_xmit()
239 team_netpoll_send_skb(port, skb); in team_dev_queue_xmit()
248 return &team->en_port_hlist[port_index & (TEAM_PORT_HASHENTRIES - 1)]; in team_port_index_hash()
254 struct team_port *port; in team_get_port_by_index() local
257 hlist_for_each_entry(port, head, hlist) in team_get_port_by_index()
258 if (port->index == port_index) in team_get_port_by_index()
259 return port; in team_get_port_by_index()
265 int en_port_count = READ_ONCE(team->en_port_count); in team_num_to_port_index()
275 struct team_port *port; in team_get_port_by_index_rcu() local
278 hlist_for_each_entry_rcu(port, head, hlist) in team_get_port_by_index_rcu()
279 if (port->index == port_index) in team_get_port_by_index_rcu()
280 return port; in team_get_port_by_index_rcu()
285 team_get_first_port_txable_rcu(struct team *team, struct team_port *port) in team_get_first_port_txable_rcu() argument
289 if (likely(team_port_txable(port))) in team_get_first_port_txable_rcu()
290 return port; in team_get_first_port_txable_rcu()
291 cur = port; in team_get_first_port_txable_rcu()
292 list_for_each_entry_continue_rcu(cur, &team->port_list, list) in team_get_first_port_txable_rcu()
295 list_for_each_entry_rcu(cur, &team->port_list, list) { in team_get_first_port_txable_rcu()
296 if (cur == port) in team_get_first_port_txable_rcu()
310 extern int team_mode_register(const struct team_mode *mode);
311 extern void team_mode_unregister(const struct team_mode *mode);
316 #define MODULE_ALIAS_TEAM_MODE(kind) MODULE_ALIAS("team-mode-" kind)