Lines Matching defs:net

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