Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'net-tipc-fix-all-kernel-doc-and-add-tipc-networking-chapter'

Randy Dunlap says:

====================
net/tipc: fix all kernel-doc and add TIPC networking chapter

Fix lots of net/tipc/ kernel-doc warnings. Add many struct field and
function parameter descriptions.

Then add a TIPC chapter to the networking documentation book.

All patches have been rebased to current net-next.

Note: some of the struct members and function parameters are marked
with "FIXME". They could use some additional descriptions if
someone could help add to them. Thanks.
====================

Link: https://lore.kernel.org/r/20201129183251.7049-1-rdunlap@infradead.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+403 -113
+1
Documentation/networking/index.rst
··· 101 101 tcp-thin 102 102 team 103 103 timestamping 104 + tipc 104 105 tproxy 105 106 tuntap 106 107 udplite
+100
Documentation/networking/tipc.rst
··· 1 + .. SPDX-License-Identifier: GPL-2.0 2 + 3 + ================= 4 + Linux Kernel TIPC 5 + ================= 6 + 7 + TIPC (Transparent Inter Process Communication) is a protocol that is 8 + specially designed for intra-cluster communication. 9 + 10 + For more information about TIPC, see http://tipc.sourceforge.net. 11 + 12 + TIPC Base Types 13 + --------------- 14 + 15 + .. kernel-doc:: net/tipc/subscr.h 16 + :internal: 17 + 18 + .. kernel-doc:: net/tipc/bearer.h 19 + :internal: 20 + 21 + .. kernel-doc:: net/tipc/name_table.h 22 + :internal: 23 + 24 + .. kernel-doc:: net/tipc/name_distr.h 25 + :internal: 26 + 27 + .. kernel-doc:: net/tipc/bcast.c 28 + :internal: 29 + 30 + TIPC Bearer Interfaces 31 + ---------------------- 32 + 33 + .. kernel-doc:: net/tipc/bearer.c 34 + :internal: 35 + 36 + .. kernel-doc:: net/tipc/udp_media.c 37 + :internal: 38 + 39 + TIPC Crypto Interfaces 40 + ---------------------- 41 + 42 + .. kernel-doc:: net/tipc/crypto.c 43 + :internal: 44 + 45 + TIPC Discoverer Interfaces 46 + -------------------------- 47 + 48 + .. kernel-doc:: net/tipc/discover.c 49 + :internal: 50 + 51 + TIPC Link Interfaces 52 + -------------------- 53 + 54 + .. kernel-doc:: net/tipc/link.c 55 + :internal: 56 + 57 + TIPC msg Interfaces 58 + ------------------- 59 + 60 + .. kernel-doc:: net/tipc/msg.c 61 + :internal: 62 + 63 + TIPC Name Interfaces 64 + -------------------- 65 + 66 + .. kernel-doc:: net/tipc/name_table.c 67 + :internal: 68 + 69 + .. kernel-doc:: net/tipc/name_distr.c 70 + :internal: 71 + 72 + TIPC Node Management Interfaces 73 + ------------------------------- 74 + 75 + .. kernel-doc:: net/tipc/node.c 76 + :internal: 77 + 78 + TIPC Socket Interfaces 79 + ---------------------- 80 + 81 + .. kernel-doc:: net/tipc/socket.c 82 + :internal: 83 + 84 + TIPC Network Topology Interfaces 85 + -------------------------------- 86 + 87 + .. kernel-doc:: net/tipc/subscr.c 88 + :internal: 89 + 90 + TIPC Server Interfaces 91 + ---------------------- 92 + 93 + .. kernel-doc:: net/tipc/topsrv.c 94 + :internal: 95 + 96 + TIPC Trace Interfaces 97 + --------------------- 98 + 99 + .. kernel-doc:: net/tipc/trace.c 100 + :internal:
+20 -2
net/tipc/bearer.c
··· 72 72 73 73 /** 74 74 * tipc_media_find - locates specified media object by name 75 + * @name: name to locate 75 76 */ 76 77 struct tipc_media *tipc_media_find(const char *name) 77 78 { ··· 87 86 88 87 /** 89 88 * media_find_id - locates specified media object by type identifier 89 + * @type: type identifier to locate 90 90 */ 91 91 static struct tipc_media *media_find_id(u8 type) 92 92 { ··· 102 100 103 101 /** 104 102 * tipc_media_addr_printf - record media address in print buffer 103 + * @buf: output buffer 104 + * @len: output buffer size remaining 105 + * @a: input media address 105 106 */ 106 107 int tipc_media_addr_printf(char *buf, int len, struct tipc_media_addr *a) 107 108 { ··· 132 127 * @name: ptr to bearer name string 133 128 * @name_parts: ptr to area for bearer name components (or NULL if not needed) 134 129 * 135 - * Returns 1 if bearer name is valid, otherwise 0. 130 + * Return: 1 if bearer name is valid, otherwise 0. 136 131 */ 137 132 static int bearer_name_validate(const char *name, 138 133 struct tipc_bearer_names *name_parts) ··· 171 166 172 167 /** 173 168 * tipc_bearer_find - locates bearer object with matching bearer name 169 + * @net: the applicable net namespace 170 + * @name: bearer name to locate 174 171 */ 175 172 struct tipc_bearer *tipc_bearer_find(struct net *net, const char *name) 176 173 { ··· 235 228 236 229 /** 237 230 * tipc_enable_bearer - enable bearer with the given name 231 + * @net: the applicable net namespace 232 + * @name: bearer name to enable 233 + * @disc_domain: bearer domain 234 + * @prio: bearer priority 235 + * @attr: nlattr array 238 236 */ 239 237 static int tipc_enable_bearer(struct net *net, const char *name, 240 238 u32 disc_domain, u32 prio, ··· 354 342 355 343 /** 356 344 * tipc_reset_bearer - Reset all links established over this bearer 345 + * @net: the applicable net namespace 346 + * @b: the target bearer 357 347 */ 358 348 static int tipc_reset_bearer(struct net *net, struct tipc_bearer *b) 359 349 { ··· 377 363 } 378 364 379 365 /** 380 - * bearer_disable 366 + * bearer_disable - disable this bearer 367 + * @net: the applicable net namespace 368 + * @b: the bearer to disable 381 369 * 382 370 * Note: This routine assumes caller holds RTNL lock. 383 371 */ ··· 450 434 } 451 435 452 436 /* tipc_disable_l2_media - detach TIPC bearer from an L2 interface 437 + * @b: the target bearer 453 438 * 454 439 * Mark L2 bearer as inactive so that incoming buffers are thrown away 455 440 */ ··· 467 450 468 451 /** 469 452 * tipc_l2_send_msg - send a TIPC packet out over an L2 interface 453 + * @net: the associated network namespace 470 454 * @skb: the packet to be sent 471 455 * @b: the bearer through which the packet is to be sent 472 456 * @dest: peer destination address
+7 -3
net/tipc/bearer.h
··· 93 93 * @raw2addr: convert from raw addr format to media addr format 94 94 * @priority: default link (and bearer) priority 95 95 * @tolerance: default time (in ms) before declaring link failure 96 - * @window: default window (in packets) before declaring link congestion 96 + * @min_win: minimum window (in packets) before declaring link congestion 97 + * @max_win: maximum window (in packets) before declaring link congestion 97 98 * @mtu: max packet size bearer can support for media type not dependent on 98 99 * underlying device MTU 99 100 * @type_id: TIPC media identifier ··· 139 138 * @pt: packet type for bearer 140 139 * @rcu: rcu struct for tipc_bearer 141 140 * @priority: default link priority for bearer 142 - * @window: default window size for bearer 141 + * @min_win: minimum window (in packets) before declaring link congestion 142 + * @max_win: maximum window (in packets) before declaring link congestion 143 143 * @tolerance: default link tolerance for bearer 144 144 * @domain: network domain to which links can be established 145 145 * @identity: array index of this bearer within TIPC bearer array 146 - * @link_req: ptr to (optional) structure making periodic link setup requests 146 + * @disc: ptr to link setup request 147 147 * @net_plane: network plane ('A' through 'H') currently associated with bearer 148 + * @up: bearer up flag (bit 0) 149 + * @refcnt: tipc_bearer reference counter 148 150 * 149 151 * Note: media-specific code is responsible for initialization of the fields 150 152 * indicated below when a bearer is enabled; TIPC's generic bearer code takes
+31 -24
net/tipc/crypto.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 - /** 2 + /* 3 3 * net/tipc/crypto.c: TIPC crypto for key handling & packet en/decryption 4 4 * 5 5 * Copyright (c) 2019, Ericsson AB ··· 51 51 52 52 #define TIPC_REKEYING_INTV_DEF (60 * 24) /* default: 1 day */ 53 53 54 - /** 54 + /* 55 55 * TIPC Key ids 56 56 */ 57 57 enum { ··· 63 63 KEY_MAX = KEY_3, 64 64 }; 65 65 66 - /** 66 + /* 67 67 * TIPC Crypto statistics 68 68 */ 69 69 enum { ··· 90 90 /* Key exchange switch, default: on */ 91 91 int sysctl_tipc_key_exchange_enabled __read_mostly = 1; 92 92 93 - /** 93 + /* 94 94 * struct tipc_key - TIPC keys' status indicator 95 95 * 96 96 * 7 6 5 4 3 2 1 0 ··· 123 123 124 124 /** 125 125 * struct tipc_tfm - TIPC TFM structure to form a list of TFMs 126 + * @tfm: cipher handle/key 127 + * @list: linked list of TFMs 126 128 */ 127 129 struct tipc_tfm { 128 130 struct crypto_aead *tfm; ··· 140 138 * @salt: the key's SALT value 141 139 * @authsize: authentication tag size (max = 16) 142 140 * @mode: crypto mode is applied to the key 143 - * @hint[]: a hint for user key 141 + * @hint: a hint for user key 144 142 * @rcu: struct rcu_head 145 143 * @key: the aead key 146 144 * @gen: the key's generation ··· 168 166 169 167 /** 170 168 * struct tipc_crypto_stats - TIPC Crypto statistics 169 + * @stat: array of crypto statistics 171 170 */ 172 171 struct tipc_crypto_stats { 173 172 unsigned int stat[MAX_STATS]; ··· 197 194 * @key_master: flag indicates if master key exists 198 195 * @legacy_user: flag indicates if a peer joins w/o master key (for bwd comp.) 199 196 * @nokey: no key indication 197 + * @flags: combined flags field 200 198 * @lock: tipc_key lock 201 199 */ 202 200 struct tipc_crypto { ··· 328 324 329 325 /** 330 326 * tipc_aead_key_validate - Validate a AEAD user key 327 + * @ukey: pointer to user key data 328 + * @info: netlink info pointer 331 329 */ 332 330 int tipc_aead_key_validate(struct tipc_aead_key *ukey, struct genl_info *info) 333 331 { ··· 483 477 484 478 /** 485 479 * tipc_aead_tfm_next - Move TFM entry to the next one in list and return it 480 + * @aead: the AEAD key pointer 486 481 */ 487 482 static struct crypto_aead *tipc_aead_tfm_next(struct tipc_aead *aead) 488 483 { ··· 721 714 * @__dnode: TIPC dest node if "known" 722 715 * 723 716 * Return: 724 - * 0 : if the encryption has completed 725 - * -EINPROGRESS/-EBUSY : if a callback will be performed 726 - * < 0 : the encryption has failed 717 + * * 0 : if the encryption has completed 718 + * * -EINPROGRESS/-EBUSY : if a callback will be performed 719 + * * < 0 : the encryption has failed 727 720 */ 728 721 static int tipc_aead_encrypt(struct tipc_aead *aead, struct sk_buff *skb, 729 722 struct tipc_bearer *b, ··· 877 870 * @b: TIPC bearer where the message has been received 878 871 * 879 872 * Return: 880 - * 0 : if the decryption has completed 881 - * -EINPROGRESS/-EBUSY : if a callback will be performed 882 - * < 0 : the decryption has failed 873 + * * 0 : if the decryption has completed 874 + * * -EINPROGRESS/-EBUSY : if a callback will be performed 875 + * * < 0 : the decryption has failed 883 876 */ 884 877 static int tipc_aead_decrypt(struct net *net, struct tipc_aead *aead, 885 878 struct sk_buff *skb, struct tipc_bearer *b) ··· 1008 1001 * tipc_ehdr_validate - Validate an encryption message 1009 1002 * @skb: the message buffer 1010 1003 * 1011 - * Returns "true" if this is a valid encryption message, otherwise "false" 1004 + * Return: "true" if this is a valid encryption message, otherwise "false" 1012 1005 */ 1013 1006 bool tipc_ehdr_validate(struct sk_buff *skb) 1014 1007 { ··· 1681 1674 * Otherwise, the skb is freed! 1682 1675 * 1683 1676 * Return: 1684 - * 0 : the encryption has succeeded (or no encryption) 1685 - * -EINPROGRESS/-EBUSY : the encryption is ongoing, a callback will be made 1686 - * -ENOKEK : the encryption has failed due to no key 1687 - * -EKEYREVOKED : the encryption has failed due to key revoked 1688 - * -ENOMEM : the encryption has failed due to no memory 1689 - * < 0 : the encryption has failed due to other reasons 1677 + * * 0 : the encryption has succeeded (or no encryption) 1678 + * * -EINPROGRESS/-EBUSY : the encryption is ongoing, a callback will be made 1679 + * * -ENOKEK : the encryption has failed due to no key 1680 + * * -EKEYREVOKED : the encryption has failed due to key revoked 1681 + * * -ENOMEM : the encryption has failed due to no memory 1682 + * * < 0 : the encryption has failed due to other reasons 1690 1683 */ 1691 1684 int tipc_crypto_xmit(struct net *net, struct sk_buff **skb, 1692 1685 struct tipc_bearer *b, struct tipc_media_addr *dst, ··· 1806 1799 * cluster key(s) can be taken for decryption (- recursive). 1807 1800 * 1808 1801 * Return: 1809 - * 0 : the decryption has successfully completed 1810 - * -EINPROGRESS/-EBUSY : the decryption is ongoing, a callback will be made 1811 - * -ENOKEY : the decryption has failed due to no key 1812 - * -EBADMSG : the decryption has failed due to bad message 1813 - * -ENOMEM : the decryption has failed due to no memory 1814 - * < 0 : the decryption has failed due to other reasons 1802 + * * 0 : the decryption has successfully completed 1803 + * * -EINPROGRESS/-EBUSY : the decryption is ongoing, a callback will be made 1804 + * * -ENOKEY : the decryption has failed due to no key 1805 + * * -EBADMSG : the decryption has failed due to bad message 1806 + * * -ENOMEM : the decryption has failed due to no memory 1807 + * * < 0 : the decryption has failed due to other reasons 1815 1808 */ 1816 1809 int tipc_crypto_rcv(struct net *net, struct tipc_crypto *rx, 1817 1810 struct sk_buff **skb, struct tipc_bearer *b)
+3 -3
net/tipc/crypto.h
··· 1 1 /* SPDX-License-Identifier: GPL-2.0 */ 2 - /** 2 + /* 3 3 * net/tipc/crypto.h: Include file for TIPC crypto 4 4 * 5 5 * Copyright (c) 2019, Ericsson AB ··· 53 53 #define TIPC_AES_GCM_IV_SIZE 12 54 54 #define TIPC_AES_GCM_TAG_SIZE 16 55 55 56 - /** 56 + /* 57 57 * TIPC crypto modes: 58 58 * - CLUSTER_KEY: 59 59 * One single key is used for both TX & RX in all nodes in the cluster. ··· 69 69 extern int sysctl_tipc_max_tfms __read_mostly; 70 70 extern int sysctl_tipc_key_exchange_enabled __read_mostly; 71 71 72 - /** 72 + /* 73 73 * TIPC encryption message format: 74 74 * 75 75 * 3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0
+3 -2
net/tipc/discover.c
··· 74 74 /** 75 75 * tipc_disc_init_msg - initialize a link setup message 76 76 * @net: the applicable net namespace 77 + * @skb: buffer containing message 77 78 * @mtyp: message type (request or response) 78 79 * @b: ptr to bearer issuing message 79 80 */ ··· 342 341 * @dest: destination address for request messages 343 342 * @skb: pointer to created frame 344 343 * 345 - * Returns 0 if successful, otherwise -errno. 344 + * Return: 0 if successful, otherwise -errno. 346 345 */ 347 346 int tipc_disc_create(struct net *net, struct tipc_bearer *b, 348 347 struct tipc_media_addr *dest, struct sk_buff **skb) ··· 381 380 382 381 /** 383 382 * tipc_disc_delete - destroy object sending periodic link setup requests 384 - * @d: ptr to link duest structure 383 + * @d: ptr to link dest structure 385 384 */ 386 385 void tipc_disc_delete(struct tipc_discoverer *d) 387 386 {
+40 -6
net/tipc/link.c
··· 120 120 * @reasm_buf: head of partially reassembled inbound message fragments 121 121 * @bc_rcvr: marks that this is a broadcast receiver link 122 122 * @stats: collects statistics regarding link activity 123 + * @session: session to be used by link 124 + * @snd_nxt_state: next send seq number 125 + * @rcv_nxt_state: next rcv seq number 126 + * @in_session: have received ACTIVATE_MSG from peer 127 + * @active: link is active 128 + * @if_name: associated interface name 129 + * @rst_cnt: link reset counter 130 + * @drop_point: seq number for failover handling (FIXME) 131 + * @failover_reasm_skb: saved failover msg ptr (FIXME) 132 + * @failover_deferdq: deferred message queue for failover processing (FIXME) 133 + * @transmq: the link's transmit queue 134 + * @backlog: link's backlog by priority (importance) 135 + * @snd_nxt: next sequence number to be used 136 + * @rcv_unacked: # messages read by user, but not yet acked back to peer 137 + * @deferdq: deferred receive queue 138 + * @window: sliding window size for congestion handling 139 + * @min_win: minimal send window to be used by link 140 + * @ssthresh: slow start threshold for congestion handling 141 + * @max_win: maximal send window to be used by link 142 + * @cong_acks: congestion acks for congestion avoidance (FIXME) 143 + * @checkpoint: seq number for congestion window size handling 144 + * @reasm_tnlmsg: fragmentation/reassembly area for tunnel protocol message 145 + * @last_gap: last gap ack blocks for bcast (FIXME) 146 + * @last_ga: ptr to gap ack blocks 147 + * @bc_rcvlink: the peer specific link used for broadcast reception 148 + * @bc_sndlink: the namespace global link used for broadcast sending 149 + * @nack_state: bcast nack state 150 + * @bc_peer_is_up: peer has acked the bcast init msg 123 151 */ 124 152 struct tipc_link { 125 153 u32 addr; ··· 478 450 * @min_win: minimal send window to be used by link 479 451 * @max_win: maximal send window to be used by link 480 452 * @session: session to be used by link 481 - * @ownnode: identity of own node 482 453 * @peer: node id of peer node 483 454 * @peer_caps: bitmap describing peer node capabilities 484 455 * @bc_sndlink: the namespace global link used for broadcast sending ··· 485 458 * @inputq: queue to put messages ready for delivery 486 459 * @namedq: queue to put binding table update messages ready for delivery 487 460 * @link: return value, pointer to put the created link 461 + * @self: local unicast link id 462 + * @peer_id: 128-bit ID of peer 488 463 * 489 - * Returns true if link was created, otherwise false 464 + * Return: true if link was created, otherwise false 490 465 */ 491 466 bool tipc_link_create(struct net *net, char *if_name, int bearer_id, 492 467 int tolerance, char net_plane, u32 mtu, int priority, ··· 561 532 * @inputq: queue to put messages ready for delivery 562 533 * @namedq: queue to put binding table update messages ready for delivery 563 534 * @link: return value, pointer to put the created link 535 + * @ownnode: identity of own node 536 + * @peer: node id of peer node 537 + * @peer_id: 128-bit ID of peer 538 + * @peer_caps: bitmap describing peer node capabilities 539 + * @bc_sndlink: the namespace global link used for broadcast sending 564 540 * 565 - * Returns true if link was created, otherwise false 541 + * Return: true if link was created, otherwise false 566 542 */ 567 543 bool tipc_link_bc_create(struct net *net, u32 ownnode, u32 peer, u8 *peer_id, 568 544 int mtu, u32 min_win, u32 max_win, u16 peer_caps, ··· 822 788 * tipc_link_too_silent - check if link is "too silent" 823 789 * @l: tipc link to be checked 824 790 * 825 - * Returns true if the link 'silent_intv_cnt' is about to reach the 791 + * Return: true if the link 'silent_intv_cnt' is about to reach the 826 792 * 'abort_limit' value, otherwise false 827 793 */ 828 794 bool tipc_link_too_silent(struct tipc_link *l) ··· 1024 990 * @xmitq: returned list of packets to be sent by caller 1025 991 * 1026 992 * Consumes the buffer chain. 1027 - * Returns 0 if success, or errno: -ELINKCONG, -EMSGSIZE or -ENOBUFS 1028 993 * Messages at TIPC_SYSTEM_IMPORTANCE are always accepted 994 + * Return: 0 if success, or errno: -ELINKCONG, -EMSGSIZE or -ENOBUFS 1029 995 */ 1030 996 int tipc_link_xmit(struct tipc_link *l, struct sk_buff_head *list, 1031 997 struct sk_buff_head *xmitq) ··· 2410 2376 if (!msg_peer_node_is_up(hdr)) 2411 2377 return rc; 2412 2378 2413 - /* Open when peer ackowledges our bcast init msg (pkt #1) */ 2379 + /* Open when peer acknowledges our bcast init msg (pkt #1) */ 2414 2380 if (msg_ack(hdr)) 2415 2381 l->bc_peer_is_up = true; 2416 2382
+17 -12
net/tipc/msg.c
··· 58 58 /** 59 59 * tipc_buf_acquire - creates a TIPC message buffer 60 60 * @size: message size (including TIPC header) 61 + * @gfp: memory allocation flags 61 62 * 62 - * Returns a new buffer with data pointers set to the specified size. 63 + * Return: a new buffer with data pointers set to the specified size. 63 64 * 64 - * NOTE: Headroom is reserved to allow prepending of a data link header. 65 - * There may also be unrequested tailroom present at the buffer's end. 65 + * NOTE: 66 + * Headroom is reserved to allow prepending of a data link header. 67 + * There may also be unrequested tailroom present at the buffer's end. 66 68 */ 67 69 struct sk_buff *tipc_buf_acquire(u32 size, gfp_t gfp) 68 70 { ··· 209 207 * @m: the data to be appended 210 208 * @mss: max allowable size of buffer 211 209 * @dlen: size of data to be appended 212 - * @txq: queue to appand to 213 - * Returns the number og 1k blocks appended or errno value 210 + * @txq: queue to append to 211 + * 212 + * Return: the number of 1k blocks appended or errno value 214 213 */ 215 214 int tipc_msg_append(struct tipc_msg *_hdr, struct msghdr *m, int dlen, 216 215 int mss, struct sk_buff_head *txq) ··· 315 312 * @pktmax: max size of a fragment incl. the header 316 313 * @frags: returned fragment skb list 317 314 * 318 - * Returns 0 if the fragmentation is successful, otherwise: -EINVAL 315 + * Return: 0 if the fragmentation is successful, otherwise: -EINVAL 319 316 * or -ENOMEM 320 317 */ 321 318 int tipc_msg_fragment(struct sk_buff *skb, const struct tipc_msg *hdr, ··· 370 367 * tipc_msg_build - create buffer chain containing specified header and data 371 368 * @mhdr: Message header, to be prepended to data 372 369 * @m: User message 370 + * @offset: buffer offset for fragmented messages (FIXME) 373 371 * @dsz: Total length of user data 374 372 * @pktmax: Max packet size that can be used 375 373 * @list: Buffer or chain of buffers to be returned to caller ··· 378 374 * Note that the recursive call we are making here is safe, since it can 379 375 * logically go only one further level down. 380 376 * 381 - * Returns message data size or errno: -ENOMEM, -EFAULT 377 + * Return: message data size or errno: -ENOMEM, -EFAULT 382 378 */ 383 379 int tipc_msg_build(struct tipc_msg *mhdr, struct msghdr *m, int offset, 384 380 int dsz, int pktmax, struct sk_buff_head *list) ··· 489 485 * @msg: message to be appended 490 486 * @max: max allowable size for the bundle buffer 491 487 * 492 - * Returns "true" if bundling has been performed, otherwise "false" 488 + * Return: "true" if bundling has been performed, otherwise "false" 493 489 */ 494 490 static bool tipc_msg_bundle(struct sk_buff *bskb, struct tipc_msg *msg, 495 491 u32 max) ··· 584 580 * @skb: buffer to be extracted from. 585 581 * @iskb: extracted inner buffer, to be returned 586 582 * @pos: position in outer message of msg to be extracted. 587 - * Returns position of next msg 583 + * Returns position of next msg. 588 584 * Consumes outer buffer when last packet extracted 589 - * Returns true when there is an extracted buffer, otherwise false 585 + * Return: true when there is an extracted buffer, otherwise false 590 586 */ 591 587 bool tipc_msg_extract(struct sk_buff *skb, struct sk_buff **iskb, int *pos) 592 588 { ··· 630 626 * @skb: buffer containing message to be reversed; will be consumed 631 627 * @err: error code to be set in message, if any 632 628 * Replaces consumed buffer with new one when successful 633 - * Returns true if success, otherwise false 629 + * Return: true if success, otherwise false 634 630 */ 635 631 bool tipc_msg_reverse(u32 own_node, struct sk_buff **skb, int err) 636 632 { ··· 702 698 703 699 /** 704 700 * tipc_msg_lookup_dest(): try to find new destination for named message 701 + * @net: pointer to associated network namespace 705 702 * @skb: the buffer containing the message. 706 703 * @err: error code to be used by caller if lookup fails 707 704 * Does not consume buffer 708 - * Returns true if a destination is found, false otherwise 705 + * Return: true if a destination is found, false otherwise 709 706 */ 710 707 bool tipc_msg_lookup_dest(struct net *net, struct sk_buff *skb, int *err) 711 708 {
+28 -1
net/tipc/name_distr.c
··· 50 50 51 51 /** 52 52 * publ_to_item - add publication info to a publication message 53 + * @p: publication info 54 + * @i: location of item in the message 53 55 */ 54 56 static void publ_to_item(struct distr_item *i, struct publication *p) 55 57 { ··· 64 62 65 63 /** 66 64 * named_prepare_buf - allocate & initialize a publication message 65 + * @net: the associated network namespace 66 + * @type: message type 67 + * @size: payload size 68 + * @dest: destination node 67 69 * 68 70 * The buffer returned is of size INT_H_SIZE + payload size 69 71 */ ··· 89 83 90 84 /** 91 85 * tipc_named_publish - tell other nodes about a new publication by this node 86 + * @net: the associated network namespace 87 + * @publ: the new publication 92 88 */ 93 89 struct sk_buff *tipc_named_publish(struct net *net, struct publication *publ) 94 90 { ··· 119 111 120 112 /** 121 113 * tipc_named_withdraw - tell other nodes about a withdrawn publication by this node 114 + * @net: the associated network namespace 115 + * @publ: the withdrawn publication 122 116 */ 123 117 struct sk_buff *tipc_named_withdraw(struct net *net, struct publication *publ) 124 118 { ··· 148 138 149 139 /** 150 140 * named_distribute - prepare name info for bulk distribution to another node 141 + * @net: the associated network namespace 151 142 * @list: list of messages (buffers) to be returned from this function 152 143 * @dnode: node to be updated 153 144 * @pls: linked list of publication items to be packed into buffer chain 145 + * @seqno: sequence number for this message 154 146 */ 155 147 static void named_distribute(struct net *net, struct sk_buff_head *list, 156 148 u32 dnode, struct list_head *pls, u16 seqno) ··· 206 194 207 195 /** 208 196 * tipc_named_node_up - tell specified node about all publications by this node 197 + * @net: the associated network namespace 198 + * @dnode: destination node 199 + * @capabilities: peer node's capabilities 209 200 */ 210 201 void tipc_named_node_up(struct net *net, u32 dnode, u16 capabilities) 211 202 { ··· 232 217 233 218 /** 234 219 * tipc_publ_purge - remove publication associated with a failed node 220 + * @net: the associated network namespace 221 + * @publ: the publication to remove 222 + * @addr: failed node's address 235 223 * 236 224 * Invoked for each publication issued by a newly failed node. 237 225 * Removes publication structure from name table & deletes it. ··· 281 263 /** 282 264 * tipc_update_nametbl - try to process a nametable update and notify 283 265 * subscribers 266 + * @net: the associated network namespace 267 + * @i: location of item in the message 268 + * @node: node address 269 + * @dtype: name distributor message type 284 270 * 285 271 * tipc_nametbl_lock must be held. 286 - * Returns the publication item if successful, otherwise NULL. 272 + * Return: the publication item if successful, otherwise NULL. 287 273 */ 288 274 static bool tipc_update_nametbl(struct net *net, struct distr_item *i, 289 275 u32 node, u32 dtype) ··· 369 347 370 348 /** 371 349 * tipc_named_rcv - process name table update messages sent by another node 350 + * @net: the associated network namespace 351 + * @namedq: queue to receive from 352 + * @rcv_nxt: store last received seqno here 353 + * @open: last bulk msg was received (FIXME) 372 354 */ 373 355 void tipc_named_rcv(struct net *net, struct sk_buff_head *namedq, 374 356 u16 *rcv_nxt, bool *open) ··· 400 374 401 375 /** 402 376 * tipc_named_reinit - re-initialize local publications 377 + * @net: the associated network namespace 403 378 * 404 379 * This routine is called whenever TIPC networking is enabled. 405 380 * All name table entries published by this node are updated to reflect
+1 -1
net/tipc/name_distr.h
··· 46 46 * @type: name sequence type 47 47 * @lower: name sequence lower bound 48 48 * @upper: name sequence upper bound 49 - * @ref: publishing port reference 49 + * @port: publishing port reference 50 50 * @key: publication key 51 51 * 52 52 * ===> All fields are stored in network byte order. <===
+37 -9
net/tipc/name_table.c
··· 104 104 * range match 105 105 * @sr: the service range pointer as a loop cursor 106 106 * @sc: the pointer to tipc service which holds the service range rbtree 107 - * @start, end: the range (end >= start) for matching 107 + * @start: beginning of the search range (end >= start) for matching 108 + * @end: end of the search range (end >= start) for matching 108 109 */ 109 110 #define service_range_foreach_match(sr, sc, start, end) \ 110 111 for (sr = service_range_match_first((sc)->ranges.rb_node, \ ··· 119 118 /** 120 119 * service_range_match_first - find first service range matching a range 121 120 * @n: the root node of service range rbtree for searching 122 - * @start, end: the range (end >= start) for matching 121 + * @start: beginning of the search range (end >= start) for matching 122 + * @end: end of the search range (end >= start) for matching 123 123 * 124 124 * Return: the leftmost service range node in the rbtree that overlaps the 125 125 * specific range if any. Otherwise, returns NULL. ··· 169 167 /** 170 168 * service_range_match_next - find next service range matching a range 171 169 * @n: a node in service range rbtree from which the searching starts 172 - * @start, end: the range (end >= start) for matching 170 + * @start: beginning of the search range (end >= start) for matching 171 + * @end: end of the search range (end >= start) for matching 173 172 * 174 173 * Return: the next service range node to the given node in the rbtree that 175 174 * overlaps the specific range if any. Otherwise, returns NULL. ··· 222 219 223 220 /** 224 221 * tipc_publ_create - create a publication structure 222 + * @type: name sequence type 223 + * @lower: name sequence lower bound 224 + * @upper: name sequence upper bound 225 + * @scope: publication scope 226 + * @node: network address of publishing socket 227 + * @port: publishing port 228 + * @key: publication key 225 229 */ 226 230 static struct publication *tipc_publ_create(u32 type, u32 lower, u32 upper, 227 231 u32 scope, u32 node, u32 port, ··· 256 246 257 247 /** 258 248 * tipc_service_create - create a service structure for the specified 'type' 249 + * @type: service type 250 + * @hd: name_table services list 259 251 * 260 252 * Allocates a single range structure and sets it to all 0's. 261 253 */ ··· 374 362 375 363 /** 376 364 * tipc_service_remove_publ - remove a publication from a service 365 + * @sr: service_range to remove publication from 366 + * @node: target node 367 + * @key: target publication key 377 368 */ 378 369 static struct publication *tipc_service_remove_publ(struct service_range *sr, 379 370 u32 node, u32 key) ··· 393 378 return NULL; 394 379 } 395 380 396 - /** 381 + /* 397 382 * Code reused: time_after32() for the same purpose 398 383 */ 399 384 #define publication_after(pa, pb) time_after32((pa)->id, (pb)->id) ··· 411 396 * tipc_service_subscribe - attach a subscription, and optionally 412 397 * issue the prescribed number of events if there is any service 413 398 * range overlapping with the requested range 399 + * @service: the tipc_service to attach the @sub to 400 + * @sub: the subscription to attach 414 401 */ 415 402 static void tipc_service_subscribe(struct tipc_service *service, 416 403 struct tipc_subscription *sub) ··· 546 529 547 530 /** 548 531 * tipc_nametbl_translate - perform service instance to socket translation 549 - * 550 - * On entry, 'dnode' is the search domain used during translation. 532 + * @net: network namespace 533 + * @type: message type 534 + * @instance: message instance 535 + * @dnode: the search domain used during translation 551 536 * 552 537 * On exit: 553 538 * - if translation is deferred to another node, leave 'dnode' unchanged and 554 - * return 0 539 + * return 0 555 540 * - if translation is attempted and succeeds, set 'dnode' to the publishing 556 - * node and return the published (non-zero) port number 541 + * node and return the published (non-zero) port number 557 542 * - if translation is attempted and fails, set 'dnode' to 0 and return 0 558 543 * 559 544 * Note that for legacy users (node configured with Z.C.N address format) the ··· 776 757 777 758 /** 778 759 * tipc_nametbl_withdraw - withdraw a service binding 760 + * @net: network namespace 761 + * @type: service type 762 + * @lower: service range lower bound 763 + * @upper: service range upper bound 764 + * @key: target publication key 779 765 */ 780 766 int tipc_nametbl_withdraw(struct net *net, u32 type, u32 lower, 781 767 u32 upper, u32 key) ··· 816 792 817 793 /** 818 794 * tipc_nametbl_subscribe - add a subscription object to the name table 795 + * @sub: subscription to add 819 796 */ 820 797 bool tipc_nametbl_subscribe(struct tipc_subscription *sub) 821 798 { ··· 847 822 848 823 /** 849 824 * tipc_nametbl_unsubscribe - remove a subscription object from name table 825 + * @sub: subscription to remove 850 826 */ 851 827 void tipc_nametbl_unsubscribe(struct tipc_subscription *sub) 852 828 { ··· 897 871 } 898 872 899 873 /** 900 - * tipc_service_delete - purge all publications for a service and delete it 874 + * tipc_service_delete - purge all publications for a service and delete it 875 + * @net: the associated network namespace 876 + * @sc: tipc_service to delete 901 877 */ 902 878 static void tipc_service_delete(struct net *net, struct tipc_service *sc) 903 879 {
+6 -3
net/tipc/name_table.h
··· 60 60 * @key: publication key, unique across the cluster 61 61 * @id: publication id 62 62 * @binding_node: all publications from the same node which bound this one 63 - * - Remote publications: in node->publ_list 64 - * Used by node/name distr to withdraw publications when node is lost 63 + * - Remote publications: in node->publ_list; 64 + * Used by node/name distr to withdraw publications when node is lost 65 65 * - Local/node scope publications: in name_table->node_scope list 66 66 * - Local/cluster scope publications: in name_table->cluster_scope list 67 67 * @binding_sock: all publications from the same socket which bound this one ··· 92 92 93 93 /** 94 94 * struct name_table - table containing all existing port name publications 95 - * @seq_hlist: name sequence hash lists 95 + * @services: name sequence hash lists 96 96 * @node_scope: all local publications with node scope 97 97 * - used by name_distr during re-init of name table 98 98 * @cluster_scope: all local publications with cluster scope 99 99 * - used by name_distr to send bulk updates to new nodes 100 100 * - used by name_distr during re-init of name table 101 + * @cluster_scope_lock: lock for accessing @cluster_scope 101 102 * @local_publ_count: number of publications issued by this node 103 + * @rc_dests: destination node counter 104 + * @snd_nxt: next sequence number to be used 102 105 */ 103 106 struct name_table { 104 107 struct hlist_head services[TIPC_NAMETBL_SIZE];
+31 -6
net/tipc/node.c
··· 82 82 /** 83 83 * struct tipc_node - TIPC node structure 84 84 * @addr: network address of node 85 - * @ref: reference counter to node object 85 + * @kref: reference counter to node object 86 86 * @lock: rwlock governing access to structure 87 87 * @net: the applicable net namespace 88 88 * @hash: links to adjacent nodes in unsorted hash chain ··· 90 90 * @namedq: pointer to name table input queue with name table messages 91 91 * @active_links: bearer ids of active links, used as index into links[] array 92 92 * @links: array containing references to all links to node 93 + * @bc_entry: broadcast link entry 93 94 * @action_flags: bit mask of different types of node actions 94 95 * @state: connectivity state vs peer node 95 96 * @preliminary: a preliminary node or not 97 + * @failover_sent: failover sent or not 96 98 * @sync_point: sequence number where synch/failover is finished 97 99 * @list: links to adjacent nodes in sorted list of cluster's nodes 98 100 * @working_links: number of working links to node (both active and standby) ··· 102 100 * @capabilities: bitmap, indicating peer node's functional capabilities 103 101 * @signature: node instance identifier 104 102 * @link_id: local and remote bearer ids of changing link, if any 103 + * @peer_id: 128-bit ID of peer 104 + * @peer_id_string: ID string of peer 105 105 * @publ_list: list of publications 106 + * @conn_sks: list of connections (FIXME) 107 + * @timer: node's keepalive timer 108 + * @keepalive_intv: keepalive interval in milliseconds 106 109 * @rcu: rcu struct for tipc_node 107 110 * @delete_at: indicates the time for deleting a down node 111 + * @peer_net: peer's net namespace 112 + * @peer_hash_mix: hash for this peer (FIXME) 108 113 * @crypto_rx: RX crypto handler 109 114 */ 110 115 struct tipc_node { ··· 276 267 #ifdef CONFIG_TIPC_CRYPTO 277 268 /** 278 269 * tipc_node_crypto_rx - Retrieve crypto RX handle from node 270 + * @__n: target tipc_node 279 271 * Note: node ref counter must be held first! 280 272 */ 281 273 struct tipc_crypto *tipc_node_crypto_rx(struct tipc_node *__n) ··· 824 814 825 815 /** 826 816 * __tipc_node_link_up - handle addition of link 817 + * @n: target tipc_node 818 + * @bearer_id: id of the bearer 819 + * @xmitq: queue for messages to be xmited on 827 820 * Node lock must be held by caller 828 821 * Link becomes active (alone or shared) or standby, depending on its priority. 829 822 */ ··· 893 880 894 881 /** 895 882 * tipc_node_link_up - handle addition of link 883 + * @n: target tipc_node 884 + * @bearer_id: id of the bearer 885 + * @xmitq: queue for messages to be xmited on 896 886 * 897 887 * Link becomes active (alone or shared) or standby, depending on its priority. 898 888 */ ··· 916 900 * 917 901 * This function is only called in a very special situation where link 918 902 * failover can be already started on peer node but not on this node. 919 - * This can happen when e.g. 903 + * This can happen when e.g.:: 904 + * 920 905 * 1. Both links <1A-2A>, <1B-2B> down 921 906 * 2. Link endpoint 2A up, but 1A still down (e.g. due to network 922 - * disturbance, wrong session, etc.) 907 + * disturbance, wrong session, etc.) 923 908 * 3. Link <1B-2B> up 924 909 * 4. Link endpoint 2A down (e.g. due to link tolerance timeout) 925 910 * 5. Node 2 starts failover onto link <1B-2B> ··· 957 940 958 941 /** 959 942 * __tipc_node_link_down - handle loss of link 943 + * @n: target tipc_node 944 + * @bearer_id: id of the bearer 945 + * @xmitq: queue for messages to be xmited on 946 + * @maddr: output media address of the bearer 960 947 */ 961 948 static void __tipc_node_link_down(struct tipc_node *n, int *bearer_id, 962 949 struct sk_buff_head *xmitq, ··· 1546 1525 /** 1547 1526 * tipc_node_get_linkname - get the name of a link 1548 1527 * 1528 + * @net: the applicable net namespace 1549 1529 * @bearer_id: id of the bearer 1550 1530 * @addr: peer node address 1551 1531 * @linkname: link name output buffer 1532 + * @len: size of @linkname output buffer 1552 1533 * 1553 - * Returns 0 on success 1534 + * Return: 0 on success 1554 1535 */ 1555 1536 int tipc_node_get_linkname(struct net *net, u32 bearer_id, u32 addr, 1556 1537 char *linkname, size_t len) ··· 1671 1648 * @dnode: address of destination node 1672 1649 * @selector: a number used for deterministic link selection 1673 1650 * Consumes the buffer chain. 1674 - * Returns 0 if success, otherwise: -ELINKCONG,-EHOSTUNREACH,-EMSGSIZE,-ENOBUF 1651 + * Return: 0 if success, otherwise: -ELINKCONG,-EHOSTUNREACH,-EMSGSIZE,-ENOBUF 1675 1652 */ 1676 1653 int tipc_node_xmit(struct net *net, struct sk_buff_head *list, 1677 1654 u32 dnode, int selector) ··· 1904 1881 1905 1882 /** 1906 1883 * tipc_node_check_state - check and if necessary update node state 1884 + * @n: target tipc_node 1907 1885 * @skb: TIPC packet 1908 1886 * @bearer_id: identity of bearer delivering the packet 1909 - * Returns true if state and msg are ok, otherwise false 1887 + * @xmitq: queue for messages to be xmited on 1888 + * Return: true if state and msg are ok, otherwise false 1910 1889 */ 1911 1890 static bool tipc_node_check_state(struct tipc_node *n, struct sk_buff *skb, 1912 1891 int bearer_id, struct sk_buff_head *xmitq)
+58 -32
net/tipc/socket.c
··· 80 80 * @maxnagle: maximum size of msg which can be subject to nagle 81 81 * @portid: unique port identity in TIPC socket hash table 82 82 * @phdr: preformatted message header used when sending messages 83 - * #cong_links: list of congested links 83 + * @cong_links: list of congested links 84 84 * @publications: list of publications for port 85 85 * @blocking_link: address of the congested link we are currently sleeping on 86 86 * @pub_count: total # of publications port has made during its lifetime 87 87 * @conn_timeout: the time we can wait for an unresponded setup request 88 + * @probe_unacked: probe has not received ack yet 88 89 * @dupl_rcvcnt: number of bytes counted twice, in both backlog and rcv queue 89 90 * @cong_link_cnt: number of congested links 90 91 * @snt_unacked: # messages sent by socket, and not yet acked by peer 92 + * @snd_win: send window size 93 + * @peer_caps: peer capabilities mask 91 94 * @rcv_unacked: # messages read by user, but not yet acked back to peer 95 + * @rcv_win: receive window size 92 96 * @peer: 'connected' peer for dgram/rdm 93 97 * @node: hash table node 94 98 * @mc_method: cookie for use between socket and broadcast layer 95 99 * @rcu: rcu struct for tipc_sock 100 + * @group: TIPC communications group 101 + * @oneway: message count in one direction (FIXME) 102 + * @nagle_start: current nagle value 103 + * @snd_backlog: send backlog count 104 + * @msg_acc: messages accepted; used in managing backlog and nagle 105 + * @pkt_cnt: TIPC socket packet count 106 + * @expect_ack: whether this TIPC socket is expecting an ack 107 + * @nodelay: setsockopt() TIPC_NODELAY setting 108 + * @group_is_open: TIPC socket group is fully open (FIXME) 96 109 */ 97 110 struct tipc_sock { 98 111 struct sock sk; ··· 274 261 275 262 /** 276 263 * tsk_advance_rx_queue - discard first buffer in socket receive queue 264 + * @sk: network socket 277 265 * 278 266 * Caller must hold socket lock 279 267 */ ··· 303 289 304 290 /** 305 291 * tsk_rej_rx_queue - reject all buffers in socket receive queue 292 + * @sk: network socket 293 + * @error: response error code 306 294 * 307 295 * Caller must hold socket lock 308 296 */ ··· 458 442 * This routine creates additional data structures used by the TIPC socket, 459 443 * initializes them, and links them together. 460 444 * 461 - * Returns 0 on success, errno otherwise 445 + * Return: 0 on success, errno otherwise 462 446 */ 463 447 static int tipc_sk_create(struct net *net, struct socket *sock, 464 448 int protocol, int kern) ··· 623 607 * are returned or discarded according to the "destination droppable" setting 624 608 * specified for the message by the sender. 625 609 * 626 - * Returns 0 on success, errno otherwise 610 + * Return: 0 on success, errno otherwise 627 611 */ 628 612 static int tipc_release(struct socket *sock) 629 613 { ··· 670 654 * a negative scope value unbinds the specified name. Specifying no name 671 655 * (i.e. a socket address length of 0) unbinds all names from the socket. 672 656 * 673 - * Returns 0 on success, errno otherwise 657 + * Return: 0 on success, errno otherwise 674 658 * 675 659 * NOTE: This routine doesn't need to take the socket lock since it doesn't 676 660 * access any non-constant socket information. ··· 731 715 * @uaddr: area for returned socket address 732 716 * @peer: 0 = own ID, 1 = current peer ID, 2 = current/former peer ID 733 717 * 734 - * Returns 0 on success, errno otherwise 718 + * Return: 0 on success, errno otherwise 735 719 * 736 720 * NOTE: This routine doesn't need to take the socket lock since it only 737 721 * accesses socket information that is unchanging (or which changes in ··· 770 754 * @sock: socket for which to calculate the poll bits 771 755 * @wait: ??? 772 756 * 773 - * Returns pollmask value 757 + * Return: pollmask value 774 758 * 775 759 * COMMENTARY: 776 760 * It appears that the usual socket locking mechanisms are not useful here ··· 832 816 * @timeout: timeout to wait for wakeup 833 817 * 834 818 * Called from function tipc_sendmsg(), which has done all sanity checks 835 - * Returns the number of bytes sent on success, or errno 819 + * Return: the number of bytes sent on success, or errno 836 820 */ 837 821 static int tipc_sendmcast(struct socket *sock, struct tipc_service_range *seq, 838 822 struct msghdr *msg, size_t dlen, long timeout) ··· 892 876 /** 893 877 * tipc_send_group_msg - send a message to a member in the group 894 878 * @net: network namespace 879 + * @tsk: tipc socket 895 880 * @m: message to send 896 881 * @mb: group member 897 882 * @dnode: destination node ··· 948 931 * @timeout: timeout to wait for wakeup 949 932 * 950 933 * Called from function tipc_sendmsg(), which has done all sanity checks 951 - * Returns the number of bytes sent on success, or errno 934 + * Return: the number of bytes sent on success, or errno 952 935 */ 953 936 static int tipc_send_group_unicast(struct socket *sock, struct msghdr *m, 954 937 int dlen, long timeout) ··· 992 975 * @timeout: timeout to wait for wakeup 993 976 * 994 977 * Called from function tipc_sendmsg(), which has done all sanity checks 995 - * Returns the number of bytes sent on success, or errno 978 + * Return: the number of bytes sent on success, or errno 996 979 */ 997 980 static int tipc_send_group_anycast(struct socket *sock, struct msghdr *m, 998 981 int dlen, long timeout) ··· 1077 1060 * @timeout: timeout to wait for wakeup 1078 1061 * 1079 1062 * Called from function tipc_sendmsg(), which has done all sanity checks 1080 - * Returns the number of bytes sent on success, or errno 1063 + * Return: the number of bytes sent on success, or errno 1081 1064 */ 1082 1065 static int tipc_send_group_bcast(struct socket *sock, struct msghdr *m, 1083 1066 int dlen, long timeout) ··· 1151 1134 * @timeout: timeout to wait for wakeup 1152 1135 * 1153 1136 * Called from function tipc_sendmsg(), which has done all sanity checks 1154 - * Returns the number of bytes sent on success, or errno 1137 + * Return: the number of bytes sent on success, or errno 1155 1138 */ 1156 1139 static int tipc_send_group_mcast(struct socket *sock, struct msghdr *m, 1157 1140 int dlen, long timeout) ··· 1188 1171 1189 1172 /** 1190 1173 * tipc_sk_mcast_rcv - Deliver multicast messages to all destination sockets 1174 + * @net: the associated network namespace 1191 1175 * @arrvq: queue with arriving messages, to be cloned after destination lookup 1192 1176 * @inputq: queue with cloned messages, delivered to socket after dest lookup 1193 1177 * ··· 1328 1310 * tipc_sk_conn_proto_rcv - receive a connection mng protocol message 1329 1311 * @tsk: receiving socket 1330 1312 * @skb: pointer to message buffer. 1313 + * @inputq: buffer list containing the buffers 1314 + * @xmitq: output message area 1331 1315 */ 1332 1316 static void tipc_sk_conn_proto_rcv(struct tipc_sock *tsk, struct sk_buff *skb, 1333 1317 struct sk_buff_head *inputq, ··· 1397 1377 * and for 'SYN' messages on SOCK_SEQPACKET and SOCK_STREAM connections. 1398 1378 * (Note: 'SYN+' is prohibited on SOCK_STREAM.) 1399 1379 * 1400 - * Returns the number of bytes sent on success, or errno otherwise 1380 + * Return: the number of bytes sent on success, or errno otherwise 1401 1381 */ 1402 1382 static int tipc_sendmsg(struct socket *sock, 1403 1383 struct msghdr *m, size_t dsz) ··· 1542 1522 * 1543 1523 * Used for SOCK_STREAM data. 1544 1524 * 1545 - * Returns the number of bytes sent on success (or partial success), 1525 + * Return: the number of bytes sent on success (or partial success), 1546 1526 * or errno if no data sent 1547 1527 */ 1548 1528 static int tipc_sendstream(struct socket *sock, struct msghdr *m, size_t dsz) ··· 1650 1630 * 1651 1631 * Used for SOCK_SEQPACKET messages. 1652 1632 * 1653 - * Returns the number of bytes sent on success, or errno otherwise 1633 + * Return: the number of bytes sent on success, or errno otherwise 1654 1634 */ 1655 1635 static int tipc_send_packet(struct socket *sock, struct msghdr *m, size_t dsz) 1656 1636 { ··· 1735 1715 * 1736 1716 * Note: Ancillary data is not captured if not requested by receiver. 1737 1717 * 1738 - * Returns 0 if successful, otherwise errno 1718 + * Return: 0 if successful, otherwise errno 1739 1719 */ 1740 1720 static int tipc_sk_anc_data_recv(struct msghdr *m, struct sk_buff *skb, 1741 1721 struct tipc_sock *tsk) ··· 1885 1865 1886 1866 /** 1887 1867 * tipc_recvmsg - receive packet-oriented message 1868 + * @sock: network socket 1888 1869 * @m: descriptor for message info 1889 1870 * @buflen: length of user buffer area 1890 1871 * @flags: receive flags ··· 1893 1872 * Used for SOCK_DGRAM, SOCK_RDM, and SOCK_SEQPACKET messages. 1894 1873 * If the complete message doesn't fit in user area, truncate it. 1895 1874 * 1896 - * Returns size of returned message data, errno otherwise 1875 + * Return: size of returned message data, errno otherwise 1897 1876 */ 1898 1877 static int tipc_recvmsg(struct socket *sock, struct msghdr *m, 1899 1878 size_t buflen, int flags) ··· 1994 1973 1995 1974 /** 1996 1975 * tipc_recvstream - receive stream-oriented data 1976 + * @sock: network socket 1997 1977 * @m: descriptor for message info 1998 1978 * @buflen: total size of user buffer area 1999 1979 * @flags: receive flags ··· 2002 1980 * Used for SOCK_STREAM messages only. If not enough data is available 2003 1981 * will optionally wait for more; never truncates data. 2004 1982 * 2005 - * Returns size of returned message data, errno otherwise 1983 + * Return: size of returned message data, errno otherwise 2006 1984 */ 2007 1985 static int tipc_recvstream(struct socket *sock, struct msghdr *m, 2008 1986 size_t buflen, int flags) ··· 2180 2158 * @tsk: TIPC socket 2181 2159 * @skb: pointer to message buffer. 2182 2160 * @xmitq: for Nagle ACK if any 2183 - * Returns true if message should be added to receive queue, false otherwise 2161 + * Return: true if message should be added to receive queue, false otherwise 2184 2162 */ 2185 2163 static bool tipc_sk_filter_connect(struct tipc_sock *tsk, struct sk_buff *skb, 2186 2164 struct sk_buff_head *xmitq) ··· 2294 2272 * TIPC_HIGH_IMPORTANCE (8 MB) 2295 2273 * TIPC_CRITICAL_IMPORTANCE (16 MB) 2296 2274 * 2297 - * Returns overload limit according to corresponding message importance 2275 + * Return: overload limit according to corresponding message importance 2298 2276 */ 2299 2277 static unsigned int rcvbuf_limit(struct sock *sk, struct sk_buff *skb) 2300 2278 { ··· 2317 2295 * tipc_sk_filter_rcv - validate incoming message 2318 2296 * @sk: socket 2319 2297 * @skb: pointer to message. 2298 + * @xmitq: output message area (FIXME) 2320 2299 * 2321 2300 * Enqueues message on receive queue if acceptable; optionally handles 2322 2301 * disconnect indication for a connected socket. 2323 2302 * 2324 2303 * Called with socket lock already taken 2325 - * 2326 2304 */ 2327 2305 static void tipc_sk_filter_rcv(struct sock *sk, struct sk_buff *skb, 2328 2306 struct sk_buff_head *xmitq) ··· 2412 2390 * @inputq: list of incoming buffers with potentially different destinations 2413 2391 * @sk: socket where the buffers should be enqueued 2414 2392 * @dport: port number for the socket 2393 + * @xmitq: output queue 2415 2394 * 2416 2395 * Caller must hold socket lock 2417 2396 */ ··· 2465 2442 2466 2443 /** 2467 2444 * tipc_sk_rcv - handle a chain of incoming buffers 2445 + * @net: the associated network namespace 2468 2446 * @inputq: buffer list containing the buffers 2469 2447 * Consumes all buffers in list until inputq is empty 2470 2448 * Note: may be called in multiple threads referring to the same queue ··· 2558 2534 * @destlen: size of socket address data structure 2559 2535 * @flags: file-related flags associated with socket 2560 2536 * 2561 - * Returns 0 on success, errno otherwise 2537 + * Return: 0 on success, errno otherwise 2562 2538 */ 2563 2539 static int tipc_connect(struct socket *sock, struct sockaddr *dest, 2564 2540 int destlen, int flags) ··· 2651 2627 * @sock: socket structure 2652 2628 * @len: (unused) 2653 2629 * 2654 - * Returns 0 on success, errno otherwise 2630 + * Return: 0 on success, errno otherwise 2655 2631 */ 2656 2632 static int tipc_listen(struct socket *sock, int len) 2657 2633 { ··· 2703 2679 * @sock: listening socket 2704 2680 * @new_sock: new socket that is to be connected 2705 2681 * @flags: file-related flags associated with socket 2682 + * @kern: caused by kernel or by userspace? 2706 2683 * 2707 - * Returns 0 on success, errno otherwise 2684 + * Return: 0 on success, errno otherwise 2708 2685 */ 2709 2686 static int tipc_accept(struct socket *sock, struct socket *new_sock, int flags, 2710 2687 bool kern) ··· 2784 2759 * 2785 2760 * Terminates connection (if necessary), then purges socket's receive queue. 2786 2761 * 2787 - * Returns 0 on success, errno otherwise 2762 + * Return: 0 on success, errno otherwise 2788 2763 */ 2789 2764 static int tipc_shutdown(struct socket *sock, int how) 2790 2765 { ··· 3127 3102 * For stream sockets only, accepts and ignores all IPPROTO_TCP options 3128 3103 * (to ease compatibility). 3129 3104 * 3130 - * Returns 0 on success, errno otherwise 3105 + * Return: 0 on success, errno otherwise 3131 3106 */ 3132 3107 static int tipc_setsockopt(struct socket *sock, int lvl, int opt, 3133 3108 sockptr_t ov, unsigned int ol) ··· 3221 3196 * For stream sockets only, returns 0 length result for all IPPROTO_TCP options 3222 3197 * (to ease compatibility). 3223 3198 * 3224 - * Returns 0 on success, errno otherwise 3199 + * Return: 0 on success, errno otherwise 3225 3200 */ 3226 3201 static int tipc_getsockopt(struct socket *sock, int lvl, int opt, 3227 3202 char __user *ov, int __user *ol) ··· 3425 3400 /** 3426 3401 * tipc_socket_init - initialize TIPC socket interface 3427 3402 * 3428 - * Returns 0 on success, errno otherwise 3403 + * Return: 0 on success, errno otherwise 3429 3404 */ 3430 3405 int tipc_socket_init(void) 3431 3406 { ··· 3824 3799 /** 3825 3800 * tipc_sk_filtering - check if a socket should be traced 3826 3801 * @sk: the socket to be examined 3827 - * @sysctl_tipc_sk_filter[]: the socket tuple for filtering, 3828 - * (portid, sock type, name type, name lower, name upper) 3829 3802 * 3830 - * Returns true if the socket meets the socket tuple data 3803 + * @sysctl_tipc_sk_filter is used as the socket tuple for filtering: 3804 + * (portid, sock type, name type, name lower, name upper) 3805 + * 3806 + * Return: true if the socket meets the socket tuple data 3831 3807 * (value 0 = 'any') or when there is no tuple set (all = 0), 3832 3808 * otherwise false 3833 3809 */ ··· 3893 3867 * @sk: tipc sk to be checked 3894 3868 * @skb: tipc msg to be checked 3895 3869 * 3896 - * Returns true if the socket rx queue allocation is > 90%, otherwise false 3870 + * Return: true if the socket rx queue allocation is > 90%, otherwise false 3897 3871 */ 3898 3872 3899 3873 bool tipc_sk_overlimit1(struct sock *sk, struct sk_buff *skb) ··· 3911 3885 * @sk: tipc sk to be checked 3912 3886 * @skb: tipc msg to be checked 3913 3887 * 3914 - * Returns true if the socket rx queue allocation is > 90%, otherwise false 3888 + * Return: true if the socket rx queue allocation is > 90%, otherwise false 3915 3889 */ 3916 3890 3917 3891 bool tipc_sk_overlimit2(struct sock *sk, struct sk_buff *skb)
+5 -3
net/tipc/subscr.c
··· 56 56 } 57 57 58 58 /** 59 - * tipc_sub_check_overlap - test for subscription overlap with the 60 - * given values 59 + * tipc_sub_check_overlap - test for subscription overlap with the given values 60 + * @seq: tipc_name_seq to check 61 + * @found_lower: lower value to test 62 + * @found_upper: upper value to test 61 63 * 62 - * Returns 1 if there is overlap, otherwise 0. 64 + * Return: 1 if there is overlap, otherwise 0. 63 65 */ 64 66 int tipc_sub_check_overlap(struct tipc_service_range *seq, u32 found_lower, 65 67 u32 found_upper)
+7 -4
net/tipc/subscr.h
··· 48 48 49 49 /** 50 50 * struct tipc_subscription - TIPC network topology subscription object 51 - * @subscriber: pointer to its subscriber 52 - * @seq: name sequence associated with subscription 51 + * @kref: reference count for this subscription 52 + * @net: network namespace associated with subscription 53 53 * @timer: timer governing subscription duration (optional) 54 - * @nameseq_list: adjacent subscriptions in name sequence's subscription list 54 + * @service_list: adjacent subscriptions in name sequence's subscription list 55 55 * @sub_list: adjacent subscriptions in subscriber's subscription list 56 56 * @evt: template for events generated by subscription 57 + * @conid: connection identifier of topology server 58 + * @inactive: true if this subscription is inactive 59 + * @lock: serialize up/down and timer events 57 60 */ 58 61 struct tipc_subscription { 59 62 struct kref kref; ··· 67 64 struct tipc_event evt; 68 65 int conid; 69 66 bool inactive; 70 - spinlock_t lock; /* serialize up/down and timer events */ 67 + spinlock_t lock; 71 68 }; 72 69 73 70 struct tipc_subscription *tipc_sub_subscribe(struct net *net,
+1 -1
net/tipc/trace.c
··· 36 36 #define CREATE_TRACE_POINTS 37 37 #include "trace.h" 38 38 39 - /** 39 + /* 40 40 * socket tuples for filtering in socket traces: 41 41 * (portid, sock type, name type, name lower, name upper) 42 42 */
+7 -1
net/tipc/udp_media.c
··· 64 64 * 65 65 * This is the bearer level originating address used in neighbor discovery 66 66 * messages, and all fields should be in network byte order 67 + * 68 + * @proto: Ethernet protocol in use 69 + * @port: port being used 70 + * @ipv4: IPv4 address of neighbor 71 + * @ipv6: IPv6 address of neighbor 67 72 */ 68 73 struct udp_media_addr { 69 74 __be16 proto; ··· 93 88 * @ubsock: bearer associated socket 94 89 * @ifindex: local address scope 95 90 * @work: used to schedule deferred work on a bearer 91 + * @rcast: associated udp_replicast container 96 92 */ 97 93 struct udp_bearer { 98 94 struct tipc_bearer __rcu *bearer; ··· 778 772 if (err) 779 773 goto free; 780 774 781 - /** 775 + /* 782 776 * The bcast media address port is used for all peers and the ip 783 777 * is used if it's a multicast address. 784 778 */