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

RDMA/iwpm: move kdoc comments to functions

Move the iwpm kdoc comments from the prototype declarations to above
the function bodies. There are no functional changes in this patch.

Signed-off-by: Steve Wise <swise@opengridcomputing.com>
Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>

authored by

Steve Wise and committed by
Jason Gunthorpe
a2bfd708 a78e8723

+123 -182
+83 -33
drivers/infiniband/core/iwpm_msg.c
··· 38 38 static int iwpm_user_pid = IWPM_PID_UNDEFINED; 39 39 static atomic_t echo_nlmsg_seq; 40 40 41 + /** 42 + * iwpm_valid_pid - Check if the userspace iwarp port mapper pid is valid 43 + * 44 + * Returns true if the pid is greater than zero, otherwise returns false 45 + */ 41 46 int iwpm_valid_pid(void) 42 47 { 43 48 return iwpm_user_pid > 0; 44 49 } 45 50 46 - /* 47 - * iwpm_register_pid - Send a netlink query to user space 48 - * for the iwarp port mapper pid 51 + /** 52 + * iwpm_register_pid - Send a netlink query to userspace 53 + * to get the iwarp port mapper pid 54 + * @pm_msg: Contains driver info to send to the userspace port mapper 55 + * @nl_client: The index of the netlink client 49 56 * 50 57 * nlmsg attributes: 51 58 * [IWPM_NLA_REG_PID_SEQ] ··· 131 124 return ret; 132 125 } 133 126 134 - /* 135 - * iwpm_add_mapping - Send a netlink add mapping message 136 - * to the port mapper 127 + /** 128 + * iwpm_add_mapping - Send a netlink add mapping request to 129 + * the userspace port mapper 130 + * @pm_msg: Contains the local ip/tcp address info to send 131 + * @nl_client: The index of the netlink client 132 + * 137 133 * nlmsg attributes: 138 134 * [IWPM_NLA_MANAGE_MAPPING_SEQ] 139 135 * [IWPM_NLA_MANAGE_ADDR] 140 136 * [IWPM_NLA_MANAGE_FLAGS] 137 + * 138 + * If the request is successful, the pm_msg stores 139 + * the port mapper response (mapped address info) 141 140 */ 142 141 int iwpm_add_mapping(struct iwpm_sa_data *pm_msg, u8 nl_client) 143 142 { ··· 221 208 return ret; 222 209 } 223 210 224 - /* 225 - * iwpm_add_and_query_mapping - Send a netlink add and query 226 - * mapping message to the port mapper 211 + /** 212 + * iwpm_add_and_query_mapping - Process the port mapper response to 213 + * iwpm_add_and_query_mapping request 214 + * @pm_msg: Contains the local ip/tcp address info to send 215 + * @nl_client: The index of the netlink client 216 + * 227 217 * nlmsg attributes: 228 218 * [IWPM_NLA_QUERY_MAPPING_SEQ] 229 219 * [IWPM_NLA_QUERY_LOCAL_ADDR] ··· 315 299 return ret; 316 300 } 317 301 318 - /* 319 - * iwpm_remove_mapping - Send a netlink remove mapping message 320 - * to the port mapper 302 + /** 303 + * iwpm_remove_mapping - Send a netlink remove mapping request 304 + * to the userspace port mapper 305 + * 306 + * @local_addr: Local ip/tcp address to remove 307 + * @nl_client: The index of the netlink client 308 + * 321 309 * nlmsg attributes: 322 310 * [IWPM_NLA_MANAGE_MAPPING_SEQ] 323 311 * [IWPM_NLA_MANAGE_ADDR] ··· 392 372 [IWPM_NLA_RREG_PID_ERR] = { .type = NLA_U16 } 393 373 }; 394 374 395 - /* 396 - * iwpm_register_pid_cb - Process a port mapper response to 397 - * iwpm_register_pid() 375 + /** 376 + * iwpm_register_pid_cb - Process the port mapper response to 377 + * iwpm_register_pid query 378 + * @skb: 379 + * @cb: Contains the received message (payload and netlink header) 380 + * 381 + * If successful, the function receives the userspace port mapper pid 382 + * which is used in future communication with the port mapper 398 383 */ 399 384 int iwpm_register_pid_cb(struct sk_buff *skb, struct netlink_callback *cb) 400 385 { ··· 468 443 [IWPM_NLA_RMANAGE_MAPPING_ERR] = { .type = NLA_U16 } 469 444 }; 470 445 471 - /* 472 - * iwpm_add_mapping_cb - Process a port mapper response to 473 - * iwpm_add_mapping() 446 + /** 447 + * iwpm_add_mapping_cb - Process the port mapper response to 448 + * iwpm_add_mapping request 449 + * @skb: 450 + * @cb: Contains the received message (payload and netlink header) 474 451 */ 475 452 int iwpm_add_mapping_cb(struct sk_buff *skb, struct netlink_callback *cb) 476 453 { ··· 545 518 [IWPM_NLA_RQUERY_MAPPING_ERR] = { .type = NLA_U16 } 546 519 }; 547 520 548 - /* 549 - * iwpm_add_and_query_mapping_cb - Process a port mapper response to 550 - * iwpm_add_and_query_mapping() 521 + /** 522 + * iwpm_add_and_query_mapping_cb - Process the port mapper response to 523 + * iwpm_add_and_query_mapping request 524 + * @skb: 525 + * @cb: Contains the received message (payload and netlink header) 551 526 */ 552 527 int iwpm_add_and_query_mapping_cb(struct sk_buff *skb, 553 528 struct netlink_callback *cb) ··· 627 598 return 0; 628 599 } 629 600 630 - /* 631 - * iwpm_remote_info_cb - Process a port mapper message, containing 632 - * the remote connecting peer address info 601 + /** 602 + * iwpm_remote_info_cb - Process remote connecting peer address info, which 603 + * the port mapper has received from the connecting peer 604 + * @skb: 605 + * @cb: Contains the received message (payload and netlink header) 606 + * 607 + * Stores the IPv4/IPv6 address info in a hash table 633 608 */ 634 609 int iwpm_remote_info_cb(struct sk_buff *skb, struct netlink_callback *cb) 635 610 { ··· 706 673 [IWPM_NLA_MAPINFO_ULIB_VER] = { .type = NLA_U16 } 707 674 }; 708 675 709 - /* 710 - * iwpm_mapping_info_cb - Process a port mapper request for mapping info 676 + /** 677 + * iwpm_mapping_info_cb - Process a notification that the userspace 678 + * port mapper daemon is started 679 + * @skb: 680 + * @cb: Contains the received message (payload and netlink header) 681 + * 682 + * Using the received port mapper pid, send all the local mapping 683 + * info records to the userspace port mapper 711 684 */ 712 685 int iwpm_mapping_info_cb(struct sk_buff *skb, struct netlink_callback *cb) 713 686 { ··· 766 727 [IWPM_NLA_MAPINFO_ACK_NUM] = { .type = NLA_U32 } 767 728 }; 768 729 769 - /* 770 - * iwpm_ack_mapping_info_cb - Process a port mapper ack for 771 - * the provided mapping info records 730 + /** 731 + * iwpm_ack_mapping_info_cb - Process the port mapper ack for 732 + * the provided local mapping info records 733 + * @skb: 734 + * @cb: Contains the received message (payload and netlink header) 772 735 */ 773 736 int iwpm_ack_mapping_info_cb(struct sk_buff *skb, struct netlink_callback *cb) 774 737 { ··· 796 755 [IWPM_NLA_ERR_CODE] = { .type = NLA_U16 }, 797 756 }; 798 757 799 - /* 800 - * iwpm_mapping_error_cb - Process a port mapper error message 758 + /** 759 + * iwpm_mapping_error_cb - Process port mapper notification for error 760 + * 761 + * @skb: 762 + * @cb: Contains the received message (payload and netlink header) 801 763 */ 802 764 int iwpm_mapping_error_cb(struct sk_buff *skb, struct netlink_callback *cb) 803 765 { ··· 841 797 [IWPM_NLA_HELLO_ABI_VERSION] = { .type = NLA_U16 } 842 798 }; 843 799 844 - /* 845 - * iwpm_hello_cb - Process a port mapper hello request 800 + /** 801 + * iwpm_hello_cb - Process a hello message from iwpmd 802 + * 803 + * @skb: 804 + * @cb: Contains the received message (payload and netlink header) 805 + * 806 + * Using the received port mapper pid, send the kernel's abi_version 807 + * after adjusting it to support the iwpmd version. 846 808 */ 847 809 int iwpm_hello_cb(struct sk_buff *skb, struct netlink_callback *cb) 848 810 {
+40
drivers/infiniband/core/iwpm_util.c
··· 51 51 static DEFINE_MUTEX(iwpm_admin_lock); 52 52 static struct iwpm_admin_data iwpm_admin; 53 53 54 + /** 55 + * iwpm_init - Allocate resources for the iwarp port mapper 56 + * @nl_client: The index of the netlink client 57 + * 58 + * Should be called when network interface goes up. 59 + */ 54 60 int iwpm_init(u8 nl_client) 55 61 { 56 62 int ret = 0; ··· 93 87 static void free_hash_bucket(void); 94 88 static void free_reminfo_bucket(void); 95 89 90 + /** 91 + * iwpm_exit - Deallocate resources for the iwarp port mapper 92 + * @nl_client: The index of the netlink client 93 + * 94 + * Should be called when network interface goes down. 95 + */ 96 96 int iwpm_exit(u8 nl_client) 97 97 { 98 98 ··· 124 112 static struct hlist_head *get_mapinfo_hash_bucket(struct sockaddr_storage *, 125 113 struct sockaddr_storage *); 126 114 115 + /** 116 + * iwpm_create_mapinfo - Store local and mapped IPv4/IPv6 address 117 + * info in a hash table 118 + * @local_addr: Local ip/tcp address 119 + * @mapped_addr: Mapped local ip/tcp address 120 + * @nl_client: The index of the netlink client 121 + * @map_flags: IWPM mapping flags 122 + */ 127 123 int iwpm_create_mapinfo(struct sockaddr_storage *local_sockaddr, 128 124 struct sockaddr_storage *mapped_sockaddr, 129 125 u8 nl_client, u32 map_flags) ··· 171 151 return ret; 172 152 } 173 153 154 + /** 155 + * iwpm_remove_mapinfo - Remove local and mapped IPv4/IPv6 address 156 + * info from the hash table 157 + * @local_addr: Local ip/tcp address 158 + * @mapped_local_addr: Mapped local ip/tcp address 159 + * 160 + * Returns err code if mapping info is not found in the hash table, 161 + * otherwise returns 0 162 + */ 174 163 int iwpm_remove_mapinfo(struct sockaddr_storage *local_sockaddr, 175 164 struct sockaddr_storage *mapped_local_addr) 176 165 { ··· 280 251 spin_unlock_irqrestore(&iwpm_reminfo_lock, flags); 281 252 } 282 253 254 + /** 255 + * iwpm_get_remote_info - Get the remote connecting peer address info 256 + * 257 + * @mapped_loc_addr: Mapped local address of the listening peer 258 + * @mapped_rem_addr: Mapped remote address of the connecting peer 259 + * @remote_addr: To store the remote address of the connecting peer 260 + * @nl_client: The index of the netlink client 261 + * 262 + * The remote address info is retrieved and provided to the client in 263 + * the remote_addr. After that it is removed from the hash table 264 + */ 283 265 int iwpm_get_remote_info(struct sockaddr_storage *mapped_loc_addr, 284 266 struct sockaddr_storage *mapped_rem_addr, 285 267 struct sockaddr_storage *remote_addr,
-149
include/rdma/iw_portmap.h
··· 61 61 u32 flags; 62 62 }; 63 63 64 - /** 65 - * iwpm_init - Allocate resources for the iwarp port mapper 66 - * 67 - * Should be called when network interface goes up. 68 - */ 69 64 int iwpm_init(u8); 70 - 71 - /** 72 - * iwpm_exit - Deallocate resources for the iwarp port mapper 73 - * 74 - * Should be called when network interface goes down. 75 - */ 76 65 int iwpm_exit(u8); 77 - 78 - /** 79 - * iwpm_valid_pid - Check if the userspace iwarp port mapper pid is valid 80 - * 81 - * Returns true if the pid is greater than zero, otherwise returns false 82 - */ 83 66 int iwpm_valid_pid(void); 84 - 85 - /** 86 - * iwpm_register_pid - Send a netlink query to userspace 87 - * to get the iwarp port mapper pid 88 - * @pm_msg: Contains driver info to send to the userspace port mapper 89 - * @nl_client: The index of the netlink client 90 - */ 91 67 int iwpm_register_pid(struct iwpm_dev_data *pm_msg, u8 nl_client); 92 - 93 - /** 94 - * iwpm_add_mapping - Send a netlink add mapping request to 95 - * the userspace port mapper 96 - * @pm_msg: Contains the local ip/tcp address info to send 97 - * @nl_client: The index of the netlink client 98 - * 99 - * If the request is successful, the pm_msg stores 100 - * the port mapper response (mapped address info) 101 - */ 102 68 int iwpm_add_mapping(struct iwpm_sa_data *pm_msg, u8 nl_client); 103 - 104 - /** 105 - * iwpm_add_and_query_mapping - Send a netlink add and query mapping request 106 - * to the userspace port mapper 107 - * @pm_msg: Contains the local and remote ip/tcp address info to send 108 - * @nl_client: The index of the netlink client 109 - * 110 - * If the request is successful, the pm_msg stores the 111 - * port mapper response (mapped local and remote address info) 112 - */ 113 69 int iwpm_add_and_query_mapping(struct iwpm_sa_data *pm_msg, u8 nl_client); 114 - 115 - /** 116 - * iwpm_remove_mapping - Send a netlink remove mapping request 117 - * to the userspace port mapper 118 - * 119 - * @local_addr: Local ip/tcp address to remove 120 - * @nl_client: The index of the netlink client 121 - */ 122 70 int iwpm_remove_mapping(struct sockaddr_storage *local_addr, u8 nl_client); 123 - 124 - /** 125 - * iwpm_register_pid_cb - Process the port mapper response to 126 - * iwpm_register_pid query 127 - * @skb: 128 - * @cb: Contains the received message (payload and netlink header) 129 - * 130 - * If successful, the function receives the userspace port mapper pid 131 - * which is used in future communication with the port mapper 132 - */ 133 71 int iwpm_register_pid_cb(struct sk_buff *, struct netlink_callback *); 134 - 135 - /** 136 - * iwpm_add_mapping_cb - Process the port mapper response to 137 - * iwpm_add_mapping request 138 - * @skb: 139 - * @cb: Contains the received message (payload and netlink header) 140 - */ 141 72 int iwpm_add_mapping_cb(struct sk_buff *, struct netlink_callback *); 142 - 143 - /** 144 - * iwpm_add_and_query_mapping_cb - Process the port mapper response to 145 - * iwpm_add_and_query_mapping request 146 - * @skb: 147 - * @cb: Contains the received message (payload and netlink header) 148 - */ 149 73 int iwpm_add_and_query_mapping_cb(struct sk_buff *, struct netlink_callback *); 150 - 151 - /** 152 - * iwpm_remote_info_cb - Process remote connecting peer address info, which 153 - * the port mapper has received from the connecting peer 154 - * 155 - * @cb: Contains the received message (payload and netlink header) 156 - * 157 - * Stores the IPv4/IPv6 address info in a hash table 158 - */ 159 74 int iwpm_remote_info_cb(struct sk_buff *, struct netlink_callback *); 160 - 161 - /** 162 - * iwpm_mapping_error_cb - Process port mapper notification for error 163 - * 164 - * @skb: 165 - * @cb: Contains the received message (payload and netlink header) 166 - */ 167 75 int iwpm_mapping_error_cb(struct sk_buff *, struct netlink_callback *); 168 - 169 - /** 170 - * iwpm_mapping_info_cb - Process a notification that the userspace 171 - * port mapper daemon is started 172 - * @skb: 173 - * @cb: Contains the received message (payload and netlink header) 174 - * 175 - * Using the received port mapper pid, send all the local mapping 176 - * info records to the userspace port mapper 177 - */ 178 76 int iwpm_mapping_info_cb(struct sk_buff *, struct netlink_callback *); 179 - 180 - /** 181 - * iwpm_ack_mapping_info_cb - Process the port mapper ack for 182 - * the provided local mapping info records 183 - * @skb: 184 - * @cb: Contains the received message (payload and netlink header) 185 - */ 186 77 int iwpm_ack_mapping_info_cb(struct sk_buff *, struct netlink_callback *); 187 - 188 - /** 189 - * iwpm_get_remote_info - Get the remote connecting peer address info 190 - * 191 - * @mapped_loc_addr: Mapped local address of the listening peer 192 - * @mapped_rem_addr: Mapped remote address of the connecting peer 193 - * @remote_addr: To store the remote address of the connecting peer 194 - * @nl_client: The index of the netlink client 195 - * 196 - * The remote address info is retrieved and provided to the client in 197 - * the remote_addr. After that it is removed from the hash table 198 - */ 199 78 int iwpm_get_remote_info(struct sockaddr_storage *mapped_loc_addr, 200 79 struct sockaddr_storage *mapped_rem_addr, 201 80 struct sockaddr_storage *remote_addr, u8 nl_client); 202 - 203 - /** 204 - * iwpm_create_mapinfo - Store local and mapped IPv4/IPv6 address 205 - * info in a hash table 206 - * @local_addr: Local ip/tcp address 207 - * @mapped_addr: Mapped local ip/tcp address 208 - * @nl_client: The index of the netlink client 209 - * @map_flags: IWPM mapping flags 210 - */ 211 81 int iwpm_create_mapinfo(struct sockaddr_storage *local_addr, 212 82 struct sockaddr_storage *mapped_addr, u8 nl_client, 213 83 u32 map_flags); 214 - 215 - /** 216 - * iwpm_remove_mapinfo - Remove local and mapped IPv4/IPv6 address 217 - * info from the hash table 218 - * @local_addr: Local ip/tcp address 219 - * @mapped_addr: Mapped local ip/tcp address 220 - * 221 - * Returns err code if mapping info is not found in the hash table, 222 - * otherwise returns 0 223 - */ 224 84 int iwpm_remove_mapinfo(struct sockaddr_storage *local_addr, 225 85 struct sockaddr_storage *mapped_addr); 226 86 227 - /** 228 - * iwpm_hello_cb - Process a hello message from iwpmd 229 - * 230 - * @skb: 231 - * @cb: Contains the received message (payload and netlink header) 232 - * 233 - * Using the received port mapper pid, send the kernel's abi_version 234 - * after adjusting it to support the iwpmd version. 235 - */ 236 87 int iwpm_hello_cb(struct sk_buff *skb, struct netlink_callback *cb); 237 88 #endif /* _IW_PORTMAP_H */