idnits 2.17.1 draft-cel-nfsv4-rpcrdma-reliable-reply-04.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 date (November 19, 2018) is 1975 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 (~~), 1 warning (==), 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 November 19, 2018 5 Expires: May 23, 2019 7 Improving the Performance and Reliability of RPC Replies on RPC-over- 8 RDMA Transports 9 draft-cel-nfsv4-rpcrdma-reliable-reply-04 11 Abstract 13 RPC transports such as RPC-over-RDMA version 1 require reply buffers 14 to be in place before an RPC Call is sent. However, RPC consumers 15 sometimes have difficulty estimating the expected maximum size of a 16 particular RPC reply. This introduces the risk that an RPC Reply 17 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 May 23, 2019. 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 1 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", "SHALL", "SHALL NOT", 131 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 132 "OPTIONAL" in this document are to be interpreted as described in BCP 133 14 [RFC2119] [RFC8174] when, and only when, they appear in all 134 capitals, as shown here. 136 3. Problem Statement 138 RPC-over-RDMA version 1 uses an RDMA Send request to transmit 139 transport headers and small RPC messages. 141 Each peer on an RPC-over-RDMA transport connection provisions Receive 142 buffers in which to capture incoming RDMA Send messages. There is a 143 limited number of these buffers, necessitating accounting in the 144 transport protocol to prevent a peer from emitting more Send 145 operations than the receiver is prepared for. 147 Because the selection of Receive Work Request to handle an incoming 148 Send is outside the control of the host O/S, the smallest buffer in 149 this pool determines the largest size message that can be received. 150 The size of the largest message that can be received via RDMA Send is 151 known as the receiver's "inline threshold" [RFC8166]. 153 When marshaling an RPC transaction, a requester allocates and 154 registers a Reply chunk whenever the maximum possible size of the 155 corresponding RPC-over-RDMA reply is larger than the requester's 156 receive inline threshold. The Reply chunk is presented to the 157 responder as part of the RPC Call. The responder may place the 158 associated RPC Reply message in the memory region linked with this 159 Reply chunk. 161 3.1. Reply Chunk Overrun 163 If a responder overruns a Reply chunk during an RDMA Write, a memory 164 protection error occurs. This typically results in connection loss. 165 Any RPC transactions running on that connection must be 166 retransmitted. The failing RPC transaction will never get a reply, 167 and retransmitting it may result in additional connection loss 168 events. 170 A smart responder compares the size of an RPC Reply with the size of 171 the target Reply chunk before initiating the placement of data in 172 that chunk. A generic RDMA_ERROR message reports the problem and the 173 requester can terminate the RPC transaction. 175 In either case, the RPC is executed by the responder, but the 176 requester does not receive the results or acknowledgement of its 177 completion. 179 3.2. Reply Size Calculation 181 To determine when a Reply chunk is needed, requesters calculate the 182 maximum possible size of the RPC Reply message expected for each 183 transaction. Upper Layer Bindings, such as [RFC8267] provide 184 guidance on how to calculate Reply sizes and in what cases the Upper 185 Layer Protocol might have difficulty giving an exact upper bound. 187 Unfortunately, there are rare cases where an upper bound cannot be 188 computed. For instance, there is no way to know how large an NFS 189 Access Control List (ACL) is until it is retrieved from an NFS server 190 [RFC5661]. There is no protocol-specified limit on the size of NFS 191 ACLs. When retrieving an NFS ACL, there is always a risk, albeit a 192 small one, that the NFS client has not provided a large enough Reply 193 chunk, and that therefore the NFS server will not be able to return 194 that ACL to the client (unless somehow a larger Reply chunk can be 195 provided). 197 3.3. Requester Registration Costs 199 For an Upper Layer Protocol such as NFS version 4.2 [RFC7862], NFS 200 COMPOUND Call and Reply messages can be large on occasion. For 201 instance, an NFSv4.2 COMPOUND can contain a LOOKUP operation together 202 with a GETATTR operation. The size of a LOOKUP result is relatively 203 small. However, the GETATTR in that COMPOUND may request attributes, 204 such as ACLs or security labels, that can grow arbitrarily large and 205 whose size is not known in advance. 207 Thus a requester can be responsible for provisioning quite a large 208 reply buffer for each LOOKUP COMPOUND, which is a frequent request. 209 If the maximum possible reply message can be large, the requester is 210 required to provide a Reply chunk. Most of the time, however, the 211 actual size of a LOOKUP COMPOUND reply is small enough to be sent 212 using one RDMA Send. 214 In other words, an NFS version 4 client provides a Reply chunk quite 215 frequently during RPC transactions, but NFS version 4 servers almost 216 never need to use it because the actual size of replies is typically 217 less than the inline threshold. The overhead of registering and 218 invalidating this chunk is significant. Moreover it is unnecessary 219 whenever the size of an actual RPC reply is small. 221 Before an RPC transaction is terminated, a requester is responsible 222 for fencing the Reply chunk from the responder [RFC8166]. That makes 223 RPC completion synchronous with Reply chunk invalidation. Therefore 224 the latency of Reply chunk invalidation adds to the total execution 225 time of the RPC transaction. 227 3.4. Denial of Service 229 When an RPC transaction is canceled or aborted (for instance, because 230 an application process exited prematurely), a requester must 231 invalidate or set aside Write and Reply chunks associated with that 232 transaction [RFC8166]. 234 This is because that RPC transaction is still running on the 235 responder. The responder remains obligated to return the result of 236 that transaction via RDMA Write, if there are Write or Reply chunks. 237 If memory registered on behalf of that transaction is re-used, the 238 requester must protect that memory from server RDMA Writes associated 239 with previous transactions by fencing it from the responder. The 240 responder triggers a memory protection error when it writes into 241 those memory regions, and the connection is lost. 243 A malfunctioning application or a malicious user on the requester can 244 create a situation where RPCs are continuously initiated and then 245 aborted, resulting in responder replies that repeatedly terminate the 246 underlying RPC-over-RDMA connection. 248 A rogue responder can purposely overrun a Reply chunk to kill a 249 connection. Repeated connection loss can result in a Denial of 250 Service. 252 3.5. Estimating Transport Header Size 254 To determine whether a Reply chunk is needed, a requester computes 255 the size of the Reply's Transport Header and the maximum possible 256 size of the RPC Reply message, and sums the two. If the sum is 257 smaller than the requester's receive inline threshold, a Reply chunk 258 is not required. 260 The size of a Transport Header depends on how many Write chunks the 261 requester provides, whether a Reply chunk is needed, and how many 262 segments are contained in provided Write and Reply chunks. 264 When the total size of the Reply message is already near the inline 265 threshold, therefore, a requester has to know whether a Reply chunk 266 is needed (and how many segments it contains) before it can determine 267 if a Reply chunk is needed. 269 A requester can resort to limiting Transport Header size to a fixed 270 value that ensures this computation does not become a recursion. 271 However, as in earlier sections, this can mean that some RPC 272 transactions where a Reply chunk is not strictly necessary must incur 273 the cost of preparing a Reply chunk. 275 4. Responder-Provided Read Chunks 277 A potential mechanism for resolving these issues is suggested in 278 Section 3.4 of [RFC5666]: 280 In the absence of a server-provided read chunk list in the reply, 281 if the encoded reply overflows the posted receive buffer, the RPC 282 will fail with an RDMA transport error. 284 When sending a large RPC Call message, requesters already employ Read 285 chunks. There is no advance indication or limit on the size of any 286 RPC Call message. To achieve the same flexibility for RPC Replies, 287 Read chunks can be used in the reverse direction (e.g., responder 288 exposes memory, requester initiates RDMA Read). 290 Rather than a requester providing a Reply chunk for conveying an as- 291 yet-unconstructed large reply, a responder can expose a Read chunk 292 containing the actual Payload stream of the RPC Reply message. A 293 responder would employ a Read chunk to return a reply any time 294 requester-provided reply resources are not adequate. 296 The requester does not have to calculate a reply size maximum or 297 register and invalidate a Reply chunk in these cases. Without a 298 requester-provided Reply chunk, the responder sends each reply 299 inline, except when the actual size of an RPC Reply message is larger 300 than the receiver's inline threshold. 302 This results in no wasted activity on the requester and arbitrarily 303 large RPC Replies can be received reliably. 305 Current RPC-over-RDMA version 1 implementations do not support 306 responder-provided Read chunks, although RPC-over-RDMA version 1 did 307 have this support in the past [RFC5666]. Adapting this deprecated 308 mechanism for new RPC-over-RDMA transports is 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 617 However, Message Continuation still limits 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 [RFC5661] Shepler, S., Ed., Eisler, M., Ed., and D. Noveck, Ed., 695 "Network File System (NFS) Version 4 Minor Version 1 696 Protocol", RFC 5661, DOI 10.17487/RFC5661, January 2010, 697 . 699 [RFC5666] Talpey, T. and B. Callaghan, "Remote Direct Memory Access 700 Transport for Remote Procedure Call", RFC 5666, 701 DOI 10.17487/RFC5666, January 2010, 702 . 704 [RFC7862] Haynes, T., "Network File System (NFS) Version 4 Minor 705 Version 2 Protocol", RFC 7862, DOI 10.17487/RFC7862, 706 November 2016, . 708 [RFC8267] Lever, C., "Network File System (NFS) Upper-Layer Binding 709 to RPC-over-RDMA Version 1", RFC 8267, 710 DOI 10.17487/RFC8267, October 2017, 711 . 713 Acknowledgments 715 Many thanks go to Karen Dietke, Chunli Zhang, Dai Ngo, and Tom 716 Talpey. The author also wishes to thank Bill Baker and Greg Marsden 717 for their support of this work. 719 Special thanks go to Transport Area Director Spencer Dawkins, NFSV4 720 Working Group Chairs Spencer Shepler and Brian Pawlowski, and NFSV4 721 Working Group Secretary Thomas Haynes for their support. 723 Author's Address 725 Charles Lever 726 Oracle Corporation 727 1015 Granger Avenue 728 Ann Arbor, MI 48104 729 United States of America 731 Email: chuck.lever@oracle.com