idnits 2.17.1 draft-cel-nfsv4-rpcrdma-version-two-05.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 contain a disclaimer for pre-RFC5378 work, but was first submitted on or after 10 November 2008. The disclaimer is usually necessary only for documents that revise or obsolete older RFCs, and that take significant amounts of text from those RFCs. If you can contact all authors of the source material and they are willing to grant the BCP78 rights to the IETF Trust, you can and should remove the disclaimer. Otherwise, the disclaimer is needed and you can ignore this comment. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (July 17, 2017) is 2473 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'RFC5662' is defined on line 1560, but no explicit reference was found in the text == Unused Reference: 'RFC5666' is defined on line 1555, but no explicit reference was found in the text -- 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 (~~), 4 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, Ed. 3 Internet-Draft Oracle 4 Intended status: Standards Track D. Noveck 5 Expires: January 18, 2018 NetApp 6 July 17, 2017 8 RPC-over-RDMA Version 2 Protocol 9 draft-cel-nfsv4-rpcrdma-version-two-05 11 Abstract 13 This document specifies an improved protocol for conveying Remote 14 Procedure Call (RPC) messages on physical transports capable of 15 Remote Direct Memory Access (RDMA), based on RPC-over-RDMA version 1. 17 Status of This Memo 19 This Internet-Draft is submitted in full conformance with the 20 provisions of BCP 78 and BCP 79. 22 Internet-Drafts are working documents of the Internet Engineering 23 Task Force (IETF). Note that other groups may also distribute 24 working documents as Internet-Drafts. The list of current Internet- 25 Drafts is at http://datatracker.ietf.org/drafts/current/. 27 Internet-Drafts are draft documents valid for a maximum of six months 28 and may be updated, replaced, or obsoleted by other documents at any 29 time. It is inappropriate to use Internet-Drafts as reference 30 material or to cite them other than as "work in progress." 32 This Internet-Draft will expire on January 18, 2018. 34 Copyright Notice 36 Copyright (c) 2017 IETF Trust and the persons identified as the 37 document authors. All rights reserved. 39 This document is subject to BCP 78 and the IETF Trust's Legal 40 Provisions Relating to IETF Documents 41 (http://trustee.ietf.org/license-info) in effect on the date of 42 publication of this document. Please review these documents 43 carefully, as they describe your rights and restrictions with respect 44 to this document. Code Components extracted from this document must 45 include Simplified BSD License text as described in Section 4.e of 46 the Trust Legal Provisions and are provided without warranty as 47 described in the Simplified BSD License. 49 This document may contain material from IETF Documents or IETF 50 Contributions published or made publicly available before November 51 10, 2008. The person(s) controlling the copyright in some of this 52 material may not have granted the IETF Trust the right to allow 53 modifications of such material outside the IETF Standards Process. 54 Without obtaining an adequate license from the person(s) controlling 55 the copyright in such materials, this document may not be modified 56 outside the IETF Standards Process, and derivative works of it may 57 not be created outside the IETF Standards Process, except to format 58 it for publication as an RFC or to translate it into languages other 59 than English. 61 Table of Contents 63 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 64 2. Requirements Language . . . . . . . . . . . . . . . . . . . . 4 65 3. Inline Threshold . . . . . . . . . . . . . . . . . . . . . . 4 66 3.1. Terminology . . . . . . . . . . . . . . . . . . . . . . . 4 67 3.2. Motivation . . . . . . . . . . . . . . . . . . . . . . . 5 68 3.3. Default Values . . . . . . . . . . . . . . . . . . . . . 5 69 4. Remote Invalidation . . . . . . . . . . . . . . . . . . . . . 6 70 4.1. Backward-Direction Remote Invalidation . . . . . . . . . 6 71 5. Protocol Extensibility . . . . . . . . . . . . . . . . . . . 7 72 5.1. Optional Features . . . . . . . . . . . . . . . . . . . . 7 73 5.2. Message Direction . . . . . . . . . . . . . . . . . . . . 7 74 5.3. Documentation Requirements . . . . . . . . . . . . . . . 8 75 6. Transport Properties . . . . . . . . . . . . . . . . . . . . 9 76 6.1. Introduction to Transport Properties . . . . . . . . . . 9 77 6.2. Basic Transport Properties . . . . . . . . . . . . . . . 12 78 6.3. New Operations . . . . . . . . . . . . . . . . . . . . . 15 79 6.4. Extensibility . . . . . . . . . . . . . . . . . . . . . . 20 80 7. XDR Protocol Definition . . . . . . . . . . . . . . . . . . . 21 81 7.1. Code Component License . . . . . . . . . . . . . . . . . 22 82 7.2. RPC-Over-RDMA Version 2 XDR . . . . . . . . . . . . . . . 24 83 8. Protocol Version Negotiation . . . . . . . . . . . . . . . . 31 84 8.1. Server Does Support RPC-over-RDMA Version 2 . . . . . . . 32 85 8.2. Server Does Not Support RPC-over-RDMA Version 2 . . . . . 32 86 8.3. Client Does Not Support RPC-over-RDMA Version 2 . . . . . 32 87 8.4. Security Considerations . . . . . . . . . . . . . . . . . 32 88 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 33 89 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 33 90 10.1. Normative References . . . . . . . . . . . . . . . . . . 33 91 10.2. Informative References . . . . . . . . . . . . . . . . . 33 92 Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . 34 93 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 34 95 1. Introduction 97 Remote Direct Memory Access (RDMA) [RFC5040] [RFC5041] [IBARCH] is a 98 technique for moving data efficiently between end nodes. By 99 directing data into destination buffers as it is sent on a network 100 and placing it via direct memory access by hardware, the 101 complementary benefits of faster transfers and reduced host overhead 102 are obtained. 104 A protocol already exists that enables ONC RPC [RFC5531] messages to 105 be conveyed on RDMA transports. That protocol is RPC-over-RDMA 106 version 1, specified in [RFC8166]. RPC-over-RDMA version 1 is 107 deployed and in use, though there are some shortcomings to this 108 protocol, such as: 110 o The use of small Receive buffers force the use of RDMA Read and 111 Write transfers for small payloads, and limit the size of 112 backchannel messages. 114 o Lack of support for potential optimizations, such as remote 115 invalidation, that require changes to on-the-wire behavior. 117 To address these issues in a way that is compatible with existing 118 RPC-over-RDMA version 1 deployments, a new version of RPC-over-RDMA 119 is presented in this document. RPC-over-RDMA version 2 contains only 120 incremental changes over RPC-over-RDMA version 1 to facilitate 121 adoption of version 2 by existing version 1 implementations. 123 The major new feature in RPC-over-RDMA version 2 is extensibility of 124 the RPC-over-RDMA header. Extensibility enables narrow changes to 125 RPC-over-RDMA version 2 so that new optional capabilities can be 126 introduced without a protocol version change and while maintaining 127 interoperability with existing implementations. 129 New capabilities can be proposed and developed independently of each 130 other, and implementaters can choose among them, making it 131 straightforward to create and document experimental features and then 132 bring them through the standards process. 134 As part of this new extensibility feature set, a mechanism for 135 exchanging transport properties is introduced. This mechanism allows 136 RPC-over-RDMA version 2 connection endpoints to communicate 137 properties of their implementations, to request changes in properties 138 of the other endpoint, and to notify peer endpoints of changes to 139 properties that occur during operation. 141 In addition to extensibility, the default inline threshold value is 142 larger in RPC-over-RDMA version 2. This change is driven by the 143 increase in average size of RPC messages containing common NFS 144 operations. With NFS version 4.1 [RFC5661] and later, compound 145 operations convey more data per RPC message. The default 1KB inline 146 threshold in RPC-over-RDMA version 1 prevents attaining the best 147 possible performance. 149 Support for Remote Invalidation has been introduced into RPC-over- 150 RDMA version 2. An RPC-over-RDMA responder can now request 151 invalidation of an STag as part of sending an RPC Reply, saving the 152 requester the effort of invalidating after message receipt. This new 153 feature is general enough to enable a requester to control precisely 154 when Remote Invalidation may be utilized by responders. 156 RPC-over-RDMA version 2 expands the repertoire of error codes to 157 enable extensibility, support debugging, and to prevent requester 158 retries when an error is permanent. 160 2. Requirements Language 162 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 163 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 164 document are to be interpreted as described in [RFC2119] [RFC8174] 165 when, and only when, they appear in all capitals, as shown here. 167 3. Inline Threshold 169 3.1. Terminology 171 The term "inline threshold" is defined in Section 4 of [RFC8166]. An 172 "inline threshold" value is the largest message size (in octets) that 173 can be conveyed in one direction on an RDMA connection using only 174 RDMA Send and Receive. Each connection has two inline threshold 175 values: one for messages flowing from requester-to-responder 176 (referred to as the "call inline threshold"), and one for messages 177 flowing from responder-to-requester (referred to as the "reply inline 178 threshold"). Inline threshold values are not advertised to peers via 179 the base RPC-over-RDMA version 2 protocol. 181 A connection's inline threshold determines when RDMA Read or Write 182 operations are required because the RPC message to be sent cannot be 183 conveyed via RDMA Send and Receive. When an RPC message does not 184 contain DDP-eligible data items, a requester prepares a Long Call or 185 Reply to convey the whole RPC message using RDMA Read or Write 186 operations. 188 3.2. Motivation 190 RDMA Read and Write operations require that each data payload resides 191 in a region of memory that is registered with the RNIC. When an RPC 192 is complete, that region is invalidated, fencing it from the 193 responder. 195 Both registration and invalidation have a latency cost which is 196 insignificant compared to data handling costs. When a data payload 197 is small, however, the cost of registering and invalidating the 198 memory where the payload resides becomes a relatively significant 199 part of total RPC latency. Therefore the most efficient operation of 200 RPC-over-RDMA occurs when RDMA Read and Write operations are used for 201 large payloads, and avoided for small payloads. 203 When RPC-over-RDMA version 1 was conceived, the typical size of RPC 204 messages that did not involve a significant data payload was under 205 500 bytes. A 1024-byte inline threshold adequately minimized the 206 frequency of inefficient Long Calls and Replies. 208 Starting with NFS version 4.1 [RFC5661], NFS COMPOUND messages are 209 larger and more complex than before. With a 1024-byte inline 210 threshold, RDMA Read or Write operations are needed for frequent 211 operations that do not bear a data payload, such as GETATTR and 212 LOOKUP, reducing the efficiency of the transport. 214 To reduce the need to use Long Calls and Replies, RPC-over-RDMA 215 version 2 increases the default inline threshold size. This also 216 increases the maximum size of backward direction RPC messages. 218 3.3. Default Values 220 RPC-over-RDMA version 2 receiver implementations MUST support an 221 inline threshold of 4096 bytes, but MAY support larger inline 222 threshold values. A mechanism for discovering a peer's preferred 223 inline threshold value (not defined in this document) may be used to 224 optimize RDMA Send operations further. In the absense of such a 225 mechanism, senders MUST assume a receiver's inline threshold is 4096 226 bytes. 228 The new default inline threshold size is no larger than the size of a 229 hardware page on typical platforms. This conserves the resources 230 needed to Send and Receive base level RPC-over-RDMA version 2 231 messages, enabling RPC-over-RDMA version 2 to be used on a broad 232 variety of hardware. 234 4. Remote Invalidation 236 An STag that is registered using the FRWR mechanism (in a privileged 237 execution context), or is registered via a Memory Window (in user 238 space), may be invalidated remotely [RFC5040]. These mechanisms are 239 available only when a requester's RNIC supports MEM_MGT_EXTENSIONS. 241 For the purposes of this discussion, there are two classes of STags. 242 Dynamically-registered STags are used in a single RPC, then 243 invalidated. Persistently-registered STags live longer than one RPC. 244 They may persist for the life of an RPC-over-RDMA connection, or 245 longer. 247 An RPC-over-RDMA requester may provide more than one STag in one 248 transport header. It may provide a combination of dynamically- and 249 persistently-registered STags in one RPC message, or any combination 250 of these in a series of RPCs on the same connection. Only 251 dynamically-registered STags using Memory Windows or FRWR (ie. 252 registered via MEM_MGT_EXTENSIONS) may be invalidated remotely. 254 There is no transport-level mechanism by which a responder can 255 determine how a requester-provided STag was registered, nor whether 256 it is eligible to be invalidated remotely. A requester that mixes 257 persistently- and dynamically-registered STags in one RPC, or mixes 258 them across RPCs on the same connection, must therefore indicate 259 which handles may be invalidated via a mechanism provided in the 260 Upper Layer Protocol. RPC-over-RDMA version 2 provides such a 261 mechanism. 263 The RDMA Send With Invalidate operation is used to invalidate an STag 264 on a remote system. It is available only when a responder's RNIC 265 supports MEM_MGT_EXTENSIONS, and must be utilized only when a 266 requester's RNIC supports MEM_MGT_EXTENSIONS (can receive and 267 recognize an IETH). 269 4.1. Backward-Direction Remote Invalidation 271 Existing RPC-over-RDMA protocol specifications [RFC8166] [RFC8167] do 272 not forbid direct data placement in the backward-direction, even 273 though there is currently no Upper Layer Protocol that may use it. 275 When chunks are present in a backward-direction RPC request, Remote 276 Invalidation allows the responder to trigger invalidation of a 277 requester's STags as part of sending a reply, the same as in the 278 forward direction. 280 However, in the backward direction, the server acts as the requester, 281 and the client is the responder. The server's RNIC, therefore, must 282 support receiving an IETH, and the server must have registered the 283 STags with an appropriate registration mechanism. 285 5. Protocol Extensibility 287 The core RPC-over-RDMA version 2 header format is specified in 288 Section 7 as a complete and stand-alone piece of XDR. Any change to 289 this XDR description requires a protocol version number change. 291 5.1. Optional Features 293 RPC-over-RDMA version 2 introduces the ability to extend the core 294 protocol via optional features. Extensibility enables minor protocol 295 issues to be addressed and incremental enhancements to be made 296 without the need to change the protocol version. The key capability 297 is that both sides can detect whether a feature is supported by their 298 peer or not. With this ability, OPTIONAL features can be introduced 299 over time to an otherwise stable protocol. 301 The rdma_opttype field carries a 32-bit unsigned integer. The value 302 in this field denotes an optional operation that MAY be supported by 303 the receiver. The values of this field and their meaning are defined 304 in other Standards Track documents. 306 The rdma_optinfo field carries opaque data. The content of this 307 field is data meaningful to the optional operation denoted by the 308 value in rdma_opttype. The content of this field is not defined in 309 the base RPC-over-RDMA version 2 protocol, but is defined in other 310 Standards Track documents 312 When an implementation does not recognize or support the value 313 contained in the rdma_opttype field, it MUST send an RPC-over-RDMA 314 message with the rdma_xid field set to the same value as the 315 erroneous message, the rdma_proc field set to RDMA2_ERROR, and the 316 rdma_err field set to RDMA2_ERR_INVAL_OPTION. 318 5.2. Message Direction 320 Backward direction operation depends on the ability of the receiver 321 to distinguish between incoming forward and backward direction calls 322 and replies. This needs to be done because both the XID field and 323 the flow control value (RPC-over-RDMA credits) in the RPC-over-RDMA 324 header are interpreted in the context of each message's direction. 326 A receiver typically distinguishes message direction by examining the 327 mtype field in the RPC header of each incoming payload message. 328 However, RDMA2_OPTIONAL type messages may not carry an RPC message 329 payload. 331 To enable RDMA2_OPTIONAL type messages that do not carry an RPC 332 message payload to be interpreted unambiguously, the rdma2_optional 333 structure contains a field that identifies the message direction. A 334 similar field has been added to the rpcrdma2_chunk_lists and 335 rpcrdma2_error structures to simplify parsing the RPC-over-RDMA 336 header at the receiver. 338 5.3. Documentation Requirements 340 RPC-over-RDMA version 2 may be extended by defining a new 341 rdma_opttype value, and then by providing an XDR description of the 342 rdma_optinfo content that corresponds with the new rdma_opttype 343 value. As a result, a new header type is effectively created. 345 A Standards Track document introduces each set of such protocol 346 elements. Together these elements are considered an OPTIONAL 347 feature. Each implementation is either aware of all the protocol 348 elements introduced by that feature, or is aware of none of them. 350 Documents describing extensions to RPC-over-RDMA version 2 should 351 contain: 353 o An explanation of the purpose and use of each new protocol element 354 added 356 o An XDR description of the protocol elements, and a script to 357 extract it 359 o A mechanism for reporting errors when the error is outside the 360 available choices already available in the base protocol or in 361 other extensions 363 o An indication of whether a Payload stream must be present, and a 364 description of its contents 366 o A description of interactions with existing extensions 368 The last bullet includes requirements that another OPTIONAL feature 369 needs to be present for new protocol elements to work, or that a 370 particular level of support be provided for some particular facility 371 for the new extension to work. 373 Implementers combine the XDR descriptions of the new features they 374 intend to use with the XDR description of the base protocol in this 375 document. This may be necessary to create a valid XDR input file 376 because extensions are free to use XDR types defined in the base 377 protocol, and later extensions may use types defined by earlier 378 extensions. 380 The XDR description for the RPC-over-RDMA version 2 protocol combined 381 with that for any selected extensions should provide an adequate 382 human-readable description of the extended protocol. 384 6. Transport Properties 386 6.1. Introduction to Transport Properties 388 6.1.1. Property Model 390 A basic set of receiver and sender properties is specified in this 391 document. An extensible approach is used, allowing new properties to 392 be defined in future standards track documents. 394 Such properties are specified using: 396 o A code identifying the particular transport property being 397 specified. 399 o A nominally opaque array which contains within it the XDR encoding 400 of the specific property indicated by the associated code. 402 The following XDR types are used by operations that deal with 403 transport properties: 405 407 typedef rpcrdma2_propid uint32; 409 struct rpcrdma2_propval { 410 rpcrdma2_propid rdma_which; 411 opaque rdma_data<>; 412 }; 414 typedef rpcrdma2_propval rpcrdma2_propset<>; 416 typedef uint32 rpcrdma2_propsubset<>; 418 420 An rpcrdma2_propid specifies a particular transport property. In 421 order to allow easier XDR extension of the set of properties by 422 concatenating XDR files, specific properties are defined as const 423 values rather than as elements in an enum. 425 An rpcrdma2_propval specifies a value of a particular transport 426 property with the particular property identified by rdma_which, while 427 the associated value of that property is contained within rdma_data. 429 A rdma_data field which is of zero length is interpreted as 430 indicating the default value or the property indicated by rdma_which. 432 While rdma_data is defined as opaque within the XDR, the contents are 433 interpreted (except when of length zero) using the XDR typedef 434 associated with the property specified by rdma_which. The receiver 435 of a message containing an rpcrdma2_propval MUST report an XDR error 436 [ cel: which error? BAD_XDR, or do we want to add a new one? ] if 437 the length of rdma_data is such that it extends beyond the bounds of 438 the message transferred. 440 In cases in which the rpcrdma2_propid specified by rdma_which is 441 understood by the receiver, the receiver also MUST report an XDR 442 error if either of the following occur: [ cel: which error? BAD_XDR, 443 or do we want to add a new one? ] 445 o The nominally opaque data within rdma_data is not valid when 446 interpreted using the property-associated typedef. 448 o The length of rdma_data is insufficient to contain the data 449 represented by the property-associated typedef. 451 Note that no error is to be reported if rdma_which is unknown to the 452 receiver. In that case, that rpcrdma2_propval is not processed and 453 processing continues using the next rpcrdma2_propval, if any. 455 A rpcrdma2_propset specifies a set of transport properties. No 456 particular ordering of the rpcrdma2_propval items within it is 457 imposed. 459 A rpcrdma2_propsubset identifies a subset of the properties in a 460 previously specified rpcrdma2_propset. Each bit in the mask denotes 461 a particular element in a previously specified rpcrdma2_propset. If 462 a particular rpcrdma2_propval is at position N in the array, then bit 463 number N mod 32 in word N div 32 specifies whether that particular 464 rpcrdma2_propval is included in the defined subset. Words beyond the 465 last one specified are treated as containing zero. 467 Propvalsubsets are useful in a number of contexts: 469 o In the specification of transport properties at connection, they 470 allow the sender to specify what subset of those are subject to 471 later change. 473 o In responding to a request to modify a set of transport 474 properties, they allow the responding endpoint to specify the 475 subsets of those properties for which the requested change has 476 been performed or been rejected. 478 6.1.2. Transport Property Groups 480 Transport properties are divided into a number of groups 482 o A basic set of transport properties defined in this document. See 483 Section 6.2 for the complete list. 485 o Additional transport properties defined in future standards track 486 documents as specified in Section 6.4.1. 488 o Experimental transport properties being explored preparatory to 489 being considered for standards track definition. See the 490 description in Section 6.4.2. 492 6.1.3. Operations Related to Transport Properties 494 There are a number of operations defined in Section 6.3 which are 495 used to communicate and manage transport properties. 497 Prime among these is RDMA2_CONNPROP (defined in Section 6.3.1 which 498 serves as a means by which an endpoint's transport properties may be 499 presented to its peer, typically upon establishing a connection. 501 In addition, there are a set of related operations concerned with 502 requesting, effecting and reporting changes in transport properties: 504 o RDMA2_REQPROP (defined in Section 6.3.2 which serves as a way for 505 an endpoint to request that a peer change the values for a set of 506 transport properties. 508 o RDMA2_RESPROP (defined in Section 6.3.3 is used to report on the 509 disposition of each of the individual transport property changes 510 requested in a previous RDMA2_REQPROP. 512 o RDMA2_UPDPROP (defined in Section 6.3.4 is used to report an 513 unsolicited change in a transport property. 515 Unlike many other operation types, the above are not used to effect 516 transfer of RPC requests but are internal one-way information 517 transfers. However, a RDMA2_REQPROP and the corresponding 518 RDMA2_RESPROP do constitute an RPC-like remote call. The other 519 operations are not part of a remote call transaction. 521 6.2. Basic Transport Properties 523 Although the set of transport properties is subject to later 524 extension, a basic set of transport properties is defined below in 525 Table 1. 527 In that table, the columns contain the following information: 529 o The column labeled "property" identifies the transport property 530 described by the current row. 532 o The column labeled "code" specifies the rpcrdma2_propid value used 533 to identify this property. 535 o The column labeled "XDR type" gives the XDR type of the data used 536 to communicate the value of this property. This data type 537 overlays the data portion of the nominally opaque field rdma_data 538 in a rpcrdma2_propval. 540 o The column labeled "default" gives the default value for the 541 property which is to be assumed by those who do not receive, or 542 are unable to interpret, information about the actual value of the 543 property. 545 o The column labeled "section" indicates the section (within this 546 document) that explains the semantics and use of this transport 547 property. 549 +---------+-----+------------------+----------------------+---------+ 550 | propert | cod | XDR type | default | section | 551 | y | e | | | | 552 +---------+-----+------------------+----------------------+---------+ 553 | Receive | 1 | uint32 | 4096 | 6.2.1 | 554 | Buffer | | | | | 555 | Size | | | | | 556 | Backwar | 2 | enum rpcrdma2_bk | RDMA2_BKREQSUP_INLIN | 6.2.2 | 557 | d | | reqsup | E | | 558 | Request | | | | | 559 | Support | | | | | 560 +---------+-----+------------------+----------------------+---------+ 562 Table 1 564 Note that this table does not provide any indication regarding 565 whether a particular property can change or whether a change in the 566 value may be requested (see Section 6.3.2). Such matters are not 567 addressed by the protocol definition. An implementation may provide 568 information about its readiness to make changed in a particular 569 property using the rdma_nochg field in the RDMA2_CONNPROP message. 571 A partner implementation can always request a change but peers MAY 572 reject a request to change a property for any reason. 573 Implementations are always free to reject such requests if they 574 cannot or do not wish to effect the requested change. 576 Either of the following will result in effective rejection requests 577 to change specific properties: 579 o If an endpoint does not wish to accept request to change 580 particular properties, it may reject such requests as described in 581 Section 6.3.3. 583 o If an endpoint does not support the RDMA2_REQPROP operation, the 584 effect would be the same as if every request to change a set of 585 property were rejected. 587 With regard to unrequested changes in transport properties, it is the 588 responsibility of the implementation making the change to do so in a 589 fashion that which does not interfere with the other partner's 590 continued correct operation (see Section 6.2.1). 592 6.2.1. Receive Buffer Size 594 The Receive Buffer Size specifies the minimum size, in octets, of 595 pre-posted receive buffers. It is the responsibility of the 596 participant sending this value to ensure that its pre-posted receives 597 are at least the size specified, allowing the participant receiving 598 this value to send messages that are of this size. 600 602 const uint32 RDMA2_PROPID_RBSIZ = 1; 603 typedef uint32 rpcrdma2_prop_rbsiz; 605 607 The sender may use his knowledge of the receiver's buffer size to 608 determine when the message to be sent will fit in the preposted 609 receive buffers that the receiver has set up. In particular, 611 o Requesters may use the value to determine when it is necessary to 612 provide a Position-Zero read chunk when sending a request. 614 o Requesters may use the value to determine when it is necessary to 615 provide a Reply chunk when sending a request, based on the maximum 616 possible size of the reply. 618 o Responders may use the value to determine when it is necessary, 619 given the actual size of the reply, to actually use a Reply chunk 620 provided by the requester. 622 Because there may be pre-posted receives with buffer sizes that 623 reflect earlier values of the buffer size property, changing this 624 property poses special difficulties: 626 o When the size is being raised, the partner should not be informed 627 of the change until all pending receives using the older value 628 have been eliminated. 630 o The size should not be reduced until the partner is aware of the 631 need to reduce the size of future sends to conform to this reduced 632 value. To ensure this, such a change should only occur in 633 response to an explicit request by the other endpoint (See 634 Section 6.3.2). The participant making the request should use 635 that lower size as the send size limit until the request is 636 rejected (See Section 6.3.3) or an update to a size larger than 637 the requested value becomes effective and the requested change is 638 no longer pending (See Section 6.3.4). 640 6.2.2. Backward Request Support 642 The value of this property is used to indicate a client 643 implementation's readiness to accept and process messages that are 644 part of backward-direction RPC requests. 646 648 enum rpcrdma2_bkreqsup { 649 RDMA2_BKREQSUP_NONE = 0, 650 RDMA2_BKREQSUP_INLINE = 1, 651 RDMA2_BKREQSUP_GENL = 2 652 }; 654 const uint32 RDMA2_PROPID_BRS = 2; 655 typedef rpcrdma2_bkreqsup rpcrdma2_prop_brs; 657 659 Multiple levels of support are distinguished: 661 o The value RDMA2_BKREQSUP_NONE indicates that receipt of backward- 662 direction requests and replies is not supported. 664 o The value RDMA2_BKREQSUP_INLINE indicates that receipt of 665 backward-direction requests or replies is only supported using 666 inline messages and that use of explicit RDMA operations or other 667 form of Direct Data Placement for backward direction requests or 668 responses is not supported. 670 o The value RDMA2_BKREQSUP_GENL that receipt of backward-direction 671 requests or replies is supported in the same ways that forward- 672 direction requests or replies typically are. 674 When information about this property is not provided, the support 675 level of servers can be inferred from the backward- direction 676 requests that they issue, assuming that issuing a request implicitly 677 indicates support for receiving the corresponding reply. On this 678 basis, support for receiving inline replies can be assumed when 679 requests without read chunks, write chunks, or Reply chunks are 680 issued, while requests with any of these elements allow the client to 681 assume that general support for backward-direction replies is present 682 on the server. 684 6.3. New Operations 686 The proposed new operations are set forth in Table 2 below. In that 687 table, the columns contain the following information: 689 o The column labeled "operation" specifies the particular operation. 691 o The column labeled "code" specifies the value of opttype for this 692 operation. 694 o The column labeled "XDR type" gives the XDR type of the data 695 structure used to describe the information in this new message 696 type. This data overlays the data portion of the nominally opaque 697 field optinfo in an RDMA_OPTIONAL message. 699 o The column labeled "msg" indicates whether this operation is 700 followed (or not) by an RPC message payload. 702 o The column labeled "section" indicates the section (within this 703 document) that explains the semantics and use of this optional 704 operation. 706 +------------------------+------+------------------+------+---------+ 707 | operation | code | XDR type | msg | section | 708 +------------------------+------+------------------+------+---------+ 709 | Specify Properties at | 1 | optinfo_connprop | No | 6.3.1 | 710 | Connection | | | | | 711 | Request Property | 2 | rpcrdma2_reqprop | No | 6.3.2 | 712 | Modification | | | | | 713 | Respond to | 3 | rpcrdma2_resprop | No | 6.3.3 | 714 | Modification Request | | | | | 715 | Report Updated | 4 | rpcrdma2_updprop | No | 6.3.4 | 716 | Properties | | | | | 717 +------------------------+------+------------------+------+---------+ 719 Table 2 721 Support for all of the operations above is OPTIONAL. RPC-over-RDMA 722 version 2 implementations that receive an operation that is not 723 supported MUST respond with RDMA_ERROR message with an error code of 724 RDMA_ERR_INVAL_OPTION. 726 The only operation support requirements are as follows: 728 o Implementations which send RDMA2_REQPROP messages must support 729 RDMA2_RESPROP messages. 731 o Implementations which support RDMA2_RESPROP or RDMA2_UPDPROP 732 messages must also support RDMA2_CONNPROP messages. 734 6.3.1. RDMA2_CONNPROP: Specify Properties at Connection 736 The RDMA2_CONNPROP message type allows an RPC-over-RDMA participant, 737 whether client or server, to indicate to its partner relevant 738 transport properties that the partner might need to be aware of. 740 The message definition for this operation is as follows: 742 744 struct rpcrdma2_connprop { 745 rpcrdma2_propset rdma_start; 746 rpcrdma2_propsubset rdma_nochg; 747 }; 749 750 All relevant transport properties that the sender is aware of should 751 be included in rdma_start. Since support of this request is 752 OPTIONAL, and since each of the properties is OPTIONAL as well, the 753 sender cannot assume that the receiver will necessarily take note of 754 these properties and so the sender should be prepared for cases in 755 which the partner continues to assume that the default value for a 756 particular property is still in effect. 758 Values of the subset of transport properties specified by rdma_nochg 759 is not expected to change during the lifetime of the connection. 761 Generally, a participant will send a RDMA2_CONNPROP message as the 762 first message after a connection is established. Given that fact, 763 the sender should make sure that the message can be received by 764 partners who use the default Receive Buffer Size. The connection's 765 initial receive buffer size is typically 1KB, but it depends on the 766 initial connection state of the RPC-over-RDMA version in use. 768 Properties not included in rdma_start are to be treated by the peer 769 endpoint as having the default value and are not allowed to change 770 subsequently. The peer should not request changes in such 771 properties. 773 Those receiving an RDMA2_CONNPROP may encounter properties that they 774 do not support or are unaware of. In such cases, these properties 775 are simply ignored without any error response being generated. 777 6.3.2. RDMA2_REQPROP: Request Modification of Properties 779 The RDMA2_REQPROP message type allows an RPC-over-RDMA participant, 780 whether client or server, to request of its partner that relevant 781 transport properties be changed. 783 The rdma_xid field allows the request to be tied to a corresponding 784 response of type RDMA2_RESPROP (See Section 6.3.3.) In assigning the 785 value of this field, the sender does not need to avoid conflict with 786 xid's associated with RPC messages or with RDMA2_REQPROP messages 787 sent by the peer endpoint. 789 The partner need not change the properties as requested by the sender 790 but if it does support the message type, it will generate a 791 RDMA2_RESPROP message, indicating the disposition of the request. 793 The message definition for this operation is as follows: 795 797 struct rpcrdma2_reqprop { 798 rpcrdma2_propset rdma_want; 799 }; 801 803 The rpcrdma2_propset rdma_want is a set of transport properties 804 together with the desired values requested by the sender. 806 6.3.3. RDMA2_RESPROP: Respond to Request to Modify Transport Properties 808 The RDMA2_RESPROP message type allows an RPC-over-RDMA participant to 809 respond to a request to change properties by its partner, indicating 810 how the request was dealt with. 812 The message definition for this operation is as follows: 814 816 struct rpcrdma2_resprop { 817 rpcrdma2_propsubset rdma_done; 818 rpcrdma2_propsubset rdma_rejected; 819 rpcrdma2_propset rdma_other; 820 }; 822 824 The rdma_xid field of this message must match that used in the 825 RDMA2_REQPROP message to which this message is responding. 827 The rdma_done field indicates which of the requested transport 828 property changes have been effected as requested. For each such 829 property, the receiver is entitled to conclude that the requested 830 change has been made and that future transmissions may be made based 831 on the new value. 833 The rdma_rejected field indicates which of the requested transport 834 property changes have been rejected by the sender. This may be 835 because of any of the following reasons: 837 o The particular property specified is not known or supported by the 838 receiver of the RDMA2_REQPROP message. 840 o The implementation receiving the RDMA2_REQPROP message does not 841 support modification of this property. 843 o The implementation receiving the RDMA2_REQPROP message has chosen 844 to reject the modification for another reason. 846 The rdma_other field contains new values for properties where a 847 change is requested. The new value of the property is included and 848 may be a value different from the original value in effect when the 849 change was requested and from the requested value. This is useful 850 when the new value of some property is not as large as requested but 851 still different from the original value, indicating a partial 852 satisfaction of the peer's property change request. 854 The sender MUST NOT include rpcrdma2_propval items within rdma_other 855 that are for properties other than the ones for which the 856 corresponding property request has requested a change. If the 857 receiver finds such a situation, it MUST ignore the erroneous 858 rpcrdma2_propval items. 860 The subsets of properties specified by rdma_done, rdma_rejected, and 861 included in rdma_other MUST NOT overlap, and when ored together, 862 should cover the entire set of properties specified by rdma_want in 863 the corresponding request. If the receiver finds such an overlap or 864 mismatch, it SHOULD treat properties missing or within the overlap as 865 having been rejected. 867 6.3.4. RDMA2_UPDPROP: Update Transport Properties 869 The RDMA2_UPDPROP message type allows an RPC-over-RDMA participant to 870 notify the other participant that a change to the transport 871 properties has occurred. This is because the sender has decided, 872 independently, to modify one or more transport properties and is 873 notifying the receiver of these changes. 875 The message definition for this operation is as follows: 877 879 struct rpcrdma2_updprop { 880 rpcrdma2_propset rdma_now; 881 }; 883 885 rdma_now defines the new property values to be used. 887 6.4. Extensibility 889 6.4.1. Additional Properties 891 The set of transport properties is designed to be extensible. As a 892 result, once new properties are defined in standards track documents, 893 the operations defined in this document may reference these new 894 transport properties, as well as the ones described in this document. 896 A standards track document defining a new transport property should 897 include the following information paralleling that provided in this 898 document for the transport properties defined herein. 900 o The rpcrdma2_propid value used to identify this property. 902 o The XDR typedef specifying the form in which the property value is 903 communicated. 905 o A description of the transport property that is communicated by 906 the sender of RDMA2_CONNPROP and RDMA2_UPDPROP and requested by 907 the sender of RDMA2_REQPROP. 909 o An explanation of how this knowledge could be used by the 910 participant receiving this information. 912 o Information giving rules governing possible changes of values of 913 this property. 915 The definition of transport property structures is such as to make it 916 easy to assign unique values. There is no requirement that a 917 continuous set of values be used and implementations should not rely 918 on all such values being small integers. A unique value should be 919 selected when the defining document is first published as an internet 920 draft. When the document becomes a standards track document working 921 group should insure that: 923 o rpcrdma2_propid values specified in the document do not conflict 924 with those currently assigned or in use by other pending working 925 group documents defining transport properties. 927 o rpcrdma2_propid values specified in the document do not conflict 928 with the range reserved for experimental use, as defined in 929 Section 6.4.2. 931 Documents defining new properties fall into a number of categories. 933 o Those defining new properties and explaining (only) how they 934 affect use of existing message types. 936 o Those defining new OPTIONAL message types and new properties 937 applicable to the operation of those new message types. 939 o Those defining new OPTIONAL message types and new properties 940 applicable both to new and existing message types. 942 When additional transport properties are proposed, the review of the 943 associated standards track document should deal with possible 944 security issues raised by those new transport properties. 946 6.4.2. Experimental Properties 948 Given the design of the transport properties data structure, it 949 possible to use the operations to implement experimental, possibly 950 unpublished, transport properties. 952 rpcrdma2_propid values in the range from 4,294,967,040 to 953 4,294,967,295 are reserved for experimental use and these values 954 should not be assigned to new properties in standards track 955 documents. 957 When values in this range are used there is no guarantee if 958 successful interoperation among independent implementations. 960 7. XDR Protocol Definition 962 This section contains a description of the core features of the RPC- 963 over-RDMA version 2 protocol, expressed in the XDR language 964 [RFC4506]. 966 This description is provided in a way that makes it simple to extract 967 into ready-to-compile form. The reader can apply the following shell 968 script to this document to produce a machine-readable XDR description 969 of the RPC-over-RDMA version 1 protocol without any OPTIONAL 970 extensions. 972 974 #!/bin/sh 975 grep '^ *///' | sed 's?^ /// ??' | sed 's?^ *///$??' 977 979 That is, if the above script is stored in a file called "extract.sh" 980 and this document is in a file called "spec.txt" then the reader can 981 do the following to extract an XDR description file: 983 985 sh extract.sh < spec.txt > rpcrdma_corev2.x 987 989 Optional extensions to RPC-over-RDMA version 2, published as 990 Standards Track documents, will have similar means of providing XDR 991 that describes those extensions. Once XDR for all desired extensions 992 is also extracted, it can be appended to the XDR description file 993 extracted from this document to produce a consolidated XDR 994 description file reflecting all extensions selected for an RPC-over- 995 RDMA implementation. 997 7.1. Code Component License 999 Code components extracted from this document must include the 1000 following license text. When the extracted XDR code is combined with 1001 other complementary XDR code which itself has an identical license, 1002 only a single copy of the license text need be preserved. 1004 1006 /// /* 1007 /// * Copyright (c) 2010-2017 IETF Trust and the persons 1008 /// * identified as authors of the code. All rights reserved. 1009 /// * 1010 /// * The authors of the code are: 1011 /// * B. Callaghan, T. Talpey, C. Lever, and D. Noveck. 1012 /// * 1013 /// * Redistribution and use in source and binary forms, with 1014 /// * or without modification, are permitted provided that the 1015 /// * following conditions are met: 1016 /// * 1017 /// * - Redistributions of source code must retain the above 1018 /// * copyright notice, this list of conditions and the 1019 /// * following disclaimer. 1020 /// * 1021 /// * - Redistributions in binary form must reproduce the above 1022 /// * copyright notice, this list of conditions and the 1023 /// * following disclaimer in the documentation and/or other 1024 /// * materials provided with the distribution. 1025 /// * 1026 /// * - Neither the name of Internet Society, IETF or IETF 1027 /// * Trust, nor the names of specific contributors, may be 1028 /// * used to endorse or promote products derived from this 1029 /// * software without specific prior written permission. 1030 /// * 1031 /// * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 1032 /// * AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 1033 /// * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1034 /// * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 1035 /// * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 1036 /// * EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 1037 /// * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 1038 /// * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 1039 /// * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 1040 /// * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 1041 /// * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 1042 /// * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 1043 /// * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 1044 /// * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 1045 /// * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 1046 /// */ 1048 1050 7.2. RPC-Over-RDMA Version 2 XDR 1052 The XDR defined in this section is used to encode the Transport 1053 Header Stream in each RPC-over-RDMA Version Two message. The terms 1054 "Transport Header Stream" and "RPC Payload Stream" are defined in 1055 Section 4 of [RFC8166]. 1057 1059 /// /* From RFC 5531, Section 9 */ 1060 /// enum msg_type { 1061 /// CALL = 0, 1062 /// REPLY = 1 1063 /// }; 1064 /// 1065 /// struct rpcrdma2_segment { 1066 /// uint32 rdma_handle; 1067 /// uint32 rdma_length; 1068 /// uint64 rdma_offset; 1069 /// }; 1070 /// 1071 /// struct rpcrdma2_read_segment { 1072 /// uint32 rdma_position; 1073 /// struct rpcrdma2_segment rdma_target; 1074 /// }; 1075 /// 1076 /// struct rpcrdma2_read_list { 1077 /// struct rpcrdma2_read_segment rdma_entry; 1078 /// struct rpcrdma2_read_list *rdma_next; 1079 /// }; 1080 /// 1081 /// struct rpcrdma2_write_chunk { 1082 /// struct rpcrdma2_segment rdma_target<>; 1083 /// }; 1084 /// 1085 /// struct rpcrdma2_write_list { 1086 /// struct rpcrdma2_write_chunk rdma_entry; 1087 /// struct rpcrdma2_write_list *rdma_next; 1088 /// }; 1089 /// 1090 /// struct rpcrdma2_chunk_lists { 1091 /// enum msg_type rdma_direction; 1092 /// uint32 rdma_inv_handle; 1093 /// struct rpcrdma2_read_list *rdma_reads; 1094 /// struct rpcrdma2_write_list *rdma_writes; 1095 /// struct rpcrdma2_write_chunk *rdma_reply; 1096 /// }; 1097 /// 1098 /// enum rpcrdma2_errcode { 1099 /// RDMA2_ERR_VERS = 1, 1100 /// RDMA2_ERR_BAD_XDR = 2, 1101 /// RDMA2_ERR_INVAL_PROC = 3, 1102 /// RDMA2_ERR_READ_CHUNKS = 4, 1103 /// RDMA2_ERR_WRITE_CHUNKS = 5, 1104 /// RDMA2_ERR_SEGMENTS = 6, 1105 /// RDMA2_ERR_WRITE_RESOURCE = 7, 1106 /// RDMA2_ERR_REPLY_RESOURCE = 8, 1107 /// RDMA2_ERR_INVAL_OPTION = 9, 1108 /// RDMA2_ERR_SYSTEM = 10, 1109 /// }; 1110 /// 1111 /// struct rpcrdma2_err_vers { 1112 /// uint32 rdma_vers_low; 1113 /// uint32 rdma_vers_high; 1114 /// }; 1115 /// 1116 /// struct rpcrdma2_err_write { 1117 /// uint32 rdma_chunk_index; 1118 /// uint32 rdma_length_needed; 1119 /// }; 1120 /// 1121 /// union rpcrdma2_error switch (rpcrdma2_errcode rdma_err) { 1122 /// case RDMA2_ERR_VERS: 1123 /// rpcrdma2_err_vers rdma_vrange; 1124 /// case RDMA2_ERR_BAD_XDR: 1125 /// void; 1126 /// case RDMA2_ERR_INVAL_PROC: 1127 /// void; 1128 /// case RDMA2_ERR_READ_CHUNKS: 1129 /// uint32 rdma_max_chunks; 1130 /// case RDMA2_ERR_WRITE_CHUNKS: 1131 /// uint32 rdma_max_chunks; 1132 /// case RDMA2_ERR_SEGMENTS: 1133 /// uint32 rdma_max_segments; 1134 /// case RDMA2_ERR_WRITE_RESOURCE: 1135 /// rpcrdma2_err_write rdma_writeres; 1136 /// case RDMA2_ERR_REPLY_RESOURCE: 1137 /// uint32 rdma_length_needed; 1138 /// case RDMA2_ERR_INVAL_OPTION: 1139 /// void; 1140 /// case RDMA2_ERR_SYSTEM: 1141 /// void; 1142 /// }; 1143 /// 1144 /// struct rpcrdma2_optional { 1145 /// enum msg_type rdma_optdir; 1146 /// uint32 rdma_opttype; 1147 /// opaque rdma_optinfo<>; 1148 /// }; 1149 /// 1150 /// typedef rpcrdma2_propid uint32; 1151 /// 1152 /// struct rpcrdma2_propval { 1153 /// rpcrdma2_propid rdma_which; 1154 /// opaque rdma_data<>; 1155 /// }; 1156 /// 1157 /// typedef rpcrdma2_propval rpcrdma2_propset<>; 1158 /// typedef uint32 rpcrdma2_propsubset<>; 1159 /// 1160 /// struct rpcrdma2_connprop { 1161 /// rpcrdma2_propset rdma_start; 1162 /// rpcrdma2_propsubset rdma_nochg; 1163 /// }; 1164 /// 1165 /// struct rpcrdma2_reqprop { 1166 /// rpcrdma2_propset rdma_want; 1167 /// }; 1168 /// 1169 /// struct rpcrdma2_resprop { 1170 /// rpcrdma2_propsubset rdma_done; 1171 /// rpcrdma2_propsubset rdma_rejected; 1172 /// rpcrdma2_propset rdma_other; 1173 /// }; 1174 /// 1175 /// struct rpcrdma2_updprop { 1176 /// rpcrdma2_propset rdma_now; 1177 /// }; 1179 /// enum rpcrdma2_proc { 1180 /// RDMA2_MSG = 0, 1181 /// RDMA2_NOMSG = 1, 1182 /// RDMA2_ERROR = 4, 1183 /// RDMA2_OPTIONAL = 5, 1184 /// RDMA2_CONNPROP = 6, 1185 /// RDMA2_REQPROP = 7, 1186 /// RDMA2_RESPROP = 8, 1187 /// RDMA2_UPDPROP = 9 1188 /// }; 1189 /// 1190 /// union rpcrdma2_body switch (rpcrdma2_proc rdma_proc) { 1191 /// case RDMA2_MSG: 1192 /// rpcrdma2_chunk_lists rdma_chunks; 1193 /// case RDMA2_NOMSG: 1194 /// rpcrdma2_chunk_lists rdma_chunks; 1195 /// case RDMA2_ERROR: 1196 /// rpcrdma2_error rdma_error; 1197 /// case RDMA2_OPTIONAL: 1198 /// rpcrdma2_optional rdma_optional; 1199 /// case RDMA2_CONNPROP: 1200 /// rpcrdma2_connprop rdma_connprop; 1201 /// case RDMA2_REQPROP: 1202 /// rpcrdma2_reqprop rdma_reqprop; 1203 /// case RDMA2_RESPROP: 1204 /// rpcrdma2_resprop rdma_resprop; 1205 /// case RDMA2_UPDPROP: 1206 /// rpcrdma2_updprop rdma_updprop; 1207 /// }; 1208 /// 1209 /// struct rpcrdma2_xprt_hdr { 1210 /// uint32 rdma_xid; 1211 /// uint32 rdma_vers; 1212 /// uint32 rdma_credit; 1213 /// rpcrdma2_body rdma_body; 1214 /// }; 1215 /// 1216 /// /* 1217 /// * Transport propid values for basic properties 1218 /// */ 1219 /// const uint32 RDMA2_PROPID_RBSIZ = 1; 1220 /// const uint32 RDMA2_PROPID_BRS = 2; 1221 /// 1222 /// /* 1223 /// * Transport property typedefs 1224 /// */ 1225 /// typedef uint32 rpcrdma2_prop_rbsiz; 1226 /// typedef rpcrdma2_bkreqsup rpcrdma2_prop_brs; 1227 /// 1228 /// enum rpcrdma2_bkreqsup { 1229 /// RDMA2_BKREQSUP_NONE = 0, 1230 /// RDMA2_BKREQSUP_INLINE = 1, 1231 /// RDMA2_BKREQSUP_GENL = 2 1232 /// }; 1234 1236 7.2.1. Presence Of Payload 1238 o When the rdma_proc field has the value RDMA2_MSG, an RPC Payload 1239 Stream MUST follow the Transport Header Stream in the Send buffer. 1241 o When the rdma_proc field has the value RDMA2_ERROR, an RPC Payload 1242 Stream MUST NOT follow the Transport Header Stream. 1244 o When the rdma_proc field has the value RDMA2_OPTIONAL, all, part 1245 of, or no RPC Payload Stream MAY follow the Transport header 1246 Stream in the Send buffer. 1248 7.2.2. Message Direction 1250 Implementations of RPC-over-RDMA version 2 are REQUIRED to support 1251 backwards direction operation as described in [RFC8167]. RPC-over- 1252 RDMA version 2 introduces the rdma_direction field in its transport 1253 header to optimize the process of distinguishing between forward- and 1254 backwards-direction messages. 1256 The rdma_direction field qualifies the value contained in the 1257 transport header's rdma_xid field. This enables a receiver to 1258 reliably avoid performing an XID lookup on incoming backwards- 1259 direction Call messages. 1261 In general, when a message carries an XID that was generated by the 1262 message's receiver (that is, the receiver is acting as a requester), 1263 the message's sender sets the rdma_direction field to REPLY (1). 1264 Otherwise the rdma_direction field is set to CALL (0). For example: 1266 o When the rdma_proc field has the value RDMA2_MSG or RDMA2_NOMSG, 1267 the value of the rdma_direction field MUST be the same as the 1268 value of the associated RPC message's msg_type field. 1270 o When the rdma_proc field has the value RDMA2_OPTIONAL and a whole 1271 or partial RPC message payload is present, the value of the 1272 rdma_optdir field MUST be the same as the value of the associated 1273 RPC message's msg_type field. 1275 o When the rdma_proc field has the value RDMA2_OPTIONAL and no RPC 1276 message payload is present, a Requester MUST set the value of the 1277 rdma_optdir field to CALL, and a Responder MUST set the value of 1278 the rdma_optdir field to REPLY. The Requester chooses a value for 1279 the rdma_xid field from the XID space that matches the message's 1280 direction. Requesters and Responders set the rdma_credit field in 1281 a similar fashion: a value is set that is appropriate for the 1282 direction of the message. 1284 o When the rdma_proc field has the value RDMA2_ERROR, the direction 1285 of the message is always Responder-to-Requester (REPLY). 1287 7.2.3. Remote Invalidation 1289 To request Remote Invalidation, a requester MUST set the value of the 1290 rdma_inv_handle field in an RPC Call's transport header to a non-zero 1291 value that matches one of the rdma_handle fields in that header. If 1292 none of the rdma_handle values in the Call may be invalidated by the 1293 responder, the requester MUST set the RPC Call's rdma_inv_handle 1294 field to the value zero. 1296 If the responder chooses not to use Remote Invalidation for this 1297 particular RPC Reply, or the RPC Call's rdma_inv_handle field 1298 contains the value zero, the responder MUST use RDMA Send to transmit 1299 the matching RPC reply. 1301 If a requester has provided a non-zero value in the RPC Call's 1302 rdma_inv_handle field and the responder chooses to use Remote 1303 Invalidation for the matching RPC Reply, the responder MUST use RDMA 1304 Send With Invalidate to transmit that RPC reply, and MUST use the 1305 value in the RPC Call's rdma_inv_handle field to construct the Send 1306 With Invalidate Work Request. 1308 7.2.4. Transport Errors 1310 Error handling works the same way in RPC-over-RDMA version 2 as it 1311 does in RPC-over-RDMA version 1, with the addition of several new 1312 error codes, and error messages never flow from requester to 1313 responder. version 1 error handling is described in Section 5 of 1314 [RFC8166]. 1316 In all cases below, the responder copies the values of the rdma_xid 1317 and rdma_vers fields from the incoming transport header that 1318 generated the error to transport header of the error response. The 1319 responder sets the rdma_proc field to RDMA2_ERROR, and the 1320 rdma_credit field is set to the credit grant value for this 1321 connection. 1323 RDMA2_ERR_VERS 1324 This is the equivalent of ERR_VERS in RPC-over-RDMA version 1. 1325 The error code value, semantics, and utilization are the same. 1327 RDMA2_ERR_INVAL_PROC 1328 If a responder recognizes the value in the rdma_vers field, but it 1329 does not recognize the value in the rdma_proc field, it MUST set 1330 the rdma_err field to RDMA2_ERR_INVAL_PROC. 1332 RDMA2_ERR_BAD_XDR 1333 If a responder recognizes the values in the rdma_vers and 1334 rdma_proc fields, but the incoming RPC-over-RDMA transport header 1335 cannot be parsed, it MUST set the rdma_err field to 1336 RDMA2_ERR_BAD_XDR. The error code value of RDMA2_ERR_BAD_XDR is 1337 the same as the error code value of ERR_CHUNK in RPC-over-RDMA 1338 version 1. The responder MUST NOT process the request in any way 1339 except to send an error message. 1341 RDMA2_ERR_READ_CHUNKS 1342 If a requester presents more DDP-eligible arguments than the 1343 responder is prepared to Read, the responder MUST set the rdma_err 1344 field to RDMA2_ERR_READ_CHUNKS, and set the rdma_max_chunks field 1345 to the maximum number of Read chunks the responder can receive and 1346 process. 1347 If the responder implementation cannot handle any Read chunks for 1348 a request, it MUST set the rdma_max_chunks to zero in this 1349 response. The requester SHOULD resend the request using a 1350 Position-Zero Read chunk. If this was a request using a Position- 1351 Zero Read chunk, the requester MUST terminate the transaction with 1352 an error. 1354 RDMA2_ERR_WRITE_CHUNKS 1355 If a requester has constructed an RPC Call message with more DDP- 1356 eligible results than the server is prepared to Write, the 1357 responder MUST set the rdma_err field to RDMA2_ERR_WRITE_CHUNKS, 1358 and set the rdma_max_chunks field to the maximum number of Write 1359 chunks the responder can process and return. 1360 If the responder implementation cannot handle any Write chunks for 1361 a request, it MUST return a response of RDMA2_ERR_REPLY_RESOURCE 1362 (below). The requester SHOULD resend the request with no Write 1363 chunks and a Reply chunk of appropriate size. 1365 RDMA2_ERR_SEGMENTS 1366 If a requester has constructed an RPC Call message with a chunk 1367 that contains more segments than the responder supports, the 1368 responder MUST set the rdma_err field to RDMA2_ERR_SEGMENTS, and 1369 set the rdma_max_segments field to the maximum number of segments 1370 the responder can process. 1372 RDMA2_ERR_WRITE_RESOURCE 1373 If a requester has provided a Write chunk that is not large enough 1374 to convey a DDP-eligible result, the responder MUST set the 1375 rdma_err field to RDMA2_ERR_WRITE_RESOURCE. 1377 The responder MUST set the rdma_chunk_index field to point to the 1378 first Write chunk in the transport header that is too short, or to 1379 zero to indicate that it was not possible to determine which chunk 1380 is too small. Indexing starts at one (1), which represents the 1381 first Write chunk. The responder MUST set the rdma_length_needed 1382 to the number of bytes needed in that chunk in order to convey the 1383 result data item. 1385 Upon receipt of this error code, a responder MAY choose to 1386 terminate the operation (for instance, if the responder set the 1387 index and length fields to zero), or it MAY send the request again 1388 using the same XID and more reply resources. 1390 RDMA2_ERR_REPLY_RESOURCE 1391 If an RPC Reply's Payload stream does not fit inline and the 1392 requester has not provided a large enough Reply chunk to convey 1393 the stream, the responder MUST set the rdma_err field to 1394 RDMA2_ERR_REPLY_RESOURCE. The responder MUST set the 1395 rdma_length_needed to the number of Reply chunk bytes needed to 1396 convey the reply. 1398 Upon receipt of this error code, a responder MAY choose to 1399 terminate the operation (for instance, if the responder set the 1400 index and length fields to zero), or it MAY send the request again 1401 using the same XID and larger reply resources. 1403 RDMA2_ERR_INVAL_OPTION 1404 A responder MUST set the rdma_err field to RDMA2_ERR_INVAL_OPTION 1405 when an RDMA2_OPTIONAL message is received and the responder does 1406 not recognize the value in the rdma_opttype field. 1408 RDMA2_ERR_SYSTEM 1409 If some problem occurs on a responder that does not fit into the 1410 above categories, the responder MAY report it to the sender by 1411 setting the rdma_err field to RDMA2_ERR_SYSTEM. 1413 This is a permanent error: a requester that receives this error 1414 MUST terminate the RPC transaction associated with the XID value 1415 in the rdma_xid field. 1417 8. Protocol Version Negotiation 1419 When an RPC-over-RDMA version 2 client establishes a connection to a 1420 server, the first order of business is to determine the server's 1421 highest supported protocol version. 1423 As with RPC-over-RDMA version 1, a client MUST assume the ability to 1424 exchange only a single RPC-over-RDMA message at a time until it 1425 receives a valid non-error RPC-over-RDMA message from the server that 1426 reports the server's credit limit. 1428 First, the client sends a single valid RPC-over-RDMA message with the 1429 value two (2) in the rdma_vers field. Because the server might 1430 support only RPC-over-RDMA version 1, this initial message can be no 1431 larger than the version 1 default inline threshold of 1024 bytes. 1433 8.1. Server Does Support RPC-over-RDMA Version 2 1435 If the server does support RPC-over-RDMA version 2, it sends RPC- 1436 over-RDMA messages back to the client with the value two (2) in the 1437 rdma_vers field. Both peers may use the default inline threshold 1438 value for RPC-over-RDMA version 2 connections (4096 bytes). 1440 8.2. Server Does Not Support RPC-over-RDMA Version 2 1442 If the server does not support RPC-over-RDMA version 2, it MUST send 1443 an RPC-over-RDMA message to the client with the same XID, with 1444 RDMA2_ERROR in the rdma_proc field, and with the error code 1445 RDMA2_ERR_VERS. This message also reports a range of protocol 1446 versions that the server supports. To continue operation, the client 1447 selects a protocol version in the range of server-supported versions 1448 for subsequent messages on this connection. 1450 If the connection is lost immediately after an RDMA2_ERROR / 1451 RDMA2_ERR_VERS message is received, a client can avoid a possible 1452 version negotiation loop when re-establishing another connection by 1453 assuming that particular server does not support RPC-over-RDMA 1454 version 2. A client can assume the same situation (no server support 1455 for RPC-over-RDMA version 2) if the initial negotiation message is 1456 lost or dropped. Once the negotiation exchange is complete, both 1457 peers may use the default inline threshold value for the transport 1458 protocol version that has been selected. 1460 8.3. Client Does Not Support RPC-over-RDMA Version 2 1462 If the server supports the RPC-over-RDMA protocol version used in 1463 Call messages from a client, it MUST send Replies with the same RPC- 1464 over-RDMA protocol version that the client uses to send its Calls. 1466 8.4. Security Considerations 1468 The security considerations for RPC-over-RDMA version 2 are the same 1469 as those for RPC-over-RDMA version 1. 1471 8.4.1. Security Considerations (Transport Properties) 1473 Like other fields that appear in each RPC-over-RDMA header, property 1474 information is sent in the clear on the fabric with no integrity 1475 protection, making it vulnerable to man-in-the-middle attacks. 1477 For example, if a man-in-the-middle were to change the value of the 1478 Receive buffer size or the Requester Remote Invalidation boolean, it 1479 could reduce connection performance or trigger loss of connection. 1480 Repeated connection loss can impact performance or even prevent a new 1481 connection from being established. Recourse is to deploy on a 1482 private network or use link-layer encryption. 1484 9. IANA Considerations 1486 This document does not require actions by IANA. 1488 10. References 1490 10.1. Normative References 1492 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1493 Requirement Levels", BCP 14, RFC 2119, 1494 DOI 10.17487/RFC2119, March 1997, 1495 . 1497 [RFC4506] Eisler, M., Ed., "XDR: External Data Representation 1498 Standard", STD 67, RFC 4506, DOI 10.17487/RFC4506, May 1499 2006, . 1501 [RFC5531] Thurlow, R., "RPC: Remote Procedure Call Protocol 1502 Specification Version 2", RFC 5531, DOI 10.17487/RFC5531, 1503 May 2009, . 1505 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1506 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1507 May 2017, . 1509 10.2. Informative References 1511 [IBARCH] InfiniBand Trade Association, "InfiniBand Architecture 1512 Specification Volume 1", Release 1.3, March 2015, 1513 . 1516 [RFC5040] Recio, R., Metzler, B., Culley, P., Hilland, J., and D. 1517 Garcia, "A Remote Direct Memory Access Protocol 1518 Specification", RFC 5040, DOI 10.17487/RFC5040, October 1519 2007, . 1521 [RFC5041] Shah, H., Pinkerton, J., Recio, R., and P. Culley, "Direct 1522 Data Placement over Reliable Transports", RFC 5041, 1523 DOI 10.17487/RFC5041, October 2007, 1524 . 1526 [RFC5661] Shepler, S., Ed., Eisler, M., Ed., and D. Noveck, Ed., 1527 "Network File System (NFS) Version 4 Minor Version 1 1528 Protocol", RFC 5661, DOI 10.17487/RFC5661, January 2010, 1529 . 1531 [RFC5662] Shepler, S., Ed., Eisler, M., Ed., and D. Noveck, Ed., 1532 "Network File System (NFS) Version 4 Minor Version 1 1533 External Data Representation Standard (XDR) Description", 1534 RFC 5662, DOI 10.17487/RFC5662, January 2010, 1535 . 1537 [RFC5666] Talpey, T. and B. Callaghan, "Remote Direct Memory Access 1538 Transport for Remote Procedure Call", RFC 5666, 1539 DOI 10.17487/RFC5666, January 2010, 1540 . 1542 [RFC8166] Lever, C., Ed., Simpson, W., and T. Talpey, "Remote Direct 1543 Memory Access Transport for Remote Procedure Call Version 1544 1", RFC 8166, DOI 10.17487/RFC8166, June 2017, 1545 . 1547 [RFC8167] Lever, C., "Bidirectional Remote Procedure Call on RPC- 1548 over-RDMA Transports", RFC 8167, DOI 10.17487/RFC8167, 1549 June 2017, . 1551 Acknowledgments 1553 The authors gratefully acknowledge the work of Brent Callaghan and 1554 Tom Talpey on the original RPC-over-RDMA version 1 specification 1555 [RFC5666]. The authors also wish to thank Bill Baker, Greg Marsden, 1556 and Matt Benjamin for their support of this work. 1558 The extract.sh shell script and formatting conventions were first 1559 described by the authors of the NFS version 4.1 XDR specification 1560 [RFC5662]. 1562 Special thanks go to Transport Area Director Spencer Dawkins, NFSV4 1563 Working Group Chair and Document Shepherd Spencer Shepler, and NFSV4 1564 Working Group Secretary Thomas Haynes for their support. 1566 Authors' Addresses 1567 Charles Lever (editor) 1568 Oracle Corporation 1569 1015 Granger Avenue 1570 Ann Arbor, MI 48104 1571 United States of America 1573 Phone: +1 248 816 6463 1574 Email: chuck.lever@oracle.com 1576 David Noveck 1577 NetApp 1578 1601 Trapelo Road 1579 Waltham, MA 02451 1580 United States of America 1582 Phone: +1 781 572 8038 1583 Email: davenoveck@gmail.com