Lines Matching full:net
2 * net/tipc/bcast.c: TIPC broadcast code
77 static struct tipc_bc_base *tipc_bc_base(struct net *net) in tipc_bc_base() argument
79 return tipc_net(net)->bcbase; in tipc_bc_base()
86 int tipc_bcast_get_mtu(struct net *net) in tipc_bcast_get_mtu() argument
88 return tipc_link_mss(tipc_bc_sndlink(net)); in tipc_bcast_get_mtu()
91 void tipc_bcast_toggle_rcast(struct net *net, bool supp) in tipc_bcast_toggle_rcast() argument
93 tipc_bc_base(net)->rcast_support = supp; in tipc_bcast_toggle_rcast()
96 static void tipc_bcbase_calc_bc_threshold(struct net *net) in tipc_bcbase_calc_bc_threshold() argument
98 struct tipc_bc_base *bb = tipc_bc_base(net); in tipc_bcbase_calc_bc_threshold()
99 int cluster_size = tipc_link_bc_peers(tipc_bc_sndlink(net)); in tipc_bcbase_calc_bc_threshold()
107 static void tipc_bcbase_select_primary(struct net *net) in tipc_bcbase_select_primary() argument
109 struct tipc_bc_base *bb = tipc_bc_base(net); in tipc_bcbase_select_primary()
125 mtu = tipc_bearer_mtu(net, i); in tipc_bcbase_select_primary()
132 bb->bcast_support &= tipc_bearer_bcast_support(net, i); in tipc_bcbase_select_primary()
139 if ((i ^ tipc_own_addr(net)) & 1) in tipc_bcbase_select_primary()
144 bb->bcast_support = tipc_bearer_bcast_support(net, prim); in tipc_bcbase_select_primary()
147 void tipc_bcast_inc_bearer_dst_cnt(struct net *net, int bearer_id) in tipc_bcast_inc_bearer_dst_cnt() argument
149 struct tipc_bc_base *bb = tipc_bc_base(net); in tipc_bcast_inc_bearer_dst_cnt()
151 tipc_bcast_lock(net); in tipc_bcast_inc_bearer_dst_cnt()
153 tipc_bcbase_select_primary(net); in tipc_bcast_inc_bearer_dst_cnt()
154 tipc_bcast_unlock(net); in tipc_bcast_inc_bearer_dst_cnt()
157 void tipc_bcast_dec_bearer_dst_cnt(struct net *net, int bearer_id) in tipc_bcast_dec_bearer_dst_cnt() argument
159 struct tipc_bc_base *bb = tipc_bc_base(net); in tipc_bcast_dec_bearer_dst_cnt()
161 tipc_bcast_lock(net); in tipc_bcast_dec_bearer_dst_cnt()
163 tipc_bcbase_select_primary(net); in tipc_bcast_dec_bearer_dst_cnt()
164 tipc_bcast_unlock(net); in tipc_bcast_dec_bearer_dst_cnt()
177 static void tipc_bcbase_xmit(struct net *net, struct sk_buff_head *xmitq) in tipc_bcbase_xmit() argument
180 struct tipc_bc_base *bb = tipc_bc_base(net); in tipc_bcbase_xmit()
190 tipc_bearer_bc_xmit(net, bearer_id, xmitq); in tipc_bcbase_xmit()
206 tipc_bearer_bc_xmit(net, bearer_id, &_xmitq); in tipc_bcbase_xmit()
212 static void tipc_bcast_select_xmit_method(struct net *net, int dests, in tipc_bcast_select_xmit_method() argument
215 struct tipc_bc_base *bb = tipc_bc_base(net); in tipc_bcast_select_xmit_method()
233 if (!(tipc_net(net)->capabilities & TIPC_MCAST_RBCTL) && in tipc_bcast_select_xmit_method()
253 * @net: the applicable net namespace
259 int tipc_bcast_xmit(struct net *net, struct sk_buff_head *pkts, in tipc_bcast_xmit() argument
262 struct tipc_link *l = tipc_bc_sndlink(net); in tipc_bcast_xmit()
267 tipc_bcast_lock(net); in tipc_bcast_xmit()
270 tipc_bcast_unlock(net); in tipc_bcast_xmit()
271 tipc_bcbase_xmit(net, &xmitq); in tipc_bcast_xmit()
281 * @net: the applicable net namespace
288 static int tipc_rcast_xmit(struct net *net, struct sk_buff_head *pkts, in tipc_rcast_xmit() argument
304 if (tipc_node_xmit(net, &_pkts, dnode, selector) == -ELINKCONG) in tipc_rcast_xmit()
311 * @net: the applicable net namespace
317 static int tipc_mcast_send_sync(struct net *net, struct sk_buff *skb, in tipc_mcast_send_sync() argument
328 if (!(tipc_net(net)->capabilities & TIPC_MCAST_RBCTL)) in tipc_mcast_send_sync()
358 rc = tipc_bcast_xmit(net, &tmpq, &cong_link_cnt); in tipc_mcast_send_sync()
360 rc = tipc_rcast_xmit(net, &tmpq, dests, &cong_link_cnt); in tipc_mcast_send_sync()
370 * @net: the applicable net namespace
378 int tipc_mcast_xmit(struct net *net, struct sk_buff_head *pkts, in tipc_mcast_xmit() argument
398 tipc_bcast_select_xmit_method(net, dests->remote, method); in tipc_mcast_xmit()
408 rc = tipc_mcast_send_sync(net, skb, method, dests); in tipc_mcast_xmit()
417 rc = tipc_rcast_xmit(net, pkts, dests, cong_link_cnt); in tipc_mcast_xmit()
419 rc = tipc_bcast_xmit(net, pkts, cong_link_cnt); in tipc_mcast_xmit()
423 tipc_loopback_trace(net, &localq); in tipc_mcast_xmit()
424 tipc_sk_mcast_rcv(net, &localq, &inputq); in tipc_mcast_xmit()
436 int tipc_bcast_rcv(struct net *net, struct tipc_link *l, struct sk_buff *skb) in tipc_bcast_rcv() argument
439 struct sk_buff_head *inputq = &tipc_bc_base(net)->inputq; in tipc_bcast_rcv()
445 if (msg_mc_netid(hdr) != tipc_netid(net) || !tipc_link_is_up(l)) { in tipc_bcast_rcv()
450 tipc_bcast_lock(net); in tipc_bcast_rcv()
455 tipc_bcast_unlock(net); in tipc_bcast_rcv()
457 tipc_bcbase_xmit(net, &xmitq); in tipc_bcast_rcv()
461 tipc_sk_rcv(net, inputq); in tipc_bcast_rcv()
470 void tipc_bcast_ack_rcv(struct net *net, struct tipc_link *l, in tipc_bcast_ack_rcv() argument
473 struct sk_buff_head *inputq = &tipc_bc_base(net)->inputq; in tipc_bcast_ack_rcv()
483 tipc_bcast_lock(net); in tipc_bcast_ack_rcv()
485 tipc_bcast_unlock(net); in tipc_bcast_ack_rcv()
487 tipc_bcbase_xmit(net, &xmitq); in tipc_bcast_ack_rcv()
491 tipc_sk_rcv(net, inputq); in tipc_bcast_ack_rcv()
498 int tipc_bcast_sync_rcv(struct net *net, struct tipc_link *l, in tipc_bcast_sync_rcv() argument
502 struct sk_buff_head *inputq = &tipc_bc_base(net)->inputq; in tipc_bcast_sync_rcv()
509 tipc_bcast_lock(net); in tipc_bcast_sync_rcv()
521 tipc_bcast_unlock(net); in tipc_bcast_sync_rcv()
523 tipc_bcbase_xmit(net, &xmitq); in tipc_bcast_sync_rcv()
527 tipc_sk_rcv(net, inputq); in tipc_bcast_sync_rcv()
535 void tipc_bcast_add_peer(struct net *net, struct tipc_link *uc_l, in tipc_bcast_add_peer() argument
538 struct tipc_link *snd_l = tipc_bc_sndlink(net); in tipc_bcast_add_peer()
540 tipc_bcast_lock(net); in tipc_bcast_add_peer()
542 tipc_bcbase_select_primary(net); in tipc_bcast_add_peer()
543 tipc_bcbase_calc_bc_threshold(net); in tipc_bcast_add_peer()
544 tipc_bcast_unlock(net); in tipc_bcast_add_peer()
551 void tipc_bcast_remove_peer(struct net *net, struct tipc_link *rcv_l) in tipc_bcast_remove_peer() argument
553 struct tipc_link *snd_l = tipc_bc_sndlink(net); in tipc_bcast_remove_peer()
554 struct sk_buff_head *inputq = &tipc_bc_base(net)->inputq; in tipc_bcast_remove_peer()
559 tipc_bcast_lock(net); in tipc_bcast_remove_peer()
561 tipc_bcbase_select_primary(net); in tipc_bcast_remove_peer()
562 tipc_bcbase_calc_bc_threshold(net); in tipc_bcast_remove_peer()
563 tipc_bcast_unlock(net); in tipc_bcast_remove_peer()
565 tipc_bcbase_xmit(net, &xmitq); in tipc_bcast_remove_peer()
569 tipc_sk_rcv(net, inputq); in tipc_bcast_remove_peer()
572 int tipc_bclink_reset_stats(struct net *net, struct tipc_link *l) in tipc_bclink_reset_stats() argument
577 tipc_bcast_lock(net); in tipc_bclink_reset_stats()
579 tipc_bcast_unlock(net); in tipc_bclink_reset_stats()
583 static int tipc_bc_link_set_queue_limits(struct net *net, u32 max_win) in tipc_bc_link_set_queue_limits() argument
585 struct tipc_link *l = tipc_bc_sndlink(net); in tipc_bc_link_set_queue_limits()
593 tipc_bcast_lock(net); in tipc_bc_link_set_queue_limits()
595 tipc_bcast_unlock(net); in tipc_bc_link_set_queue_limits()
599 static int tipc_bc_link_set_broadcast_mode(struct net *net, u32 bc_mode) in tipc_bc_link_set_broadcast_mode() argument
601 struct tipc_bc_base *bb = tipc_bc_base(net); in tipc_bc_link_set_broadcast_mode()
632 static int tipc_bc_link_set_broadcast_ratio(struct net *net, u32 bc_ratio) in tipc_bc_link_set_broadcast_ratio() argument
634 struct tipc_bc_base *bb = tipc_bc_base(net); in tipc_bc_link_set_broadcast_ratio()
643 tipc_bcast_lock(net); in tipc_bc_link_set_broadcast_ratio()
644 tipc_bcbase_calc_bc_threshold(net); in tipc_bc_link_set_broadcast_ratio()
645 tipc_bcast_unlock(net); in tipc_bc_link_set_broadcast_ratio()
650 int tipc_nl_bc_link_set(struct net *net, struct nlattr *attrs[]) in tipc_nl_bc_link_set() argument
673 err = tipc_bc_link_set_broadcast_mode(net, bc_mode); in tipc_nl_bc_link_set()
678 err = tipc_bc_link_set_broadcast_ratio(net, bc_ratio); in tipc_nl_bc_link_set()
683 err = tipc_bc_link_set_queue_limits(net, win); in tipc_nl_bc_link_set()
689 int tipc_bcast_init(struct net *net) in tipc_bcast_init() argument
691 struct tipc_net *tn = tipc_net(net); in tipc_bcast_init()
699 spin_lock_init(&tipc_net(net)->bclock); in tipc_bcast_init()
701 if (!tipc_link_bc_create(net, 0, 0, NULL, in tipc_bcast_init()
722 void tipc_bcast_stop(struct net *net) in tipc_bcast_stop() argument
724 struct tipc_net *tn = net_generic(net, tipc_net_id); in tipc_bcast_stop()
761 u32 tipc_bcast_get_mode(struct net *net) in tipc_bcast_get_mode() argument
763 struct tipc_bc_base *bb = tipc_bc_base(net); in tipc_bcast_get_mode()
777 u32 tipc_bcast_get_broadcast_ratio(struct net *net) in tipc_bcast_get_broadcast_ratio() argument
779 struct tipc_bc_base *bb = tipc_bc_base(net); in tipc_bcast_get_broadcast_ratio()
784 void tipc_mcast_filter_msg(struct net *net, struct sk_buff_head *defq, in tipc_mcast_filter_msg() argument
802 if (node == tipc_own_addr(net)) in tipc_mcast_filter_msg()