Lines Matching refs:tsk
130 static int tipc_sk_publish(struct tipc_sock *tsk, uint scope,
132 static int tipc_sk_withdraw(struct tipc_sock *tsk, uint scope,
134 static int tipc_sk_leave(struct tipc_sock *tsk);
136 static int tipc_sk_insert(struct tipc_sock *tsk);
137 static void tipc_sk_remove(struct tipc_sock *tsk);
147 static u32 tsk_own_node(struct tipc_sock *tsk) in tsk_own_node() argument
149 return msg_prevnode(&tsk->phdr); in tsk_own_node()
152 static u32 tsk_peer_node(struct tipc_sock *tsk) in tsk_peer_node() argument
154 return msg_destnode(&tsk->phdr); in tsk_peer_node()
157 static u32 tsk_peer_port(struct tipc_sock *tsk) in tsk_peer_port() argument
159 return msg_destport(&tsk->phdr); in tsk_peer_port()
162 static bool tsk_unreliable(struct tipc_sock *tsk) in tsk_unreliable() argument
164 return msg_src_droppable(&tsk->phdr) != 0; in tsk_unreliable()
167 static void tsk_set_unreliable(struct tipc_sock *tsk, bool unreliable) in tsk_set_unreliable() argument
169 msg_set_src_droppable(&tsk->phdr, unreliable ? 1 : 0); in tsk_set_unreliable()
172 static bool tsk_unreturnable(struct tipc_sock *tsk) in tsk_unreturnable() argument
174 return msg_dest_droppable(&tsk->phdr) != 0; in tsk_unreturnable()
177 static void tsk_set_unreturnable(struct tipc_sock *tsk, bool unreturnable) in tsk_set_unreturnable() argument
179 msg_set_dest_droppable(&tsk->phdr, unreturnable ? 1 : 0); in tsk_set_unreturnable()
182 static int tsk_importance(struct tipc_sock *tsk) in tsk_importance() argument
184 return msg_importance(&tsk->phdr); in tsk_importance()
187 static int tsk_set_importance(struct tipc_sock *tsk, int imp) in tsk_set_importance() argument
191 msg_set_importance(&tsk->phdr, (u32)imp); in tsk_set_importance()
200 static bool tsk_conn_cong(struct tipc_sock *tsk) in tsk_conn_cong() argument
202 return tsk->snt_unacked > tsk->snd_win; in tsk_conn_cong()
223 static u16 tsk_inc(struct tipc_sock *tsk, int msglen) in tsk_inc() argument
225 if (likely(tsk->peer_caps & TIPC_BLOCK_FLOWCTL)) in tsk_inc()
289 static bool tsk_peer_msg(struct tipc_sock *tsk, struct tipc_msg *msg) in tsk_peer_msg() argument
291 struct sock *sk = &tsk->sk; in tsk_peer_msg()
293 u32 peer_port = tsk_peer_port(tsk); in tsk_peer_msg()
303 peer_node = tsk_peer_node(tsk); in tsk_peer_msg()
416 struct tipc_sock *tsk; in tipc_sk_create() local
443 tsk = tipc_sk(sk); in tipc_sk_create()
444 tsk->max_pkt = MAX_PKT_DEFAULT; in tipc_sk_create()
445 INIT_LIST_HEAD(&tsk->publications); in tipc_sk_create()
446 INIT_LIST_HEAD(&tsk->cong_links); in tipc_sk_create()
447 msg = &tsk->phdr; in tipc_sk_create()
453 if (tipc_sk_insert(tsk)) { in tipc_sk_create()
464 msg_set_origport(msg, tsk->portid); in tipc_sk_create()
472 tsk->conn_timeout = CONN_TIMEOUT_DEFAULT; in tipc_sk_create()
473 tsk->group_is_open = true; in tipc_sk_create()
474 atomic_set(&tsk->dupl_rcvcnt, 0); in tipc_sk_create()
477 tsk->snd_win = tsk_adv_blocks(RCVBUF_MIN); in tipc_sk_create()
478 tsk->rcv_win = tsk->snd_win; in tipc_sk_create()
481 tsk_set_unreturnable(tsk, true); in tipc_sk_create()
483 tsk_set_unreliable(tsk, true); in tipc_sk_create()
491 struct tipc_sock *tsk = container_of(head, struct tipc_sock, rcu); in tipc_sk_callback() local
493 sock_put(&tsk->sk); in tipc_sk_callback()
500 struct tipc_sock *tsk = tipc_sk(sk); in __tipc_shutdown() local
503 u32 dnode = tsk_peer_node(tsk); in __tipc_shutdown()
507 tipc_wait_for_cond(sock, &timeout, (!tsk->cong_link_cnt && in __tipc_shutdown()
508 !tsk_conn_cong(tsk))); in __tipc_shutdown()
521 tipc_node_remove_conn(net, dnode, tsk->portid); in __tipc_shutdown()
532 tsk_own_node(tsk), tsk_peer_port(tsk), in __tipc_shutdown()
533 tsk->portid, error); in __tipc_shutdown()
535 tipc_node_xmit_skb(net, skb, dnode, tsk->portid); in __tipc_shutdown()
536 tipc_node_remove_conn(net, dnode, tsk->portid); in __tipc_shutdown()
560 struct tipc_sock *tsk; in tipc_release() local
569 tsk = tipc_sk(sk); in tipc_release()
574 tipc_sk_leave(tsk); in tipc_release()
575 tipc_sk_withdraw(tsk, 0, NULL); in tipc_release()
577 tipc_sk_remove(tsk); in tipc_release()
582 tipc_dest_list_purge(&tsk->cong_links); in tipc_release()
583 tsk->cong_link_cnt = 0; in tipc_release()
584 call_rcu(&tsk->rcu, tipc_sk_callback); in tipc_release()
610 struct tipc_sock *tsk = tipc_sk(sk); in tipc_bind() local
615 res = tipc_sk_withdraw(tsk, 0, NULL); in tipc_bind()
618 if (tsk->group) { in tipc_bind()
646 tipc_sk_publish(tsk, addr->scope, &addr->addr.nameseq) : in tipc_bind()
647 tipc_sk_withdraw(tsk, -addr->scope, &addr->addr.nameseq); in tipc_bind()
671 struct tipc_sock *tsk = tipc_sk(sk); in tipc_getname() local
678 addr->addr.id.ref = tsk_peer_port(tsk); in tipc_getname()
679 addr->addr.id.node = tsk_peer_node(tsk); in tipc_getname()
681 addr->addr.id.ref = tsk->portid; in tipc_getname()
715 struct tipc_sock *tsk = tipc_sk(sk); in tipc_poll() local
728 if (!tsk->cong_link_cnt && !tsk_conn_cong(tsk)) in tipc_poll()
736 if (tsk->group_is_open && !tsk->cong_link_cnt) in tipc_poll()
766 struct tipc_sock *tsk = tipc_sk(sk); in tipc_sendmcast() local
767 struct tipc_msg *hdr = &tsk->phdr; in tipc_sendmcast()
770 struct tipc_mc_method *method = &tsk->mc_method; in tipc_sendmcast()
775 if (tsk->group) in tipc_sendmcast()
779 rc = tipc_wait_for_cond(sock, &timeout, !tsk->cong_link_cnt); in tipc_sendmcast()
807 &tsk->cong_link_cnt); in tipc_sendmcast()
823 static int tipc_send_group_msg(struct net *net, struct tipc_sock *tsk, in tipc_send_group_msg() argument
827 u16 bc_snd_nxt = tipc_group_bc_snd_nxt(tsk->group); in tipc_send_group_msg()
828 struct tipc_mc_method *method = &tsk->mc_method; in tipc_send_group_msg()
830 struct tipc_msg *hdr = &tsk->phdr; in tipc_send_group_msg()
843 mtu = tipc_node_get_mtu(net, dnode, tsk->portid); in tipc_send_group_msg()
849 rc = tipc_node_xmit(net, &pkts, dnode, tsk->portid); in tipc_send_group_msg()
851 tipc_dest_push(&tsk->cong_links, dnode, 0); in tipc_send_group_msg()
852 tsk->cong_link_cnt++; in tipc_send_group_msg()
880 struct tipc_sock *tsk = tipc_sk(sk); in tipc_send_group_unicast() local
881 struct tipc_group *grp = tsk->group; in tipc_send_group_unicast()
894 !tipc_dest_find(&tsk->cong_links, node, 0) && in tipc_send_group_unicast()
902 rc = tipc_send_group_msg(net, tsk, m, mb, node, port, dlen); in tipc_send_group_unicast()
922 struct tipc_sock *tsk = tipc_sk(sk); in tipc_send_group_anycast() local
923 struct list_head *cong_links = &tsk->cong_links; in tipc_send_group_anycast()
925 struct tipc_group *grp = tsk->group; in tipc_send_group_anycast()
926 struct tipc_msg *hdr = &tsk->phdr; in tipc_send_group_anycast()
985 rc = tipc_send_group_msg(net, tsk, m, mbr, node, port, dlen); in tipc_send_group_anycast()
1006 struct tipc_sock *tsk = tipc_sk(sk); in tipc_send_group_bcast() local
1007 struct tipc_group *grp = tsk->group; in tipc_send_group_bcast()
1009 struct tipc_mc_method *method = &tsk->mc_method; in tipc_send_group_bcast()
1012 struct tipc_msg *hdr = &tsk->phdr; in tipc_send_group_bcast()
1021 rc = tipc_wait_for_cond(sock, &timeout, !tsk->cong_link_cnt && in tipc_send_group_bcast()
1049 rc = tipc_mcast_xmit(net, &pkts, method, dsts, &tsk->cong_link_cnt); in tipc_send_group_bcast()
1054 tipc_group_update_bc_members(tsk->group, blks, ack); in tipc_send_group_bcast()
1078 struct tipc_sock *tsk = tipc_sk(sk); in tipc_send_group_mcast() local
1079 struct tipc_group *grp = tsk->group; in tipc_send_group_mcast()
1080 struct tipc_msg *hdr = &tsk->phdr; in tipc_send_group_mcast()
1198 static void tipc_sk_conn_proto_rcv(struct tipc_sock *tsk, struct sk_buff *skb, in tipc_sk_conn_proto_rcv() argument
1203 u32 onode = tsk_own_node(tsk); in tipc_sk_conn_proto_rcv()
1204 struct sock *sk = &tsk->sk; in tipc_sk_conn_proto_rcv()
1209 if (!tsk_peer_msg(tsk, hdr)) in tipc_sk_conn_proto_rcv()
1214 tipc_node_remove_conn(sock_net(sk), tsk_peer_node(tsk), in tipc_sk_conn_proto_rcv()
1215 tsk_peer_port(tsk)); in tipc_sk_conn_proto_rcv()
1229 tsk->probe_unacked = false; in tipc_sk_conn_proto_rcv()
1237 conn_cong = tsk_conn_cong(tsk); in tipc_sk_conn_proto_rcv()
1238 tsk->snt_unacked -= msg_conn_ack(hdr); in tipc_sk_conn_proto_rcv()
1239 if (tsk->peer_caps & TIPC_BLOCK_FLOWCTL) in tipc_sk_conn_proto_rcv()
1240 tsk->snd_win = msg_adv_win(hdr); in tipc_sk_conn_proto_rcv()
1280 struct tipc_sock *tsk = tipc_sk(sk); in __tipc_sendmsg() local
1283 struct list_head *clinks = &tsk->cong_links; in __tipc_sendmsg()
1285 struct tipc_group *grp = tsk->group; in __tipc_sendmsg()
1286 struct tipc_msg *hdr = &tsk->phdr; in __tipc_sendmsg()
1316 dest = &tsk->peer; in __tipc_sendmsg()
1326 if (tsk->published) in __tipc_sendmsg()
1329 tsk->conn_type = dest->addr.name.name.type; in __tipc_sendmsg()
1330 tsk->conn_instance = dest->addr.name.name.instance; in __tipc_sendmsg()
1370 mtu = tipc_node_get_mtu(net, dnode, tsk->portid); in __tipc_sendmsg()
1375 rc = tipc_node_xmit(net, &pkts, dnode, tsk->portid); in __tipc_sendmsg()
1378 tsk->cong_link_cnt++; in __tipc_sendmsg()
1416 struct tipc_sock *tsk = tipc_sk(sk); in __tipc_sendstream() local
1417 struct tipc_msg *hdr = &tsk->phdr; in __tipc_sendstream()
1420 u32 dnode = tsk_peer_node(tsk); in __tipc_sendstream()
1433 tsk->peer_caps = tipc_node_get_capabilities(net, dnode); in __tipc_sendstream()
1434 tsk->snt_unacked = tsk_inc(tsk, dlen + msg_hdr_sz(hdr)); in __tipc_sendstream()
1441 (!tsk->cong_link_cnt && in __tipc_sendstream()
1442 !tsk_conn_cong(tsk) && in __tipc_sendstream()
1448 rc = tipc_msg_build(hdr, m, sent, send, tsk->max_pkt, &pkts); in __tipc_sendstream()
1452 rc = tipc_node_xmit(net, &pkts, dnode, tsk->portid); in __tipc_sendstream()
1454 tsk->cong_link_cnt = 1; in __tipc_sendstream()
1458 tsk->snt_unacked += tsk_inc(tsk, send + MIN_H_SIZE); in __tipc_sendstream()
1486 static void tipc_sk_finish_conn(struct tipc_sock *tsk, u32 peer_port, in tipc_sk_finish_conn() argument
1489 struct sock *sk = &tsk->sk; in tipc_sk_finish_conn()
1491 struct tipc_msg *msg = &tsk->phdr; in tipc_sk_finish_conn()
1501 tipc_node_add_conn(net, peer_node, tsk->portid, peer_port); in tipc_sk_finish_conn()
1502 tsk->max_pkt = tipc_node_get_mtu(net, peer_node, tsk->portid); in tipc_sk_finish_conn()
1503 tsk->peer_caps = tipc_node_get_capabilities(net, peer_node); in tipc_sk_finish_conn()
1504 if (tsk->peer_caps & TIPC_BLOCK_FLOWCTL) in tipc_sk_finish_conn()
1508 tsk->rcv_win = FLOWCTL_MSG_WIN; in tipc_sk_finish_conn()
1509 tsk->snd_win = FLOWCTL_MSG_WIN; in tipc_sk_finish_conn()
1559 struct tipc_sock *tsk) in tipc_sk_anc_data_recv() argument
1602 has_name = (tsk->conn_type != 0); in tipc_sk_anc_data_recv()
1603 anc_data[0] = tsk->conn_type; in tipc_sk_anc_data_recv()
1604 anc_data[1] = tsk->conn_instance; in tipc_sk_anc_data_recv()
1605 anc_data[2] = tsk->conn_instance; in tipc_sk_anc_data_recv()
1619 static void tipc_sk_send_ack(struct tipc_sock *tsk) in tipc_sk_send_ack() argument
1621 struct sock *sk = &tsk->sk; in tipc_sk_send_ack()
1625 u32 peer_port = tsk_peer_port(tsk); in tipc_sk_send_ack()
1626 u32 dnode = tsk_peer_node(tsk); in tipc_sk_send_ack()
1631 dnode, tsk_own_node(tsk), peer_port, in tipc_sk_send_ack()
1632 tsk->portid, TIPC_OK); in tipc_sk_send_ack()
1636 msg_set_conn_ack(msg, tsk->rcv_unacked); in tipc_sk_send_ack()
1637 tsk->rcv_unacked = 0; in tipc_sk_send_ack()
1640 if (tsk->peer_caps & TIPC_BLOCK_FLOWCTL) { in tipc_sk_send_ack()
1641 tsk->rcv_win = tsk_adv_blocks(tsk->sk.sk_rcvbuf); in tipc_sk_send_ack()
1642 msg_set_adv_win(msg, tsk->rcv_win); in tipc_sk_send_ack()
1703 struct tipc_sock *tsk = tipc_sk(sk); in tipc_recvmsg() local
1740 rc = tipc_sk_anc_data_recv(m, hdr, tsk); in tipc_recvmsg()
1772 if (tsk->group && msg_in_group(hdr) && !grp_evt) { in tipc_recvmsg()
1774 tipc_group_update_rcv_win(tsk->group, tsk_blocks(hlen + dlen), in tipc_recvmsg()
1786 tsk->rcv_unacked += tsk_inc(tsk, hlen + dlen); in tipc_recvmsg()
1787 if (tsk->rcv_unacked >= tsk->rcv_win / TIPC_ACK_RATE) in tipc_recvmsg()
1788 tipc_sk_send_ack(tsk); in tipc_recvmsg()
1809 struct tipc_sock *tsk = tipc_sk(sk); in tipc_recvstream() local
1852 rc = tipc_sk_anc_data_recv(m, hdr, tsk); in tipc_recvstream()
1885 tsk->rcv_unacked += tsk_inc(tsk, hlen + dlen); in tipc_recvstream()
1886 if (unlikely(tsk->rcv_unacked >= tsk->rcv_win / TIPC_ACK_RATE)) in tipc_recvstream()
1887 tipc_sk_send_ack(tsk); in tipc_recvstream()
1942 struct tipc_sock *tsk = tipc_sk(sk); in tipc_sk_proto_rcv() local
1944 struct tipc_group *grp = tsk->group; in tipc_sk_proto_rcv()
1949 tipc_sk_conn_proto_rcv(tsk, skb, inputq, xmitq); in tipc_sk_proto_rcv()
1952 tipc_dest_del(&tsk->cong_links, msg_orignode(hdr), 0); in tipc_sk_proto_rcv()
1953 tsk->cong_link_cnt--; in tipc_sk_proto_rcv()
1960 tipc_group_member_evt(tsk->group, &wakeup, &sk->sk_rcvbuf, in tipc_sk_proto_rcv()
1980 static bool tipc_sk_filter_connect(struct tipc_sock *tsk, struct sk_buff *skb) in tipc_sk_filter_connect() argument
1982 struct sock *sk = &tsk->sk; in tipc_sk_filter_connect()
1995 if (pport != tsk_peer_port(tsk) || in tipc_sk_filter_connect()
1996 pnode != tsk_peer_node(tsk)) in tipc_sk_filter_connect()
2019 tipc_sk_finish_conn(tsk, msg_origport(hdr), msg_orignode(hdr)); in tipc_sk_filter_connect()
2020 msg_set_importance(&tsk->phdr, msg_importance(hdr)); in tipc_sk_filter_connect()
2043 if (unlikely(!tsk_peer_msg(tsk, hdr))) in tipc_sk_filter_connect()
2049 tipc_node_remove_conn(net, tsk_peer_node(tsk), in tipc_sk_filter_connect()
2050 tsk->portid); in tipc_sk_filter_connect()
2081 struct tipc_sock *tsk = tipc_sk(sk); in rcvbuf_limit() local
2090 if (likely(tsk->peer_caps & TIPC_BLOCK_FLOWCTL)) in rcvbuf_limit()
2111 struct tipc_sock *tsk = tipc_sk(sk); in tipc_sk_filter_rcv() local
2112 struct tipc_group *grp = tsk->group; in tipc_sk_filter_rcv()
2132 if ((sk_conn && !tipc_sk_filter_connect(tsk, skb)) || in tipc_sk_filter_rcv()
2236 struct tipc_sock *tsk; in tipc_sk_rcv() local
2243 tsk = tipc_sk_lookup(net, dport); in tipc_sk_rcv()
2245 if (likely(tsk)) { in tipc_sk_rcv()
2246 sk = &tsk->sk; in tipc_sk_rcv()
2311 struct tipc_sock *tsk = tipc_sk(sk); in tipc_connect() local
2314 long timeout = (flags & O_NONBLOCK) ? 0 : tsk->conn_timeout; in tipc_connect()
2323 if (tsk->group) { in tipc_connect()
2329 memset(&tsk->peer, 0, sizeof(struct sockaddr_tipc)); in tipc_connect()
2343 memcpy(&tsk->peer, dest, destlen); in tipc_connect()
2563 struct tipc_sock *tsk = tipc_sk(sk); in tipc_sk_timeout() local
2564 u32 peer_port = tsk_peer_port(tsk); in tipc_sk_timeout()
2565 u32 peer_node = tsk_peer_node(tsk); in tipc_sk_timeout()
2566 u32 own_node = tsk_own_node(tsk); in tipc_sk_timeout()
2567 u32 own_port = tsk->portid; in tipc_sk_timeout()
2581 if (tsk->probe_unacked) { in tipc_sk_timeout()
2591 tsk->probe_unacked = true; in tipc_sk_timeout()
2600 static int tipc_sk_publish(struct tipc_sock *tsk, uint scope, in tipc_sk_publish() argument
2603 struct sock *sk = &tsk->sk; in tipc_sk_publish()
2613 key = tsk->portid + tsk->pub_count + 1; in tipc_sk_publish()
2614 if (key == tsk->portid) in tipc_sk_publish()
2618 scope, tsk->portid, key); in tipc_sk_publish()
2622 list_add(&publ->binding_sock, &tsk->publications); in tipc_sk_publish()
2623 tsk->pub_count++; in tipc_sk_publish()
2624 tsk->published = 1; in tipc_sk_publish()
2628 static int tipc_sk_withdraw(struct tipc_sock *tsk, uint scope, in tipc_sk_withdraw() argument
2631 struct net *net = sock_net(&tsk->sk); in tipc_sk_withdraw()
2639 list_for_each_entry_safe(publ, safe, &tsk->publications, binding_sock) { in tipc_sk_withdraw()
2658 if (list_empty(&tsk->publications)) in tipc_sk_withdraw()
2659 tsk->published = 0; in tipc_sk_withdraw()
2670 struct tipc_sock *tsk; in tipc_sk_reinit() local
2678 while ((tsk = rhashtable_walk_next(&iter)) && !IS_ERR(tsk)) { in tipc_sk_reinit()
2679 spin_lock_bh(&tsk->sk.sk_lock.slock); in tipc_sk_reinit()
2680 msg = &tsk->phdr; in tipc_sk_reinit()
2683 spin_unlock_bh(&tsk->sk.sk_lock.slock); in tipc_sk_reinit()
2687 } while (tsk == ERR_PTR(-EAGAIN)); in tipc_sk_reinit()
2695 struct tipc_sock *tsk; in tipc_sk_lookup() local
2698 tsk = rhashtable_lookup_fast(&tn->sk_rht, &portid, tsk_rht_params); in tipc_sk_lookup()
2699 if (tsk) in tipc_sk_lookup()
2700 sock_hold(&tsk->sk); in tipc_sk_lookup()
2703 return tsk; in tipc_sk_lookup()
2706 static int tipc_sk_insert(struct tipc_sock *tsk) in tipc_sk_insert() argument
2708 struct sock *sk = &tsk->sk; in tipc_sk_insert()
2718 tsk->portid = portid; in tipc_sk_insert()
2719 sock_hold(&tsk->sk); in tipc_sk_insert()
2720 if (!rhashtable_lookup_insert_fast(&tn->sk_rht, &tsk->node, in tipc_sk_insert()
2723 sock_put(&tsk->sk); in tipc_sk_insert()
2729 static void tipc_sk_remove(struct tipc_sock *tsk) in tipc_sk_remove() argument
2731 struct sock *sk = &tsk->sk; in tipc_sk_remove()
2734 if (!rhashtable_remove_fast(&tn->sk_rht, &tsk->node, tsk_rht_params)) { in tipc_sk_remove()
2767 static int tipc_sk_join(struct tipc_sock *tsk, struct tipc_group_req *mreq) in tipc_sk_join() argument
2769 struct net *net = sock_net(&tsk->sk); in tipc_sk_join()
2770 struct tipc_group *grp = tsk->group; in tipc_sk_join()
2771 struct tipc_msg *hdr = &tsk->phdr; in tipc_sk_join()
2781 grp = tipc_group_create(net, tsk->portid, mreq, &tsk->group_is_open); in tipc_sk_join()
2784 tsk->group = grp; in tipc_sk_join()
2792 rc = tipc_sk_publish(tsk, mreq->scope, &seq); in tipc_sk_join()
2795 tsk->group = NULL; in tipc_sk_join()
2799 tsk->mc_method.rcast = true; in tipc_sk_join()
2800 tsk->mc_method.mandatory = true; in tipc_sk_join()
2801 tipc_group_join(net, grp, &tsk->sk.sk_rcvbuf); in tipc_sk_join()
2805 static int tipc_sk_leave(struct tipc_sock *tsk) in tipc_sk_leave() argument
2807 struct net *net = sock_net(&tsk->sk); in tipc_sk_leave()
2808 struct tipc_group *grp = tsk->group; in tipc_sk_leave()
2816 tsk->group = NULL; in tipc_sk_leave()
2817 tipc_sk_withdraw(tsk, scope, &seq); in tipc_sk_leave()
2838 struct tipc_sock *tsk = tipc_sk(sk); in tipc_setsockopt() local
2873 res = tsk_set_importance(tsk, value); in tipc_setsockopt()
2877 tsk_set_unreliable(tsk, value); in tipc_setsockopt()
2882 tsk_set_unreturnable(tsk, value); in tipc_setsockopt()
2888 tsk->mc_method.rcast = false; in tipc_setsockopt()
2889 tsk->mc_method.mandatory = true; in tipc_setsockopt()
2892 tsk->mc_method.rcast = true; in tipc_setsockopt()
2893 tsk->mc_method.mandatory = true; in tipc_setsockopt()
2896 res = tipc_sk_join(tsk, &mreq); in tipc_setsockopt()
2899 res = tipc_sk_leave(tsk); in tipc_setsockopt()
2927 struct tipc_sock *tsk = tipc_sk(sk); in tipc_getsockopt() local
2945 value = tsk_importance(tsk); in tipc_getsockopt()
2948 value = tsk_unreliable(tsk); in tipc_getsockopt()
2951 value = tsk_unreturnable(tsk); in tipc_getsockopt()
2954 value = tsk->conn_timeout; in tipc_getsockopt()
2965 if (tsk->group) in tipc_getsockopt()
2966 tipc_group_self(tsk->group, &seq, &scope); in tipc_getsockopt()
3154 static int __tipc_nl_add_sk_con(struct sk_buff *skb, struct tipc_sock *tsk) in __tipc_nl_add_sk_con() argument
3160 peer_node = tsk_peer_node(tsk); in __tipc_nl_add_sk_con()
3161 peer_port = tsk_peer_port(tsk); in __tipc_nl_add_sk_con()
3170 if (tsk->conn_type != 0) { in __tipc_nl_add_sk_con()
3173 if (nla_put_u32(skb, TIPC_NLA_CON_TYPE, tsk->conn_type)) in __tipc_nl_add_sk_con()
3175 if (nla_put_u32(skb, TIPC_NLA_CON_INST, tsk->conn_instance)) in __tipc_nl_add_sk_con()
3189 *tsk) in __tipc_nl_add_sk_info()
3192 struct sock *sk = &tsk->sk; in __tipc_nl_add_sk_info()
3194 if (nla_put_u32(skb, TIPC_NLA_SOCK_REF, tsk->portid) || in __tipc_nl_add_sk_info()
3199 if (__tipc_nl_add_sk_con(skb, tsk)) in __tipc_nl_add_sk_info()
3201 } else if (!list_empty(&tsk->publications)) { in __tipc_nl_add_sk_info()
3210 struct tipc_sock *tsk) in __tipc_nl_add_sk() argument
3224 if (__tipc_nl_add_sk_info(skb, tsk)) in __tipc_nl_add_sk()
3243 struct tipc_sock *tsk)) in tipc_nl_sk_walk() argument
3246 struct tipc_sock *tsk; in tipc_nl_sk_walk() local
3250 while ((tsk = rhashtable_walk_next(iter)) != NULL) { in tipc_nl_sk_walk()
3251 if (IS_ERR(tsk)) { in tipc_nl_sk_walk()
3252 err = PTR_ERR(tsk); in tipc_nl_sk_walk()
3260 sock_hold(&tsk->sk); in tipc_nl_sk_walk()
3262 lock_sock(&tsk->sk); in tipc_nl_sk_walk()
3263 err = skb_handler(skb, cb, tsk); in tipc_nl_sk_walk()
3265 release_sock(&tsk->sk); in tipc_nl_sk_walk()
3266 sock_put(&tsk->sk); in tipc_nl_sk_walk()
3269 release_sock(&tsk->sk); in tipc_nl_sk_walk()
3271 sock_put(&tsk->sk); in tipc_nl_sk_walk()
3314 struct tipc_sock *tsk, u32 sk_filter_state, in tipc_sk_fill_sock_diag() argument
3317 struct sock *sk = &tsk->sk; in tipc_sk_fill_sock_diag()
3329 if (__tipc_nl_add_sk_info(skb, tsk)) in tipc_sk_fill_sock_diag()
3355 if (tsk->cong_link_cnt && in tipc_sk_fill_sock_diag()
3359 if (tsk_conn_cong(tsk) && in tipc_sk_fill_sock_diag()
3365 if (tsk->group) in tipc_sk_fill_sock_diag()
3366 if (tipc_group_fill_sock_diag(tsk->group, skb)) in tipc_sk_fill_sock_diag()
3429 struct tipc_sock *tsk, u32 *last_publ) in __tipc_nl_list_sk_publ() argument
3435 list_for_each_entry(p, &tsk->publications, binding_sock) { in __tipc_nl_list_sk_publ()
3451 p = list_first_entry(&tsk->publications, struct publication, in __tipc_nl_list_sk_publ()
3455 list_for_each_entry_from(p, &tsk->publications, binding_sock) { in __tipc_nl_list_sk_publ()
3474 struct tipc_sock *tsk; in tipc_nl_publ_dump() local
3502 tsk = tipc_sk_lookup(net, tsk_portid); in tipc_nl_publ_dump()
3503 if (!tsk) in tipc_nl_publ_dump()
3506 lock_sock(&tsk->sk); in tipc_nl_publ_dump()
3507 err = __tipc_nl_list_sk_publ(skb, cb, tsk, &last_publ); in tipc_nl_publ_dump()
3510 release_sock(&tsk->sk); in tipc_nl_publ_dump()
3511 sock_put(&tsk->sk); in tipc_nl_publ_dump()