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

docs: networking: convert rxrpc.txt to ReST

- add SPDX header;
- adjust title markup;
- use autonumbered list markups;
- mark code blocks and literals as such;
- mark tables as such;
- adjust identation, whitespaces and blank lines where needed;
- add to networking/index.rst.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Mauro Carvalho Chehab and committed by
David S. Miller
9f72374c 98661e0c

+167 -152
+1 -1
Documentation/filesystems/afs.rst
··· 70 70 The first module is the AF_RXRPC network protocol driver. This provides the 71 71 RxRPC remote operation protocol and may also be accessed from userspace. See: 72 72 73 - Documentation/networking/rxrpc.txt 73 + Documentation/networking/rxrpc.rst 74 74 75 75 The second module is the kerberos RxRPC security driver, and the third module 76 76 is the actual filesystem driver for the AFS filesystem.
+1
Documentation/networking/index.rst
··· 99 99 ray_cs 100 100 rds 101 101 regulatory 102 + rxrpc 102 103 103 104 .. only:: subproject and html 104 105
+160 -146
Documentation/networking/rxrpc.txt Documentation/networking/rxrpc.rst
··· 1 - ====================== 2 - RxRPC NETWORK PROTOCOL 3 - ====================== 1 + .. SPDX-License-Identifier: GPL-2.0 2 + 3 + ====================== 4 + RxRPC Network Protocol 5 + ====================== 4 6 5 7 The RxRPC protocol driver provides a reliable two-phase transport on top of UDP 6 8 that can be used to perform RxRPC remote operations. This is done over sockets ··· 11 9 12 10 Contents of this document: 13 11 14 - (*) Overview. 12 + (#) Overview. 15 13 16 - (*) RxRPC protocol summary. 14 + (#) RxRPC protocol summary. 17 15 18 - (*) AF_RXRPC driver model. 16 + (#) AF_RXRPC driver model. 19 17 20 - (*) Control messages. 18 + (#) Control messages. 21 19 22 - (*) Socket options. 20 + (#) Socket options. 23 21 24 - (*) Security. 22 + (#) Security. 25 23 26 - (*) Example client usage. 24 + (#) Example client usage. 27 25 28 - (*) Example server usage. 26 + (#) Example server usage. 29 27 30 - (*) AF_RXRPC kernel interface. 28 + (#) AF_RXRPC kernel interface. 31 29 32 - (*) Configurable parameters. 30 + (#) Configurable parameters. 33 31 34 32 35 - ======== 36 - OVERVIEW 33 + Overview 37 34 ======== 38 35 39 36 RxRPC is a two-layer protocol. There is a session layer which provides 40 37 reliable virtual connections using UDP over IPv4 (or IPv6) as the transport 41 38 layer, but implements a real network protocol; and there's the presentation 42 39 layer which renders structured data to binary blobs and back again using XDR 43 - (as does SunRPC): 40 + (as does SunRPC):: 44 41 45 42 +-------------+ 46 43 | Application | ··· 86 85 that has both kernel (filesystem) and userspace (utility) components. 87 86 88 87 89 - ====================== 90 - RXRPC PROTOCOL SUMMARY 88 + RxRPC Protocol Summary 91 89 ====================== 92 90 93 91 An overview of the RxRPC protocol: 94 92 95 - (*) RxRPC sits on top of another networking protocol (UDP is the only option 93 + (#) RxRPC sits on top of another networking protocol (UDP is the only option 96 94 currently), and uses this to provide network transport. UDP ports, for 97 95 example, provide transport endpoints. 98 96 99 - (*) RxRPC supports multiple virtual "connections" from any given transport 97 + (#) RxRPC supports multiple virtual "connections" from any given transport 100 98 endpoint, thus allowing the endpoints to be shared, even to the same 101 99 remote endpoint. 102 100 103 - (*) Each connection goes to a particular "service". A connection may not go 101 + (#) Each connection goes to a particular "service". A connection may not go 104 102 to multiple services. A service may be considered the RxRPC equivalent of 105 103 a port number. AF_RXRPC permits multiple services to share an endpoint. 106 104 107 - (*) Client-originating packets are marked, thus a transport endpoint can be 105 + (#) Client-originating packets are marked, thus a transport endpoint can be 108 106 shared between client and server connections (connections have a 109 107 direction). 110 108 111 - (*) Up to a billion connections may be supported concurrently between one 109 + (#) Up to a billion connections may be supported concurrently between one 112 110 local transport endpoint and one service on one remote endpoint. An RxRPC 113 - connection is described by seven numbers: 111 + connection is described by seven numbers:: 114 112 115 113 Local address } 116 114 Local port } Transport (UDP) address ··· 119 119 Connection ID 120 120 Service ID 121 121 122 - (*) Each RxRPC operation is a "call". A connection may make up to four 122 + (#) Each RxRPC operation is a "call". A connection may make up to four 123 123 billion calls, but only up to four calls may be in progress on a 124 124 connection at any one time. 125 125 126 - (*) Calls are two-phase and asymmetric: the client sends its request data, 126 + (#) Calls are two-phase and asymmetric: the client sends its request data, 127 127 which the service receives; then the service transmits the reply data 128 128 which the client receives. 129 129 130 - (*) The data blobs are of indefinite size, the end of a phase is marked with a 130 + (#) The data blobs are of indefinite size, the end of a phase is marked with a 131 131 flag in the packet. The number of packets of data making up one blob may 132 132 not exceed 4 billion, however, as this would cause the sequence number to 133 133 wrap. 134 134 135 - (*) The first four bytes of the request data are the service operation ID. 135 + (#) The first four bytes of the request data are the service operation ID. 136 136 137 - (*) Security is negotiated on a per-connection basis. The connection is 137 + (#) Security is negotiated on a per-connection basis. The connection is 138 138 initiated by the first data packet on it arriving. If security is 139 139 requested, the server then issues a "challenge" and then the client 140 140 replies with a "response". If the response is successful, the security is ··· 143 143 connection lapse before the client, the security will be renegotiated if 144 144 the client uses the connection again. 145 145 146 - (*) Calls use ACK packets to handle reliability. Data packets are also 146 + (#) Calls use ACK packets to handle reliability. Data packets are also 147 147 explicitly sequenced per call. 148 148 149 - (*) There are two types of positive acknowledgment: hard-ACKs and soft-ACKs. 149 + (#) There are two types of positive acknowledgment: hard-ACKs and soft-ACKs. 150 150 A hard-ACK indicates to the far side that all the data received to a point 151 151 has been received and processed; a soft-ACK indicates that the data has 152 152 been received but may yet be discarded and re-requested. The sender may 153 153 not discard any transmittable packets until they've been hard-ACK'd. 154 154 155 - (*) Reception of a reply data packet implicitly hard-ACK's all the data 155 + (#) Reception of a reply data packet implicitly hard-ACK's all the data 156 156 packets that make up the request. 157 157 158 - (*) An call is complete when the request has been sent, the reply has been 158 + (#) An call is complete when the request has been sent, the reply has been 159 159 received and the final hard-ACK on the last packet of the reply has 160 160 reached the server. 161 161 162 - (*) An call may be aborted by either end at any time up to its completion. 162 + (#) An call may be aborted by either end at any time up to its completion. 163 163 164 164 165 - ===================== 166 - AF_RXRPC DRIVER MODEL 165 + AF_RXRPC Driver Model 167 166 ===================== 168 167 169 168 About the AF_RXRPC driver: 170 169 171 - (*) The AF_RXRPC protocol transparently uses internal sockets of the transport 170 + (#) The AF_RXRPC protocol transparently uses internal sockets of the transport 172 171 protocol to represent transport endpoints. 173 172 174 - (*) AF_RXRPC sockets map onto RxRPC connection bundles. Actual RxRPC 173 + (#) AF_RXRPC sockets map onto RxRPC connection bundles. Actual RxRPC 175 174 connections are handled transparently. One client socket may be used to 176 175 make multiple simultaneous calls to the same service. One server socket 177 176 may handle calls from many clients. 178 177 179 - (*) Additional parallel client connections will be initiated to support extra 178 + (#) Additional parallel client connections will be initiated to support extra 180 179 concurrent calls, up to a tunable limit. 181 180 182 - (*) Each connection is retained for a certain amount of time [tunable] after 181 + (#) Each connection is retained for a certain amount of time [tunable] after 183 182 the last call currently using it has completed in case a new call is made 184 183 that could reuse it. 185 184 186 - (*) Each internal UDP socket is retained [tunable] for a certain amount of 185 + (#) Each internal UDP socket is retained [tunable] for a certain amount of 187 186 time [tunable] after the last connection using it discarded, in case a new 188 187 connection is made that could use it. 189 188 190 - (*) A client-side connection is only shared between calls if they have have 189 + (#) A client-side connection is only shared between calls if they have have 191 190 the same key struct describing their security (and assuming the calls 192 191 would otherwise share the connection). Non-secured calls would also be 193 192 able to share connections with each other. 194 193 195 - (*) A server-side connection is shared if the client says it is. 194 + (#) A server-side connection is shared if the client says it is. 196 195 197 - (*) ACK'ing is handled by the protocol driver automatically, including ping 196 + (#) ACK'ing is handled by the protocol driver automatically, including ping 198 197 replying. 199 198 200 - (*) SO_KEEPALIVE automatically pings the other side to keep the connection 199 + (#) SO_KEEPALIVE automatically pings the other side to keep the connection 201 200 alive [TODO]. 202 201 203 - (*) If an ICMP error is received, all calls affected by that error will be 202 + (#) If an ICMP error is received, all calls affected by that error will be 204 203 aborted with an appropriate network error passed through recvmsg(). 205 204 206 205 207 206 Interaction with the user of the RxRPC socket: 208 207 209 - (*) A socket is made into a server socket by binding an address with a 208 + (#) A socket is made into a server socket by binding an address with a 210 209 non-zero service ID. 211 210 212 - (*) In the client, sending a request is achieved with one or more sendmsgs, 211 + (#) In the client, sending a request is achieved with one or more sendmsgs, 213 212 followed by the reply being received with one or more recvmsgs. 214 213 215 - (*) The first sendmsg for a request to be sent from a client contains a tag to 214 + (#) The first sendmsg for a request to be sent from a client contains a tag to 216 215 be used in all other sendmsgs or recvmsgs associated with that call. The 217 216 tag is carried in the control data. 218 217 219 - (*) connect() is used to supply a default destination address for a client 218 + (#) connect() is used to supply a default destination address for a client 220 219 socket. This may be overridden by supplying an alternate address to the 221 220 first sendmsg() of a call (struct msghdr::msg_name). 222 221 223 - (*) If connect() is called on an unbound client, a random local port will 222 + (#) If connect() is called on an unbound client, a random local port will 224 223 bound before the operation takes place. 225 224 226 - (*) A server socket may also be used to make client calls. To do this, the 225 + (#) A server socket may also be used to make client calls. To do this, the 227 226 first sendmsg() of the call must specify the target address. The server's 228 227 transport endpoint is used to send the packets. 229 228 230 - (*) Once the application has received the last message associated with a call, 229 + (#) Once the application has received the last message associated with a call, 231 230 the tag is guaranteed not to be seen again, and so it can be used to pin 232 231 client resources. A new call can then be initiated with the same tag 233 232 without fear of interference. 234 233 235 - (*) In the server, a request is received with one or more recvmsgs, then the 234 + (#) In the server, a request is received with one or more recvmsgs, then the 236 235 the reply is transmitted with one or more sendmsgs, and then the final ACK 237 236 is received with a last recvmsg. 238 237 239 - (*) When sending data for a call, sendmsg is given MSG_MORE if there's more 238 + (#) When sending data for a call, sendmsg is given MSG_MORE if there's more 240 239 data to come on that call. 241 240 242 - (*) When receiving data for a call, recvmsg flags MSG_MORE if there's more 241 + (#) When receiving data for a call, recvmsg flags MSG_MORE if there's more 243 242 data to come for that call. 244 243 245 - (*) When receiving data or messages for a call, MSG_EOR is flagged by recvmsg 244 + (#) When receiving data or messages for a call, MSG_EOR is flagged by recvmsg 246 245 to indicate the terminal message for that call. 247 246 248 - (*) A call may be aborted by adding an abort control message to the control 247 + (#) A call may be aborted by adding an abort control message to the control 249 248 data. Issuing an abort terminates the kernel's use of that call's tag. 250 249 Any messages waiting in the receive queue for that call will be discarded. 251 250 252 - (*) Aborts, busy notifications and challenge packets are delivered by recvmsg, 251 + (#) Aborts, busy notifications and challenge packets are delivered by recvmsg, 253 252 and control data messages will be set to indicate the context. Receiving 254 253 an abort or a busy message terminates the kernel's use of that call's tag. 255 254 256 - (*) The control data part of the msghdr struct is used for a number of things: 255 + (#) The control data part of the msghdr struct is used for a number of things: 257 256 258 - (*) The tag of the intended or affected call. 257 + (#) The tag of the intended or affected call. 259 258 260 - (*) Sending or receiving errors, aborts and busy notifications. 259 + (#) Sending or receiving errors, aborts and busy notifications. 261 260 262 - (*) Notifications of incoming calls. 261 + (#) Notifications of incoming calls. 263 262 264 - (*) Sending debug requests and receiving debug replies [TODO]. 263 + (#) Sending debug requests and receiving debug replies [TODO]. 265 264 266 - (*) When the kernel has received and set up an incoming call, it sends a 265 + (#) When the kernel has received and set up an incoming call, it sends a 267 266 message to server application to let it know there's a new call awaiting 268 267 its acceptance [recvmsg reports a special control message]. The server 269 268 application then uses sendmsg to assign a tag to the new call. Once that 270 269 is done, the first part of the request data will be delivered by recvmsg. 271 270 272 - (*) The server application has to provide the server socket with a keyring of 271 + (#) The server application has to provide the server socket with a keyring of 273 272 secret keys corresponding to the security types it permits. When a secure 274 273 connection is being set up, the kernel looks up the appropriate secret key 275 274 in the keyring and then sends a challenge packet to the client and 276 275 receives a response packet. The kernel then checks the authorisation of 277 276 the packet and either aborts the connection or sets up the security. 278 277 279 - (*) The name of the key a client will use to secure its communications is 278 + (#) The name of the key a client will use to secure its communications is 280 279 nominated by a socket option. 281 280 282 281 283 282 Notes on sendmsg: 284 283 285 - (*) MSG_WAITALL can be set to tell sendmsg to ignore signals if the peer is 284 + (#) MSG_WAITALL can be set to tell sendmsg to ignore signals if the peer is 286 285 making progress at accepting packets within a reasonable time such that we 287 286 manage to queue up all the data for transmission. This requires the 288 287 client to accept at least one packet per 2*RTT time period. ··· 293 294 294 295 Notes on recvmsg: 295 296 296 - (*) If there's a sequence of data messages belonging to a particular call on 297 + (#) If there's a sequence of data messages belonging to a particular call on 297 298 the receive queue, then recvmsg will keep working through them until: 298 299 299 300 (a) it meets the end of that call's received data, ··· 319 320 flagged. 320 321 321 322 322 - ================ 323 - CONTROL MESSAGES 323 + Control Messages 324 324 ================ 325 325 326 326 AF_RXRPC makes use of control messages in sendmsg() and recvmsg() to multiplex 327 327 calls, to invoke certain actions and to report certain conditions. These are: 328 328 329 + ======================= === =========== =============================== 329 330 MESSAGE ID SRT DATA MEANING 330 331 ======================= === =========== =============================== 331 332 RXRPC_USER_CALL_ID sr- User ID App's call specifier ··· 339 340 RXRPC_EXCLUSIVE_CALL s-- n/a Make an exclusive client call 340 341 RXRPC_UPGRADE_SERVICE s-- n/a Client call can be upgraded 341 342 RXRPC_TX_LENGTH s-- data len Total length of Tx data 343 + ======================= === =========== =============================== 342 344 343 345 (SRT = usable in Sendmsg / delivered by Recvmsg / Terminal message) 344 346 345 - (*) RXRPC_USER_CALL_ID 347 + (#) RXRPC_USER_CALL_ID 346 348 347 349 This is used to indicate the application's call ID. It's an unsigned long 348 350 that the app specifies in the client by attaching it to the first data ··· 351 351 message. recvmsg() passes it in conjunction with all messages except 352 352 those of the RXRPC_NEW_CALL message. 353 353 354 - (*) RXRPC_ABORT 354 + (#) RXRPC_ABORT 355 355 356 356 This is can be used by an application to abort a call by passing it to 357 357 sendmsg, or it can be delivered by recvmsg to indicate a remote abort was ··· 359 359 specify the call affected. If an abort is being sent, then error EBADSLT 360 360 will be returned if there is no call with that user ID. 361 361 362 - (*) RXRPC_ACK 362 + (#) RXRPC_ACK 363 363 364 364 This is delivered to a server application to indicate that the final ACK 365 365 of a call was received from the client. It will be associated with an 366 366 RXRPC_USER_CALL_ID to indicate the call that's now complete. 367 367 368 - (*) RXRPC_NET_ERROR 368 + (#) RXRPC_NET_ERROR 369 369 370 370 This is delivered to an application to indicate that an ICMP error message 371 371 was encountered in the process of trying to talk to the peer. An ··· 373 373 indicating the problem, and an RXRPC_USER_CALL_ID will indicate the call 374 374 affected. 375 375 376 - (*) RXRPC_BUSY 376 + (#) RXRPC_BUSY 377 377 378 378 This is delivered to a client application to indicate that a call was 379 379 rejected by the server due to the server being busy. It will be 380 380 associated with an RXRPC_USER_CALL_ID to indicate the rejected call. 381 381 382 - (*) RXRPC_LOCAL_ERROR 382 + (#) RXRPC_LOCAL_ERROR 383 383 384 384 This is delivered to an application to indicate that a local error was 385 385 encountered and that a call has been aborted because of it. An ··· 387 387 indicating the problem, and an RXRPC_USER_CALL_ID will indicate the call 388 388 affected. 389 389 390 - (*) RXRPC_NEW_CALL 390 + (#) RXRPC_NEW_CALL 391 391 392 392 This is delivered to indicate to a server application that a new call has 393 393 arrived and is awaiting acceptance. No user ID is associated with this, 394 394 as a user ID must subsequently be assigned by doing an RXRPC_ACCEPT. 395 395 396 - (*) RXRPC_ACCEPT 396 + (#) RXRPC_ACCEPT 397 397 398 398 This is used by a server application to attempt to accept a call and 399 399 assign it a user ID. It should be associated with an RXRPC_USER_CALL_ID ··· 402 402 return error ENODATA. If the user ID is already in use by another call, 403 403 then error EBADSLT will be returned. 404 404 405 - (*) RXRPC_EXCLUSIVE_CALL 405 + (#) RXRPC_EXCLUSIVE_CALL 406 406 407 407 This is used to indicate that a client call should be made on a one-off 408 408 connection. The connection is discarded once the call has terminated. 409 409 410 - (*) RXRPC_UPGRADE_SERVICE 410 + (#) RXRPC_UPGRADE_SERVICE 411 411 412 412 This is used to make a client call to probe if the specified service ID 413 413 may be upgraded by the server. The caller must check msg_name returned to ··· 419 419 future communication to that server and RXRPC_UPGRADE_SERVICE should no 420 420 longer be set. 421 421 422 - (*) RXRPC_TX_LENGTH 422 + (#) RXRPC_TX_LENGTH 423 423 424 424 This is used to inform the kernel of the total amount of data that is 425 425 going to be transmitted by a call (whether in a client request or a ··· 443 443 444 444 AF_RXRPC sockets support a few socket options at the SOL_RXRPC level: 445 445 446 - (*) RXRPC_SECURITY_KEY 446 + (#) RXRPC_SECURITY_KEY 447 447 448 448 This is used to specify the description of the key to be used. The key is 449 449 extracted from the calling process's keyrings with request_key() and ··· 452 452 The optval pointer points to the description string, and optlen indicates 453 453 how long the string is, without the NUL terminator. 454 454 455 - (*) RXRPC_SECURITY_KEYRING 455 + (#) RXRPC_SECURITY_KEYRING 456 456 457 457 Similar to above but specifies a keyring of server secret keys to use (key 458 458 type "keyring"). See the "Security" section. 459 459 460 - (*) RXRPC_EXCLUSIVE_CONNECTION 460 + (#) RXRPC_EXCLUSIVE_CONNECTION 461 461 462 462 This is used to request that new connections should be used for each call 463 463 made subsequently on this socket. optval should be NULL and optlen 0. 464 464 465 - (*) RXRPC_MIN_SECURITY_LEVEL 465 + (#) RXRPC_MIN_SECURITY_LEVEL 466 466 467 467 This is used to specify the minimum security level required for calls on 468 468 this socket. optval must point to an int containing one of the following ··· 482 482 Encrypted checksum plus entire packet padded and encrypted, including 483 483 actual packet length. 484 484 485 - (*) RXRPC_UPGRADEABLE_SERVICE 485 + (#) RXRPC_UPGRADEABLE_SERVICE 486 486 487 487 This is used to indicate that a service socket with two bindings may 488 488 upgrade one bound service to the other if requested by the client. optval 489 489 must point to an array of two unsigned short ints. The first is the 490 490 service ID to upgrade from and the second the service ID to upgrade to. 491 491 492 - (*) RXRPC_SUPPORTED_CMSG 492 + (#) RXRPC_SUPPORTED_CMSG 493 493 494 494 This is a read-only option that writes an int into the buffer indicating 495 495 the highest control message type supported. ··· 509 509 http://people.redhat.com/~dhowells/rxrpc/klog.c 510 510 511 511 The payload provided to add_key() on the client should be of the following 512 - form: 512 + form:: 513 513 514 514 struct rxrpc_key_sec2_v1 { 515 515 uint16_t security_index; /* 2 */ ··· 546 546 547 547 A client would issue an operation by: 548 548 549 - (1) An RxRPC socket is set up by: 549 + (1) An RxRPC socket is set up by:: 550 550 551 551 client = socket(AF_RXRPC, SOCK_DGRAM, PF_INET); 552 552 553 553 Where the third parameter indicates the protocol family of the transport 554 554 socket used - usually IPv4 but it can also be IPv6 [TODO]. 555 555 556 - (2) A local address can optionally be bound: 556 + (2) A local address can optionally be bound:: 557 557 558 558 struct sockaddr_rxrpc srx = { 559 559 .srx_family = AF_RXRPC, ··· 570 570 several unrelated RxRPC sockets. Security is handled on a basis of 571 571 per-RxRPC virtual connection. 572 572 573 - (3) The security is set: 573 + (3) The security is set:: 574 574 575 575 const char *key = "AFS:cambridge.redhat.com"; 576 576 setsockopt(client, SOL_RXRPC, RXRPC_SECURITY_KEY, key, strlen(key)); 577 577 578 578 This issues a request_key() to get the key representing the security 579 - context. The minimum security level can be set: 579 + context. The minimum security level can be set:: 580 580 581 581 unsigned int sec = RXRPC_SECURITY_ENCRYPTED; 582 582 setsockopt(client, SOL_RXRPC, RXRPC_MIN_SECURITY_LEVEL, 583 583 &sec, sizeof(sec)); 584 584 585 585 (4) The server to be contacted can then be specified (alternatively this can 586 - be done through sendmsg): 586 + be done through sendmsg):: 587 587 588 588 struct sockaddr_rxrpc srx = { 589 589 .srx_family = AF_RXRPC, ··· 598 598 (5) The request data should then be posted to the server socket using a series 599 599 of sendmsg() calls, each with the following control message attached: 600 600 601 - RXRPC_USER_CALL_ID - specifies the user ID for this call 601 + ================== =================================== 602 + RXRPC_USER_CALL_ID specifies the user ID for this call 603 + ================== =================================== 602 604 603 605 MSG_MORE should be set in msghdr::msg_flags on all but the last part of 604 606 the request. Multiple requests may be made simultaneously. ··· 637 635 probe is concluded). 638 636 639 637 640 - ==================== 641 - EXAMPLE SERVER USAGE 638 + Example Server Usage 642 639 ==================== 643 640 644 641 A server would be set up to accept operations in the following manner: 645 642 646 - (1) An RxRPC socket is created by: 643 + (1) An RxRPC socket is created by:: 647 644 648 645 server = socket(AF_RXRPC, SOCK_DGRAM, PF_INET); 649 646 ··· 650 649 socket used - usually IPv4. 651 650 652 651 (2) Security is set up if desired by giving the socket a keyring with server 653 - secret keys in it: 652 + secret keys in it:: 654 653 655 654 keyring = add_key("keyring", "AFSkeys", NULL, 0, 656 655 KEY_SPEC_PROCESS_KEYRING); ··· 664 663 The keyring can be manipulated after it has been given to the socket. This 665 664 permits the server to add more keys, replace keys, etc. while it is live. 666 665 667 - (3) A local address must then be bound: 666 + (3) A local address must then be bound:: 668 667 669 668 struct sockaddr_rxrpc srx = { 670 669 .srx_family = AF_RXRPC, ··· 681 680 should be called twice. 682 681 683 682 (4) If service upgrading is required, first two service IDs must have been 684 - bound and then the following option must be set: 683 + bound and then the following option must be set:: 685 684 686 685 unsigned short service_ids[2] = { from_ID, to_ID }; 687 686 setsockopt(server, SOL_RXRPC, RXRPC_UPGRADEABLE_SERVICE, ··· 691 690 to_ID if they request it. This will be reflected in msg_name obtained 692 691 through recvmsg() when the request data is delivered to userspace. 693 692 694 - (5) The server is then set to listen out for incoming calls: 693 + (5) The server is then set to listen out for incoming calls:: 695 694 696 695 listen(server, 100); 697 696 698 697 (6) The kernel notifies the server of pending incoming connections by sending 699 698 it a message for each. This is received with recvmsg() on the server 700 699 socket. It has no data, and has a single dataless control message 701 - attached: 700 + attached:: 702 701 703 702 RXRPC_NEW_CALL 704 703 ··· 710 709 (7) The server then accepts the new call by issuing a sendmsg() with two 711 710 pieces of control data and no actual data: 712 711 713 - RXRPC_ACCEPT - indicate connection acceptance 714 - RXRPC_USER_CALL_ID - specify user ID for this call 712 + ================== ============================== 713 + RXRPC_ACCEPT indicate connection acceptance 714 + RXRPC_USER_CALL_ID specify user ID for this call 715 + ================== ============================== 715 716 716 717 (8) The first request data packet will then be posted to the server socket for 717 718 recvmsg() to pick up. At that point, the RxRPC address for the call can ··· 725 722 726 723 All data will be delivered with the following control message attached: 727 724 728 - RXRPC_USER_CALL_ID - specifies the user ID for this call 725 + 726 + ================== =================================== 727 + RXRPC_USER_CALL_ID specifies the user ID for this call 728 + ================== =================================== 729 729 730 730 (9) The reply data should then be posted to the server socket using a series 731 731 of sendmsg() calls, each with the following control messages attached: 732 732 733 - RXRPC_USER_CALL_ID - specifies the user ID for this call 733 + ================== =================================== 734 + RXRPC_USER_CALL_ID specifies the user ID for this call 735 + ================== =================================== 734 736 735 737 MSG_MORE should be set in msghdr::msg_flags on all but the last message 736 738 for a particular call. ··· 744 736 when it is received. It will take the form of a dataless message with two 745 737 control messages attached: 746 738 747 - RXRPC_USER_CALL_ID - specifies the user ID for this call 748 - RXRPC_ACK - indicates final ACK (no data) 739 + ================== =================================== 740 + RXRPC_USER_CALL_ID specifies the user ID for this call 741 + RXRPC_ACK indicates final ACK (no data) 742 + ================== =================================== 749 743 750 744 MSG_EOR will be flagged to indicate that this is the final message for 751 745 this call. ··· 756 746 aborted by calling sendmsg() with a dataless message with the following 757 747 control messages attached: 758 748 759 - RXRPC_USER_CALL_ID - specifies the user ID for this call 760 - RXRPC_ABORT - indicates abort code (4 byte data) 749 + ================== =================================== 750 + RXRPC_USER_CALL_ID specifies the user ID for this call 751 + RXRPC_ABORT indicates abort code (4 byte data) 752 + ================== =================================== 761 753 762 754 Any packets waiting in the socket's receive queue will be discarded if 763 755 this is issued. ··· 769 757 determine the call affected. 770 758 771 759 772 - ========================= 773 - AF_RXRPC KERNEL INTERFACE 760 + AF_RXRPC Kernel Interface 774 761 ========================= 775 762 776 763 The AF_RXRPC module also provides an interface for use by in-kernel utilities ··· 797 786 798 787 The kernel interface functions are as follows: 799 788 800 - (*) Begin a new client call. 789 + (#) Begin a new client call:: 801 790 802 791 struct rxrpc_call * 803 792 rxrpc_kernel_begin_call(struct socket *sock, ··· 848 837 returned. The caller now holds a reference on this and it must be 849 838 properly ended. 850 839 851 - (*) End a client call. 840 + (#) End a client call:: 852 841 853 842 void rxrpc_kernel_end_call(struct socket *sock, 854 843 struct rxrpc_call *call); ··· 857 846 from AF_RXRPC's knowledge and will not be seen again in association with 858 847 the specified call. 859 848 860 - (*) Send data through a call. 849 + (#) Send data through a call:: 861 850 862 851 typedef void (*rxrpc_notify_end_tx_t)(struct sock *sk, 863 852 unsigned long user_call_ID, ··· 883 872 called with the call-state spinlock held to prevent any reply or final ACK 884 873 from being delivered first. 885 874 886 - (*) Receive data from a call. 875 + (#) Receive data from a call:: 887 876 888 877 int rxrpc_kernel_recv_data(struct socket *sock, 889 878 struct rxrpc_call *call, ··· 913 902 more data was available, EMSGSIZE is returned. 914 903 915 904 If a remote ABORT is detected, the abort code received will be stored in 916 - *_abort and ECONNABORTED will be returned. 905 + ``*_abort`` and ECONNABORTED will be returned. 917 906 918 907 The service ID that the call ended up with is returned into *_service. 919 908 This can be used to see if a call got a service upgrade. 920 909 921 - (*) Abort a call. 910 + (#) Abort a call?? 911 + 912 + :: 922 913 923 914 void rxrpc_kernel_abort_call(struct socket *sock, 924 915 struct rxrpc_call *call, ··· 929 916 This is used to abort a call if it's still in an abortable state. The 930 917 abort code specified will be placed in the ABORT message sent. 931 918 932 - (*) Intercept received RxRPC messages. 919 + (#) Intercept received RxRPC messages:: 933 920 934 921 typedef void (*rxrpc_interceptor_t)(struct sock *sk, 935 922 unsigned long user_call_ID, ··· 950 937 951 938 The skb->mark field indicates the type of message: 952 939 953 - MARK MEANING 940 + =============================== ======================================= 941 + Mark Meaning 954 942 =============================== ======================================= 955 943 RXRPC_SKB_MARK_DATA Data message 956 944 RXRPC_SKB_MARK_FINAL_ACK Final ACK received for an incoming call ··· 960 946 RXRPC_SKB_MARK_NET_ERROR Network error detected 961 947 RXRPC_SKB_MARK_LOCAL_ERROR Local error encountered 962 948 RXRPC_SKB_MARK_NEW_CALL New incoming call awaiting acceptance 949 + =============================== ======================================= 963 950 964 951 The remote abort message can be probed with rxrpc_kernel_get_abort_code(). 965 952 The two error messages can be probed with rxrpc_kernel_get_error_number(). ··· 976 961 is possible to get extra refs on all types of message for later freeing, 977 962 but this may pin the state of a call until the message is finally freed. 978 963 979 - (*) Accept an incoming call. 964 + (#) Accept an incoming call:: 980 965 981 966 struct rxrpc_call * 982 967 rxrpc_kernel_accept_call(struct socket *sock, ··· 990 975 returned. The caller now holds a reference on this and it must be 991 976 properly ended. 992 977 993 - (*) Reject an incoming call. 978 + (#) Reject an incoming call:: 994 979 995 980 int rxrpc_kernel_reject_call(struct socket *sock); 996 981 ··· 999 984 Other errors may be returned if the call had been aborted (-ECONNABORTED) 1000 985 or had timed out (-ETIME). 1001 986 1002 - (*) Allocate a null key for doing anonymous security. 987 + (#) Allocate a null key for doing anonymous security:: 1003 988 1004 989 struct key *rxrpc_get_null_key(const char *keyname); 1005 990 1006 991 This is used to allocate a null RxRPC key that can be used to indicate 1007 992 anonymous security for a particular domain. 1008 993 1009 - (*) Get the peer address of a call. 994 + (#) Get the peer address of a call:: 1010 995 1011 996 void rxrpc_kernel_get_peer(struct socket *sock, struct rxrpc_call *call, 1012 997 struct sockaddr_rxrpc *_srx); 1013 998 1014 999 This is used to find the remote peer address of a call. 1015 1000 1016 - (*) Set the total transmit data size on a call. 1001 + (#) Set the total transmit data size on a call:: 1017 1002 1018 1003 void rxrpc_kernel_set_tx_length(struct socket *sock, 1019 1004 struct rxrpc_call *call, ··· 1024 1009 size should be set when the call is begun. tx_total_len may not be less 1025 1010 than zero. 1026 1011 1027 - (*) Get call RTT. 1012 + (#) Get call RTT:: 1028 1013 1029 1014 u64 rxrpc_kernel_get_rtt(struct socket *sock, struct rxrpc_call *call); 1030 1015 1031 1016 Get the RTT time to the peer in use by a call. The value returned is in 1032 1017 nanoseconds. 1033 1018 1034 - (*) Check call still alive. 1019 + (#) Check call still alive:: 1035 1020 1036 1021 bool rxrpc_kernel_check_life(struct socket *sock, 1037 1022 struct rxrpc_call *call, ··· 1039 1024 void rxrpc_kernel_probe_life(struct socket *sock, 1040 1025 struct rxrpc_call *call); 1041 1026 1042 - The first function passes back in *_life a number that is updated when 1027 + The first function passes back in ``*_life`` a number that is updated when 1043 1028 ACKs are received from the peer (notably including PING RESPONSE ACKs 1044 1029 which we can elicit by sending PING ACKs to see if the call still exists 1045 1030 on the server). The caller should compare the numbers of two calls to see ··· 1055 1040 first function to change. Note that this must be called in TASK_RUNNING 1056 1041 state. 1057 1042 1058 - (*) Get reply timestamp. 1043 + (#) Get reply timestamp:: 1059 1044 1060 1045 bool rxrpc_kernel_get_reply_time(struct socket *sock, 1061 1046 struct rxrpc_call *call, ··· 1063 1048 1064 1049 This allows the timestamp on the first DATA packet of the reply of a 1065 1050 client call to be queried, provided that it is still in the Rx ring. If 1066 - successful, the timestamp will be stored into *_ts and true will be 1051 + successful, the timestamp will be stored into ``*_ts`` and true will be 1067 1052 returned; false will be returned otherwise. 1068 1053 1069 - (*) Get remote client epoch. 1054 + (#) Get remote client epoch:: 1070 1055 1071 1056 u32 rxrpc_kernel_get_epoch(struct socket *sock, 1072 1057 struct rxrpc_call *call) ··· 1080 1065 This value can be used to determine if the remote client has been 1081 1066 restarted as it shouldn't change otherwise. 1082 1067 1083 - (*) Set the maxmimum lifespan on a call. 1068 + (#) Set the maxmimum lifespan on a call:: 1084 1069 1085 1070 void rxrpc_kernel_set_max_life(struct socket *sock, 1086 1071 struct rxrpc_call *call, ··· 1091 1076 aborted and -ETIME or -ETIMEDOUT will be returned. 1092 1077 1093 1078 1094 - ======================= 1095 - CONFIGURABLE PARAMETERS 1079 + Configurable Parameters 1096 1080 ======================= 1097 1081 1098 1082 The RxRPC protocol driver has a number of configurable parameters that can be 1099 1083 adjusted through sysctls in /proc/net/rxrpc/: 1100 1084 1101 - (*) req_ack_delay 1085 + (#) req_ack_delay 1102 1086 1103 1087 The amount of time in milliseconds after receiving a packet with the 1104 1088 request-ack flag set before we honour the flag and actually send the ··· 1107 1093 reception window is full (to a maximum of 255 packets), so delaying the 1108 1094 ACK permits several packets to be ACK'd in one go. 1109 1095 1110 - (*) soft_ack_delay 1096 + (#) soft_ack_delay 1111 1097 1112 1098 The amount of time in milliseconds after receiving a new packet before we 1113 1099 generate a soft-ACK to tell the sender that it doesn't need to resend. 1114 1100 1115 - (*) idle_ack_delay 1101 + (#) idle_ack_delay 1116 1102 1117 1103 The amount of time in milliseconds after all the packets currently in the 1118 1104 received queue have been consumed before we generate a hard-ACK to tell 1119 1105 the sender it can free its buffers, assuming no other reason occurs that 1120 1106 we would send an ACK. 1121 1107 1122 - (*) resend_timeout 1108 + (#) resend_timeout 1123 1109 1124 1110 The amount of time in milliseconds after transmitting a packet before we 1125 1111 transmit it again, assuming no ACK is received from the receiver telling 1126 1112 us they got it. 1127 1113 1128 - (*) max_call_lifetime 1114 + (#) max_call_lifetime 1129 1115 1130 1116 The maximum amount of time in seconds that a call may be in progress 1131 1117 before we preemptively kill it. 1132 1118 1133 - (*) dead_call_expiry 1119 + (#) dead_call_expiry 1134 1120 1135 1121 The amount of time in seconds before we remove a dead call from the call 1136 1122 list. Dead calls are kept around for a little while for the purpose of 1137 1123 repeating ACK and ABORT packets. 1138 1124 1139 - (*) connection_expiry 1125 + (#) connection_expiry 1140 1126 1141 1127 The amount of time in seconds after a connection was last used before we 1142 1128 remove it from the connection list. While a connection is in existence, 1143 1129 it serves as a placeholder for negotiated security; when it is deleted, 1144 1130 the security must be renegotiated. 1145 1131 1146 - (*) transport_expiry 1132 + (#) transport_expiry 1147 1133 1148 1134 The amount of time in seconds after a transport was last used before we 1149 1135 remove it from the transport list. While a transport is in existence, it 1150 1136 serves to anchor the peer data and keeps the connection ID counter. 1151 1137 1152 - (*) rxrpc_rx_window_size 1138 + (#) rxrpc_rx_window_size 1153 1139 1154 1140 The size of the receive window in packets. This is the maximum number of 1155 1141 unconsumed received packets we're willing to hold in memory for any 1156 1142 particular call. 1157 1143 1158 - (*) rxrpc_rx_mtu 1144 + (#) rxrpc_rx_mtu 1159 1145 1160 1146 The maximum packet MTU size that we're willing to receive in bytes. This 1161 1147 indicates to the peer whether we're willing to accept jumbo packets. 1162 1148 1163 - (*) rxrpc_rx_jumbo_max 1149 + (#) rxrpc_rx_jumbo_max 1164 1150 1165 1151 The maximum number of packets that we're willing to accept in a jumbo 1166 1152 packet. Non-terminal packets in a jumbo packet must contain a four byte
+1 -1
MAINTAINERS
··· 14593 14593 L: linux-afs@lists.infradead.org 14594 14594 S: Supported 14595 14595 W: https://www.infradead.org/~dhowells/kafs/ 14596 - F: Documentation/networking/rxrpc.txt 14596 + F: Documentation/networking/rxrpc.rst 14597 14597 F: include/keys/rxrpc-type.h 14598 14598 F: include/net/af_rxrpc.h 14599 14599 F: include/trace/events/rxrpc.h
+3 -3
net/rxrpc/Kconfig
··· 18 18 This module at the moment only supports client operations and is 19 19 currently incomplete. 20 20 21 - See Documentation/networking/rxrpc.txt. 21 + See Documentation/networking/rxrpc.rst. 22 22 23 23 config AF_RXRPC_IPV6 24 24 bool "IPv6 support for RxRPC" ··· 41 41 help 42 42 Say Y here to make runtime controllable debugging messages appear. 43 43 44 - See Documentation/networking/rxrpc.txt. 44 + See Documentation/networking/rxrpc.rst. 45 45 46 46 47 47 config RXKAD ··· 56 56 Provide kerberos 4 and AFS kaserver security handling for AF_RXRPC 57 57 through the use of the key retention service. 58 58 59 - See Documentation/networking/rxrpc.txt. 59 + See Documentation/networking/rxrpc.rst.
+1 -1
net/rxrpc/sysctl.c
··· 21 21 /* 22 22 * RxRPC operating parameters. 23 23 * 24 - * See Documentation/networking/rxrpc.txt and the variable definitions for more 24 + * See Documentation/networking/rxrpc.rst and the variable definitions for more 25 25 * information on the individual parameters. 26 26 */ 27 27 static struct ctl_table rxrpc_sysctl_table[] = {