idnits 2.17.1 draft-cel-nfsv4-rpcrdma-reliable-reply-02.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords -- however, there's a paragraph with a matching beginning. Boilerplate error? (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). -- The document date (January 9, 2018) is 2296 days in the past. Is this intentional? Checking references for intended status: Experimental ---------------------------------------------------------------------------- -- Obsolete informational reference (is this intentional?): RFC 5661 (Obsoleted by RFC 8881) -- Obsolete informational reference (is this intentional?): RFC 5666 (Obsoleted by RFC 8166) Summary: 0 errors (**), 0 flaws (~~), 2 warnings (==), 3 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network File System Version 4 C. Lever 3 Internet-Draft Oracle 4 Intended status: Experimental January 9, 2018 5 Expires: July 13, 2018 7 Improving the Performance and Reliability of RPC Replies on RPC-over- 8 RDMA Transports 9 draft-cel-nfsv4-rpcrdma-reliable-reply-02 11 Abstract 13 RPC transports such as RPC-over-RDMA Version One require reply 14 buffers to be in place before an RPC Call is sent. However, Upper 15 Layer Protocols sometimes have difficulty estimating the expected 16 maximum size of RPC replies. This introduces the risk that an RPC 17 Reply message can overrun reply resources provided by the requester, 18 preventing delivery of the message, through no fault of the 19 requester. This document describes a mechanism that eliminates the 20 need for pre-allocation of reply resources for unpredictably large 21 replies. 23 Status of This Memo 25 This Internet-Draft is submitted in full conformance with the 26 provisions of BCP 78 and BCP 79. 28 Internet-Drafts are working documents of the Internet Engineering 29 Task Force (IETF). Note that other groups may also distribute 30 working documents as Internet-Drafts. The list of current Internet- 31 Drafts is at https://datatracker.ietf.org/drafts/current/. 33 Internet-Drafts are draft documents valid for a maximum of six months 34 and may be updated, replaced, or obsoleted by other documents at any 35 time. It is inappropriate to use Internet-Drafts as reference 36 material or to cite them other than as "work in progress." 38 This Internet-Draft will expire on July 13, 2018. 40 Copyright Notice 42 Copyright (c) 2018 IETF Trust and the persons identified as the 43 document authors. All rights reserved. 45 This document is subject to BCP 78 and the IETF Trust's Legal 46 Provisions Relating to IETF Documents 47 (https://trustee.ietf.org/license-info) in effect on the date of 48 publication of this document. Please review these documents 49 carefully, as they describe your rights and restrictions with respect 50 to this document. Code Components extracted from this document must 51 include Simplified BSD License text as described in Section 4.e of 52 the Trust Legal Provisions and are provided without warranty as 53 described in the Simplified BSD License. 55 Table of Contents 57 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 58 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 3 59 3. Problem Statement . . . . . . . . . . . . . . . . . . . . . . 3 60 3.1. Reply Chunk Overrun . . . . . . . . . . . . . . . . . . . 4 61 3.2. Reply Size Calculation . . . . . . . . . . . . . . . . . 4 62 3.3. Requester Registration Costs . . . . . . . . . . . . . . 5 63 3.4. Denial of Service . . . . . . . . . . . . . . . . . . . . 5 64 3.5. Estimating Transport Header Size . . . . . . . . . . . . 6 65 4. Responder-Provided Read Chunks . . . . . . . . . . . . . . . 6 66 4.1. Specification . . . . . . . . . . . . . . . . . . . . . . 7 67 5. Analysis . . . . . . . . . . . . . . . . . . . . . . . . . . 9 68 5.1. Benefits . . . . . . . . . . . . . . . . . . . . . . . . 9 69 5.2. Costs . . . . . . . . . . . . . . . . . . . . . . . . . . 10 70 5.3. Selecting a Reply Mechanism . . . . . . . . . . . . . . . 11 71 5.4. Implementation Complexity . . . . . . . . . . . . . . . . 12 72 5.5. Alternatives . . . . . . . . . . . . . . . . . . . . . . 13 73 6. Interoperation Considerations . . . . . . . . . . . . . . . . 14 74 7. Security Considerations . . . . . . . . . . . . . . . . . . . 14 75 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 76 9. References . . . . . . . . . . . . . . . . . . . . . . . . . 15 77 9.1. Normative References . . . . . . . . . . . . . . . . . . 15 78 9.2. Informative References . . . . . . . . . . . . . . . . . 15 79 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 16 80 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 16 82 1. Introduction 84 One way in which RPC-over-RDMA Version One improves transport 85 efficiency is by ensuring resources for RPC replies are available in 86 advance of each RPC transaction [RFC8166]. These resources are 87 typically provisioned before a requester sends each RPC Call message. 88 They are provided to the responder to use for transmiting the 89 associated RPC Reply message back to the requester. 91 In particular, when the Payload Stream of an RPC Reply message is 92 expected to be large, the requester allocates and registers a Reply 93 chunk. The responder transfers the RPC Reply message's Payload 94 stream directly into the requester memory associated with that chunk, 95 then indicates that the RPC Reply is ready. The requester 96 invalidates the memory region. 98 In most cases, Upper Layer Protocols are capable of accurately 99 calculating the maximum size of RPC Reply messages. In addition, the 100 average size of RPC Reply messages is small, making the risk of Reply 101 chunk overrun exceptionally small. 103 However, on rare occasions an Upper Layer Protocol might not be able 104 to derive a reply size upper bound. An example of this is the NFS 105 version 4.1 GETATTR operation [RFC5661] [RFC8267] where a reply can 106 contain an unpredictable number of data content and hole descriptors. 108 Further, since the average size of actual RPC Replies is small, 109 requesters frequently allocate and register a Reply chunk for a reply 110 that, once it has been constructed by the responder, is small enough 111 to be sent inline. In this case, a responder is free to either 112 populate the Reply chunk or send the RPC Reply without the use of the 113 Reply chunk. The requester's cost of preparing the Reply chunk has 114 been wasted, and the extra registration and invalidation adds 115 unwanted latency to the operation. 117 A better method of handling RPC replies could ensure that RPC Replies 118 can be received even when the maximum possible size of some replies 119 cannot be calculated in advance. This method could also ensure that 120 no extra memory registration/invalidation operations are necessary to 121 make this guarantee. 123 This document resurrects the responder-provided Read chunk mechanism 124 that was briefly outlined in [RFC5666] to achieve these goals. The 125 discussion in this document assumes the reader is familiar with 126 [RFC8166]. 128 2. Requirements Language 130 The key words "MUST", "MUST NOT", "REQUIRED", "SHOULD", "SHOULD NOT", 131 "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be 132 interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only 133 when, they appear in all capitals, as shown here. 135 3. Problem Statement 137 RPC-over-RDMA Version One uses an RDMA Send request to transmit 138 transport headers and small RPC messages. 140 Each peer on an RPC-over-RDMA transport connection provisions Receive 141 buffers in which to capture incoming RDMA Send messages. There is a 142 limited number of these buffers, necessitating accounting in the 143 transport protocol to prevent a peer from emitting more Send 144 operations than the receiver is prepared for. 146 Because the selection of Receive Work Request to handle an incoming 147 Send is outside the control of the host O/S, the smallest buffer in 148 this pool determines the largest size message that can be received. 149 The size of the largest message that can be received via RDMA Send is 150 known as the receiver's "inline threshold" [RFC8166]. 152 When marshaling an RPC transaction, a requester allocates and 153 registers a Reply chunk whenever the maximum possible size of the 154 corresponding RPC-over-RDMA reply is larger than the requester's 155 receive inline threshold. The Reply chunk is presented to the 156 responder as part of the RPC Call. The responder may place the 157 associated RPC Reply message in the memory region linked with this 158 Reply chunk. 160 3.1. Reply Chunk Overrun 162 If a responder overruns a Reply chunk during an RDMA Write, a memory 163 protection error occurs. This typically results in connection loss. 164 Any RPC transactions running on that connection must be 165 retransmitted. The failing RPC transaction will never get a reply, 166 and retransmitting it may result in additional connection loss 167 events. 169 A smart responder compares the size of an RPC Reply with the size of 170 the target Reply chunk before initiating the placement of data in 171 that chunk. A generic RDMA_ERROR message reports the problem and the 172 requester can terminate the RPC transaction. 174 In either case, the RPC is executed by the responder, but the 175 requester does not receive the results or acknowledgement of its 176 completion. 178 3.2. Reply Size Calculation 180 To determine when a Reply chunk is needed, requesters calculate the 181 maximum possible size of the RPC Reply message expected for each 182 transaction. Upper Layer Bindings, such as [RFC8267] provide 183 guidance on how to calculate Reply sizes and in what cases the Upper 184 Layer Protocol might have difficulty giving an exact upper bound. 186 Unfortunately, there are rare cases where an upper bound cannot be 187 computed. For instance, there is no way to know how large an NFS 188 Access Control List (ACL) is until it is retrieved from an NFS server 189 [RFC5661]. There is no protocol-specified limit on the size of NFS 190 ACLs. When retrieving an NFS ACL, there is always a risk, albeit a 191 small one, that the NFS client has not provided a large enough Reply 192 chunk, and that therefore the NFS server will not be able to return 193 that ACL to the client (unless somehow a larger Reply chunk can be 194 provided). 196 3.3. Requester Registration Costs 198 For an Upper Layer Protocol such as NFS version 4.2 [RFC7862], NFS 199 COMPOUND Call and Reply messages can be large on occasion. For 200 instance, an NFSv4.2 COMPOUND can contain a LOOKUP operation together 201 with a GETATTR operation. The size of a LOOKUP result is relatively 202 small. However, the GETATTR in that COMPOUND may request attributes, 203 such as ACLs or security labels, that can grow arbitrarily large and 204 whose size is not known in advance. 206 Thus a requester can be responsible for provisioning quite a large 207 reply buffer for each LOOKUP COMPOUND, which is a frequent request. 208 If the maximum possible reply message can be large, the requester is 209 required to provide a Reply chunk. Most of the time, however, the 210 actual size of a LOOKUP COMPOUND reply is small enough to be sent 211 using one RDMA Send. 213 In other words, an NFS version 4 client provides a Reply chunk quite 214 frequently during RPC transactions, but NFS version 4 servers almost 215 never need to use it because the actual size of replies is typically 216 less than the inline threshold. The overhead of registering and 217 invalidating this chunk is significant. Moreover it is unnecessary 218 whenever the size of an actual RPC reply is small. 220 Before an RPC transaction is terminated, a requester is responsible 221 for fencing the Reply chunk from the responder [RFC8166]. That makes 222 RPC completion synchronous with Reply chunk invalidation. Therefore 223 the latency of Reply chunk invalidation adds to the total execution 224 time of the RPC transaction. 226 3.4. Denial of Service 228 When an RPC transaction is canceled or aborted (for instance, because 229 an application process exited prematurely), a requester must 230 invalidate or set aside Write and Reply chunks associated with that 231 transaction [RFC8166]. 233 This is because that RPC transaction is still running on the 234 responder. The responder remains obligated to return the result of 235 that transaction via RDMA Write, if there are Write or Reply chunks. 236 If memory registered on behalf of that transaction is re-used, the 237 requester must protect that memory from server RDMA Writes associated 238 with previous transactions by fencing it from the responder. The 239 responder triggers a memory protection error when it writes into 240 those memory regions, and the connection is lost. 242 A malfunctioning application or a malicious user on the requester can 243 create a situation where RPCs are continuously initiated and then 244 aborted, resulting in responder replies that repeatedly terminate the 245 underlying RPC-over-RDMA connection. 247 A rogue responder can purposely overrun a Reply chunk to kill a 248 connection. Repeated connection loss can result in a Denial of 249 Service. 251 3.5. Estimating Transport Header Size 253 To determine whether a Reply chunk is needed, a requester computes 254 the size of the Reply's Transport Header and the maximum possible 255 size of the RPC Reply message, and sums the two. If the sum is 256 smaller than the requester's receive inline threshold, a Reply chunk 257 is not required. 259 The size of a Transport Header depends on how many Write chunks the 260 requester provides, whether a Reply chunk is needed, and how many 261 segments are contained in provided Write and Reply chunks. 263 When the total size of the Reply message is already near the inline 264 threshold, therefore, a requester has to know whether a Reply chunk 265 is needed (and how many segments it contains) before it can determine 266 if a Reply chunk is needed. 268 A requester can resort to limiting Transport Header size to a fixed 269 value that ensures this computation does not become a recursion. 270 However, as in earlier sections, this can mean that some RPC 271 transactions where a Reply chunk is not strictly necessary must incur 272 the cost of preparing a Reply chunk. 274 4. Responder-Provided Read Chunks 276 A potential mechanism for resolving these issues is suggested in 277 Section 3.4 of [RFC5666]: 279 In the absence of a server-provided read chunk list in the reply, 280 if the encoded reply overflows the posted receive buffer, the RPC 281 will fail with an RDMA transport error. 283 When sending a large RPC Call message, requesters already employ Read 284 chunks. There is no advance indication or limit on the size of any 285 RPC Call message. To achieve the same flexibility for RPC Replies, 286 Read chunks can be used in the reverse direction (e.g., responder 287 exposes memory, requester initiates RDMA Read). 289 Rather than a requester providing a Reply chunk for conveying an as- 290 yet-unconstructed large reply, a responder can expose a Read chunk 291 containing the actual Payload stream of the RPC Reply message. A 292 responder would employ a Read chunk to return a reply any time 293 requester-provided reply resources are not adequate. 295 The requester does not have to calculate a reply size maximum or 296 register and invalidate a Reply chunk in these cases. Without a 297 requester-provided Reply chunk, the responder sends each reply 298 inline, except when the actual size of an RPC Reply message is larger 299 than the receiver's inline threshold. 301 This results in no wasted activity on the requester and arbitrarily 302 large RPC Replies can be received reliably. 304 Current RPC-over-RDMA Version One implementations do not support 305 responder-provided Read chunks, although RPC-over-RDMA Version One 306 did have this support in the past [RFC5666]. Adapting this 307 deprecated mechanism for new RPC-over-RDMA transports is 308 straightforward. 310 4.1. Specification 312 A responder MAY choose to send an RPC Reply using a Position Zero 313 Read chunk comprised of one or more RDMA segments. Position Zero 314 Read chunks are defined in Section 3.5.3 of [RFC8166]. 316 Similar to its use in an RPC Call, a Position Zero Read chunk in an 317 RPC Reply contains an RPC Reply's Payload stream. Position Zero Read 318 chunks are always sent using an RPC-over-RDMA RDMA_NOMSG message. 320 In other words, a responder-provided Read chunk can replace the use 321 of a Reply chunk in Long Replies. And, as with Reply chunks, a 322 responder must still make use of Write chunks provided by the 323 requester. 325 4.1.1. Responder Duties 327 A responder MUST send a Position Zero Read chunk when the actual size 328 of the RPC Reply's Payload stream exceeds all requester-provided 329 reply resources; that is, when the inline threshold and any provided 330 Reply chunk are both too small to accommodate the Payload stream of 331 the reply. 333 If a responder does not support responder-provided Read chunks in 334 this case, it MUST return an appropriate permanent transport error to 335 terminate the requester's RPC transaction. 337 4.1.2. Requester Duties 339 Upon receipt of an RDMA_NOMSG message containing a Position Zero Read 340 chunk, the requester pulls the RPC Reply's Payload stream from the 341 responder. 343 After RDMA Read operations have completed (successfully or in error), 344 the requester MUST inform the responder that it may invalidate the 345 Read chunk containing the RPC Reply message. This is referred to as 346 "pull completion notification". 348 4.1.3. Pull Completion Notification 350 Pull completion notification is accomplished in one of two ways: 352 o The requester can send an RDMA_DONE message with the rdma_xid 353 field set to the same value as the rdma_xid field in the 354 RDMA_NOMSG request. Or, 356 o The requester can piggyback the pull completion notification in 357 the transport header of a subsequent RPC Call, if the transport 358 protocol has such a facility. 360 When an RPC transaction is aborted on a requester, the requester 361 normally forgets its XID. If a requester receives a reply bearing a 362 Position Zero Read chunk and does not recognize the XID, the 363 requester MUST notify the responder of pull completion. 365 Whenever a responder receives a pull completion notification for an 366 XID for which there is no Read chunk waiting to be invalidated, the 367 responder MUST silently drop the notification. 369 If a requester receives an RPC Reply via a responder-provided Read 370 chunk, but does not support such chunks, it MUST inform the responder 371 of pull completion and terminate the RPC transaction. 373 A malicious or broken requester might neglect to send pull completion 374 notifications for one or more RPC transactions that included 375 responder-provided Read chunks. To prevent exhaustion of responder 376 resources, a responder can choose to invalidate its Read chunks after 377 waiting for a short period. If the requester attempts additional 378 RDMA Read operations against that Read chunk, a remote access error 379 occurs and the connection is lost. 381 4.1.4. Remote Invalidation 383 Remote Invalidation can reduce or eliminate the need for the 384 responder to explicitly invalidate memory containing an RPC Reply 385 message. 387 Remote Invalidation might be done by transmitting an RDMA_DONE 388 message using RDMA Send With Invalidate. If instead pull completion 389 notification is piggybacked on a subsequent RPC Call, a facility for 390 Remote Invalidation would have to be built into RPC Call processing. 392 If Remote Invalidate support is not indicated by one or both peers, 393 messages carrying pull completion notification MUST be transmitted 394 using RDMA Send. If Remote Invalidation support is indicated by both 395 peers, messages carrying pull completion messages SHOULD be 396 transmitted using RDMA Send With Invalidate. 398 The rule for choosing the value of the Send With Invalidate Work 399 Request's inv_handle field depends on the version of the transport 400 protocol that is use. If the responder has provided an R_key that 401 may be invalidated, the requester MUST present only that R_key when 402 using RDMA Send With Invalidate. 404 5. Analysis 406 5.1. Benefits 408 5.1.1. Less Frequent Use of Explicit RDMA 410 The vast majority of RPC Replies can be conveyed via RDMA_MSG. No 411 extra Reply chunk registration and invalidation cost is incurred when 412 a large RPC Reply message is possible but the actual reply size is 413 small. This reduces or even eliminates the use of explicit RDMA for 414 frequent small-to-moderate-size replies, improving the average 415 latency of individual RPCs and allowing RNIC and platform resources 416 to scale better. 418 5.1.2. Support for Arbitrarily Large Replies 420 The responder-provided Read chunk approach accommodates arbitrarily 421 large replies. Requesters no longer need to calculate the maximum 422 size of RPC Reply messages, even if a Reply chunk is provided. 424 5.1.3. Protection of Connection After RPC Cancellation 426 When an RPC is canceled on the requester (say, because the requesting 427 application has been terminated), and no Reply chunk is provided, the 428 requester is no longer responsible for invalidating that RPC's Reply 429 chunk. When the responder sends the reply, it provides a Position 430 Zero Read chunk and does not use RDMA Write to transmit the RPC Reply 431 message. The transport connection is preserved because no memory 432 protection violation can occur. 434 5.1.4. Asynchronous Chunk Invalidation 436 Registration of a responder-provided Read chunk must be completed 437 before sending the RDMA_NOMSG message conveying the chunk 438 information. However, pull completion notification and subsequent 439 responder-side memory invalidation can be performed after the RPC 440 transaction has completed on the requester. Because those are 441 asynchronous to RPC completion, the additional latency is not 442 attributed to the execution time of the RPC transaction. 444 5.2. Costs 446 5.2.1. Responder Memory Exposure 448 Responder memory is registered and exposed to requesters when 449 replying. When a responder has properly allocated a Protection 450 Domain for each connection and uses appropriate R_key rotation 451 techniques (see Section 7), the exposure is minimal. However, 452 because current RPC-over-RDMA responder implementations do not expose 453 memory to requesters, they typically share one Protection Domain 454 among all connections. 456 5.2.2. Round Trip Penalty 458 Using a Read chunk for large replies introduces a round-trip penalty. 459 A requester can provide a Reply chunk to avoid this penalty. 460 However: 462 o The Read chunk round-trip penalty would be paid much less often 463 than the Reply chunk registration cost is paid today, since 464 responder-provided Read chunks are used only when necessary 466 o Read chunk frequency is reduced even further as the inline 467 threshold is increased past the average size of the Upper Layer 468 Protocol's RPC Replies 470 o Invalidation of a Reply chunk is synchronous with RPC completion, 471 and may take as long as a round trip to the responder 473 o Read chunks are typically used for large payloads, where it is 474 likely that data transmission time greatly exceeds the round-trip 475 time 477 There are a few particular situations where the frequency of large 478 replies is high. For example, the use of the krb5i or krb5p GSS 479 services with RPC-over-RDMA require that Payload reduction is not 480 used. Thus, RPC-over-RDMA peers use only pure RDMA Sends or Long 481 messages when these services are in use. The actual size of a 482 READDIR reply is often unpredictable but is frequently large. In 483 these two cases, using a Reply chunk could be the more efficient 484 default choice. 486 5.2.3. Credit Accounting Complexity 488 Credit accounting is made more complex by the use of RDMA_DONE 489 messages after RDMA Read operations have completed. Sending an 490 RDMA_DONE message consumes one credit, temporarily reducing RPC 491 concurrency on the connection. There is no response to RDMA_DONE, so 492 it is not clear to the sender when that credit becomes available 493 again. One way to resolve this is to add a new message type to the 494 protocol, RDMA_ACK, which could be used any time there is a uni- 495 directional transport message to maintain the proper balance of 496 credit grants and responses. 498 Alternately, if the transport protocol supports piggybacking pull 499 completion notification on RPC Call messages, the requester can 500 piggyback in most cases to simplify credit accounting. An explicit 501 RDMA_DONE would be necessary only during light workloads, or the ULP 502 could post an RPC NULL containing a piggybacked pull completion 503 notification in these cases. 505 5.3. Selecting a Reply Mechanism 507 This section illustrates some possible implementation choices. 509 5.3.1. Requester 511 As an RPC Call is constructed, a requester might choose a reply 512 mechanism based on its estimation of the range of possible sizes of 513 the reply. 515 Responder-provided Read chunk 516 The requester knows the minimum size of the reply is smaller than 517 the inline threshold, but the maximum size of the reply is larger 518 than the inline threshold; or the requester cannot calculate the 519 maximum size of the reply. The client does not provide a Reply 520 chunk, and relies on a responder-provider Read chunk to handle 521 large replies. 523 Reply chunk 524 The requester knows the minimum and maximum size of the reply is 525 larger than the inline threshold. The requester provides a Reply 526 chunk. 528 Send-only 529 The requester knows the maximum size of the reply is smaller than 530 the inline threshold. The requester does not provide a Reply 531 chunk, and relies on a responder-provider Read chunk to handle 532 large replies. 534 A requester whose design requires Reply chunk invalidation after an 535 RPC transaction is canceled might choose to never use Reply chunks, 536 in favor of minimizing opportunities for connection loss. 538 5.3.2. Responder 540 After a responder has constructed an RPC Reply, it might choose which 541 reply mechanism to employ based on the actual size of the Payload 542 stream of the RPC Reply message. 544 Responder-provided Read chunk 545 The Payload stream is larger than the inline threshold and either 546 no Reply chunk was provided or the provided Reply chunk is too 547 small. The responder uses a responder-provided Read chunk. 549 Reply chunk 550 If a usable Reply chunk is available, the responder uses the Reply 551 chunk. 553 Send-only 554 If no Reply chunk is available and the Payload stream fits within 555 the inline threshold, the responder uses only Send or Send With 556 Invalidate to transmit the reply. 558 5.4. Implementation Complexity 560 5.4.1. RPC Call Path 562 Implementation of responder-provided Read chunks introduces little or 563 no additional complexity to the end-to-end RPC Call path. Unless a 564 requester implementer chooses to implement support for both Reply 565 chunks and responder-provided Read chunks, there could be a net loss 566 of code and run-time complexity in the RPC Call hot path. 568 The responder's RPC Call path needs to recognize RDMA_DONE messages 569 and initiate invalidation of Read chunks. Because invalidation can 570 be asynchronous, it is possible to perform Read chunk invalidation in 571 a separate worker thread. 573 5.4.2. RPC Reply Path 575 On the RPC Reply path side, logic to initiate registration of Read 576 chunks and wait for completion is added to the responder. This path 577 is not part of the hot path because it is used only infrequently. 579 The requester's reply handling hot path must recognize when Read 580 chunks are present in an RDMA_NOMSG message, and shunt execution to 581 code that can initiate an RDMA Read and wait for completion. Once 582 complete, the requester posts an RDMA_DONE message. 584 5.4.3. Managing RDMA_DONE messages 586 In order for a responder to match incoming RDMA_DONE messages to 587 reply buffers waiting to be invalidated, it might keep references to 588 these buffers in a data structure searchable by XID. This is similar 589 to managing a set of pending backchannel replies. 591 When an RDMA_DONE message arrives, the responder matches the XID in 592 the message to a waiting reply buffer, invalidates that buffer, and 593 removes the XID from the data structure. 595 This data structure can also be used for housekeeping tasks such as: 597 o Invalidating waiting buffers after a timeout, in case the 598 requester never sends RDMA_DONE 600 o Ignoring retransmitted or garbage RDMA_DONE requests 602 o Explicitly invalidating waiting Read chunks after a connection 603 loss, if necessary 605 o Invalidating waiting buffers on device removal 607 5.5. Alternatives 609 Increasing the inline threshold reduces the likelihood of needing a 610 Reply chunk, but does not eliminate the risks associated with 611 unpredictably large replies. 613 Message Continuation is more efficient than an explicit RDMA 614 operation, and does not require the exposure of requester or 615 responder memory [I-D.dnoveck-nfsv4-rpcrdma-rtrext]. 617 However, Message Continuation does limit the maximum size of a 618 conveyed message. As with a larger inline threshold, without 619 responder-provided Read chunks, reply size estimation is still 620 required to determine when a Reply chunk is required, and therefore 621 there is still risk associated with unpredictably large replies. 623 Message Continuation introduces complexity in the management of RPC- 624 over-RDMA credit grants because the relationship between RPC 625 transactions and credits is no longer one-to-one. Credit management 626 logic is an integral part of the RPC Call and Reply hot path on the 627 requester. 629 6. Interoperation Considerations 631 When a requester supports responder-provided Read chunks, it is 632 likely to neglect providing Reply chunks in some cases. A responder 633 that does not support responder-provided Read chunks can convey a 634 transport-level error when it has generated an RPC Reply that is 635 larger than the available reply resources. 637 The situation is more problematic if a responder supports responder- 638 provided Read chunks and sends them to a requester that is not able 639 to recognize and unmarshal them. The RPC transaction would never 640 complete, and the requester would never send a pull completion 641 notification. 643 Thus responder-provided Read chunks MUST be used only when both peers 644 support them: Either the base protocol version always has support 645 enabled, or the base protocol provides an extension mechanism that 646 indicates when support is available. 648 7. Security Considerations 650 The less frequent use of RDMA Write reduces opportunities for memory 651 overrun on the requester, and reduces the risk of connection loss 652 after an application is terminated prematurely. This reduces 653 exposure to accidental or malicious Denial of Service attacks. 655 Responder-provided Read chunks are exposed for read-only access. 656 Remote actors cannot alter the contents of exposed read-only memory, 657 though a man-in-the-middle can read or alter RDMA payloads while they 658 are in transit. The use of RPCSEC GSS or a transport-layer 659 confidentiality service completely blocks payload access by 660 unintended recipients. 662 Recommendations about adequate R_key rotation and the appropriate use 663 of Protection Domains can be found in Section 8.1 of [RFC8166]. 664 These recommendations apply when responders expose memory to convey 665 the Payload stream of an RPC Reply message. 667 Otherwise, this mechanism does not alter the attack surface of a 668 transport protocol that employs it. 670 8. IANA Considerations 672 This document does not require actions by IANA. 674 9. References 676 9.1. Normative References 678 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 679 Requirement Levels", BCP 14, RFC 2119, 680 DOI 10.17487/RFC2119, March 1997, 681 . 683 [RFC8166] Lever, C., Ed., Simpson, W., and T. Talpey, "Remote Direct 684 Memory Access Transport for Remote Procedure Call Version 685 1", RFC 8166, DOI 10.17487/RFC8166, June 2017, 686 . 688 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 689 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 690 May 2017, . 692 9.2. Informative References 694 [I-D.dnoveck-nfsv4-rpcrdma-rtrext] 695 Noveck, D., "RPC-over-RDMA Extensions to Reduce Internode 696 Round-trips", draft-dnoveck-nfsv4-rpcrdma-rtrext-03 (work 697 in progress), December 2017. 699 [RFC5661] Shepler, S., Ed., Eisler, M., Ed., and D. Noveck, Ed., 700 "Network File System (NFS) Version 4 Minor Version 1 701 Protocol", RFC 5661, DOI 10.17487/RFC5661, January 2010, 702 . 704 [RFC5666] Talpey, T. and B. Callaghan, "Remote Direct Memory Access 705 Transport for Remote Procedure Call", RFC 5666, 706 DOI 10.17487/RFC5666, January 2010, 707 . 709 [RFC7862] Haynes, T., "Network File System (NFS) Version 4 Minor 710 Version 2 Protocol", RFC 7862, DOI 10.17487/RFC7862, 711 November 2016, . 713 [RFC8267] Lever, C., "Network File System (NFS) Upper-Layer Binding 714 to RPC-over-RDMA Version 1", RFC 8267, 715 DOI 10.17487/RFC8267, October 2017, 716 . 718 Acknowledgments 720 Many thanks go to Karen Dietke, Chunli Zhang, Dai Ngo, and Tom 721 Talpey. The author also wishes to thank Bill Baker and Greg Marsden 722 for their support of this work. 724 Special thanks go to Transport Area Director Spencer Dawkins, NFSV4 725 Working Group Chair Spencer Shepler, and NFSV4 Working Group 726 Secretary Thomas Haynes for their support. 728 Author's Address 730 Charles Lever 731 Oracle Corporation 732 1015 Granger Avenue 733 Ann Arbor, MI 48104 734 United States of America 736 Phone: +1 248 816 6463 737 Email: chuck.lever@oracle.com