• Home
  • Raw
  • Download

Lines Matching refs:grp

101 static void tipc_group_proto_xmit(struct tipc_group *grp, struct tipc_member *m,
114 static void tipc_group_decr_active(struct tipc_group *grp, in tipc_group_decr_active() argument
119 grp->active_cnt--; in tipc_group_decr_active()
122 static int tipc_group_rcvbuf_limit(struct tipc_group *grp) in tipc_group_rcvbuf_limit() argument
125 int mcnt = grp->member_cnt + 1; in tipc_group_rcvbuf_limit()
130 grp->max_active = max_active; in tipc_group_rcvbuf_limit()
140 u16 tipc_group_bc_snd_nxt(struct tipc_group *grp) in tipc_group_bc_snd_nxt() argument
142 return grp->bc_snd_nxt; in tipc_group_bc_snd_nxt()
155 u32 tipc_group_exclude(struct tipc_group *grp) in tipc_group_exclude() argument
157 if (!grp->loopback) in tipc_group_exclude()
158 return grp->portid; in tipc_group_exclude()
168 struct tipc_group *grp; in tipc_group_create() local
171 grp = kzalloc(sizeof(*grp), GFP_ATOMIC); in tipc_group_create()
172 if (!grp) in tipc_group_create()
174 tipc_nlist_init(&grp->dests, tipc_own_addr(net)); in tipc_group_create()
175 INIT_LIST_HEAD(&grp->small_win); in tipc_group_create()
176 INIT_LIST_HEAD(&grp->active); in tipc_group_create()
177 INIT_LIST_HEAD(&grp->pending); in tipc_group_create()
178 grp->members = RB_ROOT; in tipc_group_create()
179 grp->net = net; in tipc_group_create()
180 grp->portid = portid; in tipc_group_create()
181 grp->type = type; in tipc_group_create()
182 grp->instance = mreq->instance; in tipc_group_create()
183 grp->scope = mreq->scope; in tipc_group_create()
184 grp->loopback = mreq->flags & TIPC_GROUP_LOOPBACK; in tipc_group_create()
185 grp->events = mreq->flags & TIPC_GROUP_MEMBER_EVTS; in tipc_group_create()
186 grp->open = group_is_open; in tipc_group_create()
187 *grp->open = false; in tipc_group_create()
190 filter, &grp->subid)) in tipc_group_create()
191 return grp; in tipc_group_create()
192 kfree(grp); in tipc_group_create()
196 void tipc_group_join(struct net *net, struct tipc_group *grp, int *sk_rcvbuf) in tipc_group_join() argument
198 struct rb_root *tree = &grp->members; in tipc_group_join()
204 tipc_group_proto_xmit(grp, m, GRP_JOIN_MSG, &xmitq); in tipc_group_join()
208 *sk_rcvbuf = tipc_group_rcvbuf_limit(grp); in tipc_group_join()
211 void tipc_group_delete(struct net *net, struct tipc_group *grp) in tipc_group_delete() argument
213 struct rb_root *tree = &grp->members; in tipc_group_delete()
220 tipc_group_proto_xmit(grp, m, GRP_LEAVE_MSG, &xmitq); in tipc_group_delete()
226 tipc_nlist_purge(&grp->dests); in tipc_group_delete()
227 tipc_topsrv_kern_unsubscr(net, grp->subid); in tipc_group_delete()
228 kfree(grp); in tipc_group_delete()
231 static struct tipc_member *tipc_group_find_member(struct tipc_group *grp, in tipc_group_find_member() argument
234 struct rb_node *n = grp->members.rb_node; in tipc_group_find_member()
251 static struct tipc_member *tipc_group_find_dest(struct tipc_group *grp, in tipc_group_find_dest() argument
256 m = tipc_group_find_member(grp, node, port); in tipc_group_find_dest()
262 static struct tipc_member *tipc_group_find_node(struct tipc_group *grp, in tipc_group_find_node() argument
268 for (n = rb_first(&grp->members); n; n = rb_next(n)) { in tipc_group_find_node()
276 static int tipc_group_add_to_tree(struct tipc_group *grp, in tipc_group_add_to_tree() argument
283 n = &grp->members.rb_node; in tipc_group_add_to_tree()
297 rb_insert_color(&m->tree_node, &grp->members); in tipc_group_add_to_tree()
301 static struct tipc_member *tipc_group_create_member(struct tipc_group *grp, in tipc_group_create_member() argument
314 m->group = grp; in tipc_group_create_member()
318 m->bc_acked = grp->bc_snd_nxt - 1; in tipc_group_create_member()
319 ret = tipc_group_add_to_tree(grp, m); in tipc_group_create_member()
324 grp->member_cnt++; in tipc_group_create_member()
325 tipc_nlist_add(&grp->dests, m->node); in tipc_group_create_member()
330 void tipc_group_add_member(struct tipc_group *grp, u32 node, in tipc_group_add_member() argument
333 tipc_group_create_member(grp, node, port, instance, MBR_PUBLISHED); in tipc_group_add_member()
336 static void tipc_group_delete_member(struct tipc_group *grp, in tipc_group_delete_member() argument
339 rb_erase(&m->tree_node, &grp->members); in tipc_group_delete_member()
340 grp->member_cnt--; in tipc_group_delete_member()
343 if (grp->bc_ackers && less(m->bc_acked, grp->bc_snd_nxt - 1)) in tipc_group_delete_member()
344 grp->bc_ackers--; in tipc_group_delete_member()
348 tipc_group_decr_active(grp, m); in tipc_group_delete_member()
351 if (!tipc_group_find_node(grp, m->node)) in tipc_group_delete_member()
352 tipc_nlist_del(&grp->dests, m->node); in tipc_group_delete_member()
357 struct tipc_nlist *tipc_group_dests(struct tipc_group *grp) in tipc_group_dests() argument
359 return &grp->dests; in tipc_group_dests()
362 void tipc_group_self(struct tipc_group *grp, struct tipc_name_seq *seq, in tipc_group_self() argument
365 seq->type = grp->type; in tipc_group_self()
366 seq->lower = grp->instance; in tipc_group_self()
367 seq->upper = grp->instance; in tipc_group_self()
368 *scope = grp->scope; in tipc_group_self()
373 struct tipc_group *grp = m->group; in tipc_group_update_member() local
387 list_for_each_entry_safe(_m, tmp, &grp->small_win, small_win) { in tipc_group_update_member()
394 void tipc_group_update_bc_members(struct tipc_group *grp, int len, bool ack) in tipc_group_update_bc_members() argument
396 u16 prev = grp->bc_snd_nxt - 1; in tipc_group_update_bc_members()
401 for (n = rb_first(&grp->members); n; n = rb_next(n)) { in tipc_group_update_bc_members()
412 grp->bc_ackers = ackers; in tipc_group_update_bc_members()
413 grp->bc_snd_nxt++; in tipc_group_update_bc_members()
416 bool tipc_group_cong(struct tipc_group *grp, u32 dnode, u32 dport, in tipc_group_cong() argument
423 m = tipc_group_find_dest(grp, dnode, dport); in tipc_group_cong()
433 *grp->open = false; in tipc_group_cong()
445 tipc_group_proto_xmit(grp, m, GRP_ADV_MSG, &xmitq); in tipc_group_cong()
446 tipc_node_distr_xmit(grp->net, &xmitq); in tipc_group_cong()
450 bool tipc_group_bc_cong(struct tipc_group *grp, int len) in tipc_group_bc_cong() argument
455 if (grp->bc_ackers) { in tipc_group_bc_cong()
456 *grp->open = false; in tipc_group_bc_cong()
459 if (list_empty(&grp->small_win)) in tipc_group_bc_cong()
462 m = list_first_entry(&grp->small_win, struct tipc_member, small_win); in tipc_group_bc_cong()
466 return tipc_group_cong(grp, m->node, m->port, len, &m); in tipc_group_bc_cong()
495 void tipc_group_filter_msg(struct tipc_group *grp, struct sk_buff_head *inputq, in tipc_group_filter_msg() argument
516 m = tipc_group_find_member(grp, node, port); in tipc_group_filter_msg()
541 if (msg_nameinst(hdr) != grp->instance) { in tipc_group_filter_msg()
555 if (!grp->events) in tipc_group_filter_msg()
570 tipc_group_proto_xmit(grp, m, GRP_ACK_MSG, xmitq); in tipc_group_filter_msg()
574 tipc_group_delete_member(grp, m); in tipc_group_filter_msg()
580 tipc_group_update_rcv_win(grp, blks, node, port, xmitq); in tipc_group_filter_msg()
587 void tipc_group_update_rcv_win(struct tipc_group *grp, int blks, u32 node, in tipc_group_update_rcv_win() argument
590 struct list_head *active = &grp->active; in tipc_group_update_rcv_win()
591 int max_active = grp->max_active; in tipc_group_update_rcv_win()
593 int active_cnt = grp->active_cnt; in tipc_group_update_rcv_win()
596 m = tipc_group_find_member(grp, node, port); in tipc_group_update_rcv_win()
608 grp->active_cnt++; in tipc_group_update_rcv_win()
609 tipc_group_proto_xmit(grp, m, GRP_ADV_MSG, xmitq); in tipc_group_update_rcv_win()
612 list_add_tail(&m->list, &grp->pending); in tipc_group_update_rcv_win()
623 tipc_group_proto_xmit(grp, rm, GRP_RECLAIM_MSG, xmitq); in tipc_group_update_rcv_win()
627 pm = list_first_entry(&grp->pending, struct tipc_member, list); in tipc_group_update_rcv_win()
630 tipc_group_proto_xmit(grp, pm, GRP_ADV_MSG, xmitq); in tipc_group_update_rcv_win()
633 if (!list_is_last(&m->list, &grp->active)) in tipc_group_update_rcv_win()
634 list_move_tail(&m->list, &grp->active); in tipc_group_update_rcv_win()
637 tipc_group_proto_xmit(grp, m, GRP_ADV_MSG, xmitq); in tipc_group_update_rcv_win()
643 grp->active_cnt--; in tipc_group_update_rcv_win()
646 tipc_group_proto_xmit(grp, m, GRP_ADV_MSG, xmitq); in tipc_group_update_rcv_win()
649 if (list_empty(&grp->pending)) in tipc_group_update_rcv_win()
653 pm = list_first_entry(&grp->pending, struct tipc_member, list); in tipc_group_update_rcv_win()
655 list_move_tail(&pm->list, &grp->active); in tipc_group_update_rcv_win()
656 grp->active_cnt++; in tipc_group_update_rcv_win()
657 tipc_group_proto_xmit(grp, pm, GRP_ADV_MSG, xmitq); in tipc_group_update_rcv_win()
667 static void tipc_group_create_event(struct tipc_group *grp, in tipc_group_create_event() argument
671 { u32 dnode = tipc_own_addr(grp->net); in tipc_group_create_event()
682 evt.s.seq.type = grp->type; in tipc_group_create_event()
688 grp->portid, m->port, 0); in tipc_group_create_event()
693 msg_set_nametype(hdr, grp->type); in tipc_group_create_event()
702 static void tipc_group_proto_xmit(struct tipc_group *grp, struct tipc_member *m, in tipc_group_proto_xmit() argument
710 m->node, tipc_own_addr(grp->net), in tipc_group_proto_xmit()
711 m->port, grp->portid, 0); in tipc_group_proto_xmit()
723 msg_set_grp_bc_syncpt(hdr, grp->bc_snd_nxt); in tipc_group_proto_xmit()
727 msg_set_grp_bc_syncpt(hdr, grp->bc_snd_nxt); in tipc_group_proto_xmit()
740 void tipc_group_proto_rcv(struct tipc_group *grp, bool *usr_wakeup, in tipc_group_proto_rcv() argument
749 if (!grp) in tipc_group_proto_rcv()
752 if (grp->scope == TIPC_NODE_SCOPE && node != tipc_own_addr(grp->net)) in tipc_group_proto_rcv()
755 m = tipc_group_find_member(grp, node, port); in tipc_group_proto_rcv()
760 m = tipc_group_create_member(grp, node, port, in tipc_group_proto_rcv()
776 tipc_group_proto_xmit(grp, m, GRP_ADV_MSG, xmitq); in tipc_group_proto_rcv()
777 tipc_group_create_event(grp, m, TIPC_PUBLISHED, in tipc_group_proto_rcv()
786 tipc_group_decr_active(grp, m); in tipc_group_proto_rcv()
788 tipc_group_create_event(grp, m, TIPC_WITHDRAWN, in tipc_group_proto_rcv()
801 if (--grp->bc_ackers) in tipc_group_proto_rcv()
811 tipc_group_proto_xmit(grp, m, GRP_REMIT_MSG, xmitq); in tipc_group_proto_rcv()
834 grp->active_cnt--; in tipc_group_proto_rcv()
838 if (list_empty(&grp->pending)) in tipc_group_proto_rcv()
840 pm = list_first_entry(&grp->pending, struct tipc_member, list); in tipc_group_proto_rcv()
842 list_move_tail(&pm->list, &grp->active); in tipc_group_proto_rcv()
843 grp->active_cnt++; in tipc_group_proto_rcv()
845 tipc_group_proto_xmit(grp, pm, GRP_ADV_MSG, xmitq); in tipc_group_proto_rcv()
854 void tipc_group_member_evt(struct tipc_group *grp, in tipc_group_member_evt() argument
870 if (!grp) in tipc_group_member_evt()
873 net = grp->net; in tipc_group_member_evt()
875 if (!grp->loopback && node == self && port == grp->portid) in tipc_group_member_evt()
878 m = tipc_group_find_member(grp, node, port); in tipc_group_member_evt()
884 m = tipc_group_create_member(grp, node, port, instance, in tipc_group_member_evt()
889 tipc_group_proto_xmit(grp, m, GRP_JOIN_MSG, xmitq); in tipc_group_member_evt()
901 tipc_group_proto_xmit(grp, m, GRP_JOIN_MSG, xmitq); in tipc_group_member_evt()
902 tipc_group_create_event(grp, m, TIPC_PUBLISHED, in tipc_group_member_evt()
909 tipc_group_decr_active(grp, m); in tipc_group_member_evt()
916 tipc_group_create_event(grp, m, TIPC_WITHDRAWN, in tipc_group_member_evt()
922 *sk_rcvbuf = tipc_group_rcvbuf_limit(grp); in tipc_group_member_evt()
925 int tipc_group_fill_sock_diag(struct tipc_group *grp, struct sk_buff *skb) in tipc_group_fill_sock_diag() argument
933 grp->type) || in tipc_group_fill_sock_diag()
935 grp->instance) || in tipc_group_fill_sock_diag()
937 grp->bc_snd_nxt)) in tipc_group_fill_sock_diag()
940 if (grp->scope == TIPC_NODE_SCOPE) in tipc_group_fill_sock_diag()
944 if (grp->scope == TIPC_CLUSTER_SCOPE) in tipc_group_fill_sock_diag()
948 if (*grp->open) in tipc_group_fill_sock_diag()