Connection management in network adapters
By distributing work requests from multi-channel send queue to send queue in the network adapter, the problem of high CPU cycle and bandwidth consumption when the software manages multiple SQs is solved, achieving efficient multi-channel connection management and improving communication efficiency.
Patent Information
- Application Number
- CN202210006125.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-05
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2042-01-05
AI Technical Summary
In data centers and high-performance computing applications, software programs that manage multiple send queues (SQs) consume a large amount of CPU cycles and bandwidth, resulting in poor CPU cache performance and difficulty in effectively offloading the burden of multi-channel connection management.
By implementing a distribution mechanism between Multichannel Send Queue (MCSQ) and Send Queue (SQ) in the network adapter, the network adapter retrieves work requests (WR) from MCSQ and distributes them to the SQ of the relevant target, leveraging reliable connections (RC) and Dynamic Connection (DC) protocols manage connections, reducing the software's management burden on the host.
It effectively offloads the burden of multi-channel connection management from the host software, frees up CPU cycles, reduces storage space requirements, improves CPU cache performance, and improves communication efficiency.
Smart Images

Figure CN114726929B_ABST
Abstract
Description
Technical Field
[0001] Implementations described herein relate generally to data communications, and more particularly to methods and systems for connection management in network adapters. Background Art
[0002] InfiniBand TM (IB) is a switched fabric communication architecture, primarily used for high performance computing. It has been standardized by the Wireless Bandwidth Trade Association. Computing devices (host processors and peripheral devices) are connected to the IB fabric via network adapters, such as network interface controllers (NICs). IB defines both layered hardware protocols (physical layer, link layer, network layer, and transport layer) and software layers that manage initialization and communication between devices. The transport layer is responsible for ordered packet delivery, partitioning, channel multiplexing, and transport services, as well as data segmentation when sending and reassembly when receiving.
[0003] Methods for delivering service communications using reliable connections (RC) and dynamic connections (DC) are known in the art. For example, U.S. Pat. No. 8,213,315 describes a communication method, the communication method comprising receiving a first request and a second request from an initiator process running on an initiator host in a network interface device to transmit first data and a second data to a first target process and a second target process running on one or more target nodes via a packet network, respectively. An initiator context of a single dynamic connection is allocated to serve both the first request and the second request. A first connection packet referencing a dynamic connection (DC) initiator context points to a first target process so as to open a first dynamic connection with the first target process, and then transmits the first data on the first dynamic connection. After transmitting the first data, the first dynamic connection is closed, and a second connection packet is transmitted so as to open a second dynamic connection with the second target process, and then transmit the second data.
[0004] U.S. Patent 8,761,189 describes a method for communication, the method comprising allocating a single dynamically connected (DC) initiator context in a network interface controller (NIC) for servicing a request from an initiator process running on an initiator host to transfer data to a plurality of target processes running on one or more target nodes. The NIC transmits a first connection packet directed to a first target process and referencing the DC initiator context to open a first dynamic connection with the first target process. In response to the first connection packet, the NIC receives a first confirmation packet containing a first session identifier (ID) on a packet network. After receiving the first confirmation packet, the NIC transmits one or more first data packets containing the first session ID from the NIC to the first target process on the first dynamic connection. Dynamic connections with other target processes may subsequently be processed in a similar manner. Summary of the invention
[0005] Embodiments described herein provide a network adapter, which includes a network interface, a host interface, and a processing circuit. The network interface is configured to connect to a communication network for communicating with a remote target. The host interface is configured to connect to a host, the host accesses a multi-channel send queue (MCSQ), and the multi-channel send queue (MCSQ) stores work requests (WR) originating from client processes running on the host. The processing circuit is configured to retrieve the WR from the MCSQ and distribute the retrieved WR in a plurality of send queues (SQ) accessible by the processing circuit.
[0006] In some embodiments, each of the targets comprises: (i) a remote node coupled to a communication network; or (ii) a local device coupled to a host. In other embodiments, the WR comprises a respective identifier associated with a respective SQ, and the processing circuit is configured to distribute the WR between the SQs based on the identifier. In other embodiments, the processing circuit is configured to, in response to detecting that the identifier in the retrieved WR has no associated SQ in the SQ, select an available SQ from the plurality of SQs, associate the identifier with the available SQ, and publish the WR on the available SQ.
[0007] In an embodiment, the processing circuit is configured to publish the WR on the selected SQ in response to detecting that the identifier in the given WR is associated with the selected SQ. In another embodiment, the processing circuit is configured to operate the SQ according to a reliable connection (RC) protocol in which the SQ is assigned to be persistently connected to a corresponding target. In yet another embodiment, the processing circuit is configured to operate the SQ according to a dynamic connection (DC) protocol that allows a given SQ to connect to different targets at different times.
[0008] In some embodiments, the host issues WRs on first and second MCSQs associated with first and second SQ pools, respectively, and the processing circuit is configured to distribute WRs from the first MCSQ to SQs in the first pool and distribute WRs from the second MCSQ to SQs in the second pool. In other embodiments, at least one SQ is shared between the first and second pools, and the processing circuit is configured to issue WRs from both the first and second MCSQs to at least one SQ. In other embodiments, the processing circuit is configured to issue a completion queue (CQ) indicating the end of execution of a given WR on a completion queue (CQ) accessible by the client process after all completion queue elements (CQEs) corresponding to WRs issued to the MCSQ prior to the given WR are issued on the CQ.
[0009] In an embodiment, the processing circuit is configured to issue CQEs to a CQ independently of the order of corresponding WRs in the MCSQ. In another embodiment, the processing circuit is configured to distribute WRs specifying only a given target to a given SQ that has established a connection with a given target until the connection is terminated. In yet another embodiment, the processing circuit is configured to, in response to detecting a failure in a given SQ, issue a CQE on the CQ indicating the failure.
[0010] In some embodiments, the processing circuit is configured to issue a CQE on the CQ indicating a failure of each WR to be executed in a given SQ. In other embodiments, the processing circuit is configured to issue a CQE on the CQ indicating a failure of each WR from the MCSQ to be distributed to the given SQ. In other embodiments, at least a given WR specifies a corresponding data transfer operation from the host to the target. In still other embodiments, at least a given WR specifies an operation to be performed locally.
[0011] According to the embodiments described herein, a method for communication is further provided, which includes in a network adapter connected to a communication network for communicating with a remote target and also connected to a host, the host accessing an MCSQ storing work requests (WRs) originating from a client process running on the host, retrieving the WRs from the MCSQ and distributing the retrieved WRs to a plurality of send queues (SQs) accessible by the processing circuit. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] These and other embodiments will be more fully understood from the following detailed description of embodiments thereof taken in conjunction with the accompanying drawings, in which:
[0013] Figure 1 is a block diagram schematically illustrating a computing system according to embodiments described herein, wherein a network adapter manages host communications over multiple channels;
[0014] Figure 2 is a diagram schematically illustrating data flow in a network node supporting communication over multiple channels according to embodiments described herein;
[0015] Figure 3 is a flow chart schematically illustrating a method for multi-channel transmission according to an embodiment described herein; and
[0016] Figure 4 is a diagram schematically illustrating data flow in a network node using DC and RC connections to manage communications separately according to embodiments described herein. DETAILED DESCRIPTION
[0017] Overview
[0018] Implementations described herein provide methods and systems for offloading communication management over multiple channels to a network adapter.
[0019] In various applications such as data centers and high performance computing (HPC), hosts run client processes that communicate with a large number of targets. The host typically includes a network adapter for communicating with remote nodes over a packet network. The network adapter typically executes work requests (WRs) posted on one or more work queues that are connected to the targets via a communication network. The work queues used for data transmission are called send queues (SQs), while the work queues used for data reception are called receive queues (RQs). The WR specifies the required data transfer operation, for example, a client process operating on the host. The network adapter notifies the completion of the WR by posting a completion queue element (CQE) on a completion queue (CQ) accessible to the host.
[0020] In principle, the host can use a software program running on the host's central processing unit (CPU) to handle multi-channel communications. Such a software program that manages multiple SQs may include a program or a combination of multiple programs, such as a client process, a communication stack, and a driver that mediates between the host and the network adapter. Such a software program repeatedly checks which WRs have been completed and releases other uncompleted WRs in the desired order. Although the following disclosure is primarily directed to a host implemented using a CPU, the disclosed embodiments are similarly applicable to any other suitable processing unit implemented using a host, such as, for example, a graphics processing unit (GPU).
[0021] Managing multiple SQs in software can be disadvantageous for a variety of reasons. First, software programs may consume CPU cycles when performing tasks, such as balancing workloads among multiple SQs and polling CQs. These CPU cycles can be used to perform non-communication operations, such as computational operations. Software programs also typically consume considerable bandwidth for communications between the host and the network adapter, for example, on an underlying bus (e.g., a Peripheral Component Interconnect Express (PCIe) bus). In addition, managing a large number of SQs in software requires considerable storage space and may result in poor cache performance of the host CPU's cache.
[0022] The following description mainly relates to the transport services and protocols known as Reliable Connections (RC) and Dynamic Connections (DC). Other suitable transport services or protocols, such as the Transmission Control Protocol (TCP), are also applicable.
[0023] In the RC protocol, connections are persistent and occupy the corresponding SQ for a long time. Therefore, the RC protocol is suitable for applications that require low to medium scalability. Unlike the persistent nature of RC, SQs configured according to the DC protocol are used on demand and disconnected when the data transfer operation is completed. Therefore, a given DC SQ can be connected to different targets at different times.
[0024] When performing a WR of a specified data transfer operation, the network adapter usually transmits data in multiple packets, wherein for each transmitted packet, the network adapter receives an acknowledgment (Ack) notification from the target. In the DC protocol, the connection is disconnected only after receiving the Ack of the last packet of the current data transmission, and becomes available for connection to another target. In some embodiments, the network adapter utilizes the time interval between the transmission of the last packet and the disconnection by using other DC SQs to process communications via one or more other connections. As an example, the CPU can apply hash-based scheduling, in which case the WR is published on the DC SQ by applying a suitable static hash function to, for example, the target address specified in the WR. However, hash-based scheduling may cause workload imbalance in the DC SQ. As another example, the CPU may publish a WR associated with a common stream on the same DC SQ. If there is no available DC SQ, the CPU will wait until some DC SQs are released. In this scheme, the software operates in asynchronous progress mode, which puts a burden on the CPU.
[0025] In the disclosed embodiment, the network adapter offloads the host software from the burden of managing multiple channels. To do this, the host software program posts WRs destined for multiple targets on a common multi-channel send queue (MCSQ). The network adapter retrieves the WRs from the MCSQ and distributes them to the SQs connected to the relevant targets. Specifically, when a connection to the target has been set up for the SQ, it will be used. Otherwise, the network adapter allocates a new connection context, uses the context to connect to the remote peer, and sends data to the remote peer over the established connection. The network adapter also posts CQEs to a common CQ accessible to the host software program.
[0026] In some embodiments, instead of storing WR in a queue, the SQ has a small storage space for referencing the WR in the MCSQ, such as a pointer to the WR. Therefore, the SQ handled by the network adapter requires much less storage space than the SQ with a full queue that is usually handled in software.
[0027] Next, we focus on implementations that primarily involve network adapters. Consider a network adapter that includes a network interface, a host interface, and a processing circuit. The network interface is docked to a communication network for communicating with a remote target. The host interface is connected to a host that accesses an MCSQ that stores WRs originating from a client process operating on the host, wherein at least a given WR specifies a corresponding data transfer operation from the host to the target. Alternatively or additionally, at least a given WR specifies an operation performed locally by the network adapter, such as a memory registration operation. The processing circuit retrieves the WR from the MCSQ and distributes the retrieved WR among a plurality of SQs accessible by the processing circuit. In this context, the operation of distributing the WR to the SQ means that information for accessing the WR of the MCSQ is provided for storage in the SQ. The WR whose access information is thus distributed and stored for the SQ is referred to herein as a WR published on the SQ. The processing circuit schedules the execution of the WRs published on a plurality of SQs, and publishes CQEs on a CQ accessible by the client process, wherein each CQE indicates the end execution of one or more WRs.
[0028] Each target with which the host communicates may include: (i) a remote node coupled to the communication network; or (ii) a local device (such as a hardware accelerator) coupled to the host.
[0029] To distribute the WR from the MCSQ to the SQ, the WR includes a corresponding identifier associated with the corresponding SQ, and the processing circuit distributes the WR between the corresponding SQs based on the identifier. The network adapter can retrieve the WR that has not been assigned an SQ from the MCSQ. In this case, the processing circuit selects an available SQ from a plurality of SQs, associates the identifier with the available SQ, and publishes the WR on the available SQ. In response to detecting that the identifier in a given WR has been associated with the selected SQ, the processing circuit publishes the WR on the selected SQ. In some embodiments, the association between the WR and the SQ is based on the target address and the network state.
[0030] In the disclosed embodiments, some transport contexts may use the RC protocol, while other transport contexts may use the DC protocol or the User Datagram Protocol (UDP). The association of a WR with an SQ may be accomplished by selecting a particular type of transport context. Alternatively, the network adapter may select the best available type of transport context at execution time.
[0031] In an embodiment, the host issues WRs on the first MCSQ and the second MCSQ associated with the first SQ pool and the second SQ pool, respectively. In this embodiment, the processing circuit distributes WRs from the first MCSQ to the SQs in the first pool and distributes WRs from the second MCSQ to the SQs in the second pool. The SQ pools may be disjoint, alternatively, at least one SQ is shared between the first SQ pool and the second SQ pool. In this case, the processing circuit sends WRs from both the first MCSQ and the second MCSQ to at least one SQ.
[0032] The network adapter executes WRs issued to the same SQ in the order they were issued, but the execution order of WRs issued on different SQs is generally not guaranteed to match the same order in which WRs were issued to the MCSQ.
[0033] To execute WRs in the same order in which they are issued on the MCSQ, the WRs should be issued on the same SQ. To issue CQEs in the same order in which the corresponding WRs are issued on the MCSQ, the processing circuitry issues the CQE corresponding to a given WR on the CQ after issuing on the CQ all CQEs corresponding to WRs issued to the MCSQ prior to the given WR. Alternatively, where out-of-order execution is allowed, the processing circuitry issues the CQEs on the CQ independently of the order of the corresponding WRs in the MCSQ.
[0034] In some embodiments, between connection establishment and termination, the DC SQ serves WRs specifying a common target. In such embodiments, the processing circuitry distributes only WRs specifying a given target to a given SQ that has established a connection with an RQ of the given target until the connection is terminated.
[0035] A connection using SQ may fail for various reasons, such as delivery retry count exceeded, retry receiver not ready (RNR) negative acknowledgement (NACK) retry count exceeded, remote access error, and remote operation error.
[0036] When a connection fails, the network adapter is unable to execute the WR issued on the corresponding SQ, and therefore does not issue the corresponding CQE on the CQ. This in turn may cause the suspension of retrieving other connections from the MCSQ WR whose destination is to use other SQs. In some embodiments, the network adapter suspends execution of the WR associated with the failed connection, but keeps executing the WR of the active connection. Specifically, in response to detecting a failure in a given SQ, the processing circuit issues a CQE indicating the failure on the CQ. For example, the processing circuit is configured to issue a CQE indicating the failure of each WR to be executed in a given SQ on the CQ. As another example, the processing circuit is configured to issue a CQE on the CQ for each WR from the MCSQ that will be distributed to the given SQ.
[0037] The host software identifies the CQ of the failed connection and takes action accordingly, for example, removing the corresponding WR from the MCSQ. In some embodiments, the host CPU attempts to correct the error, for example, by restarting the session or applying other appropriate corrective actions. After the error is corrected, the host CPU drains the remaining WRs and reissues them starting from the last WR that was successfully executed.
[0038] In the disclosed technology, a network adapter offloads the management of multi-channel connections from the host. Thus, the host issues WRs that specify multiple different targets that may use different transport services on a common MCSQ. The network adapter distributes the WRs among the multiple SQs connected to the targets and issues completion notifications on a common completion queue without involving the host CPU. Using this scheme, CPU cycles that would otherwise be used for communication management can be freed up, for example, for computational tasks. By using a common multi-channel queue (MCSQ work queue), storage space is significantly reduced compared to using a single work queue. In addition, the disclosed embodiments improve CPU cache performance.
[0039] System Description
[0040] Figure 1 is a block diagram schematically illustrating a computing system 20 in which a network adapter manages host communications over multiple channels according to implementations described herein.
[0041] In computing system 20, network node 24 communicates with remote network node 28 via communication network 30. Communication network 30 may include any suitable packet network such as, for example, an Ethernet network or InfiniBand. TM (IB) structure.
[0042] For example, computing system 20 may be used in applications where network nodes exchange large amounts of data with other network nodes, such as, for example, high performance computing, distributed computing, and data centers, to name a few.
[0043] The network node 24 includes a processor in the form of a central processing unit (CPU) 32 and a memory 34, which are interconnected by a suitable bus 36. In the present example, the bus 36 comprises a peripheral component interconnect express (PCIe) bus. Alternatively, other suitable bus types may also be used. The network node 24 also includes a network adapter 38, such as a network interface controller (NIC), for connecting to the communication network 30. For the sake of brevity, the combination of the CPU 32, the memory 34 and the bus 36 (with or without a network adapter) is also referred to as a "host computer" or simply a "host".
[0044] The network adapter 38 includes a network interface 42 coupled to the communication network 30 and a host interface 44 coupled to the CPU 32 and the memory 34 via the bus 36. A processing circuit 46 coupled between the network interface 42 and the host interface 44 generates outgoing packets for transmission on the communication network 30 and processes incoming packets received from the communication network, as described below.
[0045] In the ingress direction, processing circuitry 46 performs various processing on packets received in the network adapter via network interface 42, such as verifying the correctness of the data in the packet payload, packet classification and priority, and routing. For the purpose of packet classification and routing, the processing circuitry typically examines certain fields in the packet header. The header fields contain addressing information, such as source and destination addresses and port numbers, as well as the underlying network protocol used. In the egress direction, processing circuitry 46 retrieves data for transmission from the host via host interface 44, packages the data into a sequence of packets, and transmits the packets to their destination via communication network 30.
[0046] In the disclosed embodiment, the processing circuit 46 communicates via the communication network 30 using a work queue 48. The following description primarily refers to the work queue 48 as a send queue (SQ) for data transmission. Alternatively, for example, in an IB network, the work queue 48 includes a queue pair (QP) that includes a send queue (SQ) and a receive queue (RQ) (not shown). The SQ or the SQ portion of the QP stores work requests (WRs) for specified data transmission operations, while the RQ portion of the QP stores WRs for specified data reception operations. Some WRs may include control WRs, for example, for establishing or terminating a connection. The WRs stored in the WRs are executed by the processing circuit 46.
[0047] In QP terms, issuing a WR for a specified data transfer operation on a QP means that the WR will be issued on the SQ portion of the QP.
[0048] The WR of the data transfer operation may specify, for example, a buffer 52 in memory 34 to be used as a source buffer or a destination buffer, and the amount of data to be transferred. In an embodiment, the data transfer operation may include a remote direct memory access (RDMA) operation that directly accesses memory 34 without involving CPU 32.
[0049] The following description focuses on the egress direction of the host transmitting data to the target, for example, via a network adapter. In the egress direction, the data to be transmitted may reside in the buffer 52.
[0050] In some embodiments, to transfer data, the processing circuit 46 retrieves the WR from the associated SQ and performs the data transfer operation specified in the WR. The processing circuit transfers the data in one or more packets, where the intended recipient acknowledges each packet by sending an Ack notification back to the network adapter. When the data transfer is complete (e.g., when the network adapter receives the Ack for the last packet), the processing circuit posts a completion queue element (CQE) on a completion queue (CQ) 58 in the memory 34. The CQE notifies the host that the execution of the corresponding WR is complete. In some embodiments, a single CQE may indicate the completion of the execution of one or more WRs.
[0051] The multi-channel send queue (MCSQ) 56 receives write requests from multiple processes 50. As will be described below, the WRs will be retrieved and executed by the network adapter 38. Figure 1 A single MCSQ is depicted, but in alternative embodiments, multiple MCSQs may be used.
[0052] In the present example, SQ 48, MCSQ 56, and CQ 58 reside in memory 34 of host 24. However, this is not mandatory. In alternative embodiments, one or more of SQ 48, one or more of MCSQ 56, and / or one or more of CQ 58 may reside in another memory, such as a memory (not shown) of network adapter 38.
[0053] A client process 50 (also referred to simply as “client” for brevity), such as a process generated by application software, running on CPU 32 communicates with a peer client (not shown) running on remote network node 28 .
[0054] In some embodiments, one or more MCSQs 56 are used as a communication interface for clients 50. Clients 50 may publish on a given MCSQ WR corresponding to multiple different targets, where each WR will be published on an SQ 48 connected to the corresponding target. As will be described in detail below, processing circuitry retrieves WRs from the MCSQ and distributes the WRs to the SQs associated with the MCSQ. The processing circuitry also handles publishing CQEs on CQ 58. Host software interfacing multiple channel communications via a single MCSQ and a common CQ is much more efficient than direct management of multiple SQs and CQs by the host and requires fewer CPU cycles.
[0055] In some embodiments, the CPU 32 includes a cache memory 60, which is typically used to temporarily store data needed by the CPU. Data in a local cache is typically processed much faster than data residing in memory 34. In embodiments, the cache stores one or more MCSQs, or corresponding portions of such MCSQs.
[0056] In some embodiments, the network node 24 includes a coprocessor, such as an accelerator 64. The accelerator may include, for example, a hardware device implemented in a field programmable gate array. The accelerator may be used to quickly perform various data processing tasks on behalf of the CPU, such as data compression / decompression, data encryption / decryption, etc. In some embodiments, the client 50 communicates with the accelerator 64 by issuing a WR on the MCSQ 56, where the WR specifies the accelerator as a target.
[0057] In some embodiments, to establish a connection between a client process running on a host and a peer process running on a target, the host sends a connect packet to the target. After the connection is established, an SQ (48) and RQ are allocated on the initiator host side, and a peer RQ and SQ are allocated on the target side. To disconnect the connection, the initiator host sends a disconnect packet to the target.
[0058] In some embodiments, SQ 48 may be configured to operate according to a Reliable Connection (RC) protocol or according to a Dynamic Connection (DC) protocol.
[0059] In the RC transport service, the connection between the host and the target is persistent, i.e., intended to remain active for a relatively long time. Connections according to the RC protocol are available for communication at any time and can therefore be used immediately when needed (or only with a sorting delay). Because in the RC protocol, connections remain available even when no traffic is exchanged, RC continuously consumes storage space in the SQ and RQ on both sides. Therefore, RC does not scale well to support a large number of simultaneous connections.
[0060] In DC delivery service, connections between hosts and targets are established on demand. A host (or its network adapter) may maintain a pool of SQs, which is typically much smaller than the SQ pool of RC delivery service. When a host transfers data to a given target, an SQ is temporarily allocated to connect to this target. After the transfer operation is completed, the connection is terminated and the SQ becomes available in the pool to connect to other targets. DC delivery service is scalable because it uses a relatively small number of shared SQs. One disadvantage of DC delivery service is the delay incurred by connection establishment and termination.
[0061] In the disclosed embodiment, a single work queue (e.g., MCSQ) serves a large number of RC and DC SQs. SQs consume much less storage space than MCSQs because they only require a small amount of transport context storage space and a small amount of storage space to store information used to access WRs in the MCSQ. Such a configuration is particularly beneficial when the memory and / or cache storage space available to the WR initiator is limited. It is also generally advantageous to dock a single MCSQ rather than docking many SQs, and this is also true for WR initiators with limited resources. Examples of WR initiators with limited resources include peer hardware devices (e.g., FPGA devices or GPUs), SoCs, embedded CPUs, etc.
[0062] Multi-channel management via network adapters
[0063] Figure 2 is a diagram schematically illustrating data flow in a network node 100 supporting communication over multiple channels according to embodiments described herein.
[0064] Will refer to Figure 1 The data flow within the network node 100 is described with reference to the network node 24 of the network node 100.
[0065] In network node 100, multi-channel communications are implemented through a combination of software executed by the host's CPU 32 and management of multiple connections by network adapter 38. Figure 2 , a horizontal dashed line separates the host software domain and the network adapter domain. In this context, the software domain and the network adapter domain refer to the respective processes executed by the CPU 32 and the network adapter 38, respectively. The data structures involved in the processes, such as MCSQ, SQ, and CQ, may reside in any suitable memory, such as the memory 34 or the memory of the network adapter (not shown).
[0066] exist Figure 2 In the example of , the elements of the software domain (above the dashed line) include MCSQ 104 for interfacing WR to the network adapter. Figure 2 A single MCSQ is depicted, but in alternative embodiments any other suitable number of MCSQs may be used.
[0067] The MCSQ 104 receives a specified data transfer operation from a client 50 running on a host WR. The WR specifying the data transfer contains an identifier indicating the SQ on which the WR is issued.
[0068] In the RC protocol, a single SQ is used to connect to a single target, in which case the number assigned to the SQ (e.g., or QP number) can be used as the SQ identifier of the target. In the DC protocol, the same DC SQ is used to connect to different targets at different times. In this case, the CPU assigns a stream identifier (stream ID) to each WR, which is then published on the DC SQ serving the relevant stream ID. When no SQ is assigned to the stream ID of the WR, an available DC SQ (if any) will be assigned to the stream ID, and the WR will be published on the DC SQ. If no DC SQ can be used to publish a WR, the distributor will wait until one of the used DC SQs becomes available. A WR specifying a data transmission to a given target will be published on the DC SQ serving the relevant stream ID. If this DC SQ is currently serving another target, the DC SQ will reconnect to serve the given target after serving all of its previously published WRs.
[0069] Note that in terms of destination, each DC SQ in can be connected to any desired destination. In terms of flow ID - if there is a DC SQ serving a flow ID, then WRs with this flow ID are published on this DC SQ to guarantee the order of execution of different WRs associated with the same flow ID. This applies to WRs destined for the same or different destinations.
[0070] The CQ 112 receives a CQE from the network adapter indicating completion of execution of the WR issued on the MCSQ 104 .
[0071] A given client 50 may communicate with multiple targets. Clients typically publish WRs on the MCSQ in some desired order. For example, a client may publish one or more WRs for sending data to a target before publishing one or more additional WRs for sending data to the same or another target.
[0072] The network node 100 includes a delivery engine 118. In this example, the delivery engine includes a DC SQ pool 120 including a DCSQ 124 operating in a DC mode, and an RC SQ pool 122 including an RC SQ 126 operating in an RC mode.
[0073] The distributor 128 retrieves WRs from the MCSQ 104 and publishes them on the DC SQ 124 and RC SQ 126 as appropriate. In some embodiments, each WR in the MCSQ includes an identifier indicating the DC SQ or RC SQ on which the WR is published. A given DC SQ may serve connections with a common flow ID with the same or different targets at different times. A given RC is typically associated with a given SQ identifier, such as by a QP number.
[0074] In some embodiments, for a DC SQ, the distributor maintains a mapping table between flow IDs and corresponding active DC SQs.When a DC SQ completes execution of all its pending WRs, the distributor releases the association between the DC SQ and the flow ID.
[0075] In some embodiments, the distributor 128 publishes WRs for targets of a common flow ID on the same DC SQ. Similarly, the distributor 128 may publish WRs for targets of a common identifier (QP number) on the same RC SQ. This ensures that WRs with the same identifier will be executed sequentially in the same order in which they were published on the MCSQ.
[0076] The delivery engine 118 reads WRs from the DC SQ 124 and the RC SQ 126 and executes them. In some embodiments, the delivery engine executes one WR at a time. In such embodiments, the delivery engine uses any suitable method (e.g., a round-robin method or randomly) to select a DC SQ or RC SQ to execute a WR from. Alternatively, the delivery engine supports executing multiple WRs from multiple SQs in parallel. For example, the delivery engine can execute a WR from a DC SQ and a WR from an RC SQ in parallel, and / or execute multiple WRs from multiple DC SQs and / or from multiple RC SQs in parallel.
[0077] When performing a WR, the transport engine 118 reads the data to be transmitted, for example, from the buffer 52 in the memory 34, packages the read data into a sequence of packets, and transmits the packets to the relevant destination, for example, via the communication network 30. For each packet sent, the transport engine receives an Ack notification 140 from the destination. After receiving the Ack corresponding to the last packet of the current WR, the transport engine generates a CQE indicating that the WR execution is complete. The transport engine issues CQEs (for DC SQ and RCSQ) on CQ 112, which can be accessed by the host.
[0078] The delivery engine executes WRs issued on a DC SQ (or RC SQ) in the same order in which they were issued on the associated MCSQ, but typically executes WRs issued on a different DC SQ (or different RC SQ) in a different order than on the MCSQ. Such out-of-order execution may occur for various reasons, such as WRs requiring different execution times, SQs experiencing different workloads, and different priorities assigned to different SQs.
[0079] In some implementations, the transport engine supports in-order or out-of-order execution of WRs by issuing CQEs on CQs in an in-order or out-of-order manner.
[0080] As described above, the order in which WRs are executed is typically different than the order in which the WRs are posted on the MCSQ. In ordered mode, the reorder buffer 144 orders the CQEs generated by the transport engine in the same order as the corresponding WRs are posted on the MCSQ. In ordered mode, the network adapter posts a CQE corresponding to a given WR only after the given WR executes the WR posted in the MCSQ before and the CQE posted by the MCSQ. In an example embodiment, CQE reordering may be based on a sequence number assigned to the WR posted on the MCSQ. In ordered mode, a single CQE may correspond to multiple WRs, which reduces the number of CQEs processed by the host. For example, consider posting three WRs on the MCSQ, one for each of the three connections. In ordered mode, the network adapter may only post a CQE for the last WR executed among the three WRs posted on the MCSQ.
[0081] In out-of-order mode, the delivery engine 118 issues CQEs in the order in which the WRs complete, which is typically different from the order in which the WRs are issued on the MCSQ. For example, out-of-order mode can be used when the host (e.g., client 50) does not expect any particular execution order among the WRs. Thus, the host can process a completed WR without having to wait for a previously slower WR to complete execution.
[0082] In the DC SQ pool 120, at any given time, each of the DC SQs 124 may be participating in a connection or available to establish a new connection.
[0083] The transport engine may disconnect a participating DCSQ that has not submitted a WR within a predefined time, and the disconnected DCSQ becomes available for other connections.
[0084] In the RC SQ pool 122, even when the RC SQ does not submit a WR for execution, the RC SQ 126 is connected to the corresponding target for a long time.
[0085] When MCSQ 56 fails, multi-channel communications in network node 100 may fail, for example, due to a failure in passing WRs to or from the MCSQ. In this case, in an embodiment, all multi-channel communications via the failed MCSQ are suspended.
[0086] When DC SQ or RC SQ fails (eg due to connection timeout), multi-channel communication may also fail. In this case, in an embodiment, only the failed DC SQ or RC SQ is suspended, while communication via other DC SQ and RC SQ continues uninterrupted.
[0087] Note that WRs in the failed SQ will not be executed, and therefore the transport engine will not generate CQEs for these WRs. This may prevent WRs associated with active connections from being executed in the MCSQ. In some embodiments, to allow smooth operation of the MCSQ, the network adapter generates CQEs indicating failures and issues them on the CQ. The MCSQ may respond to such CQEs as if the corresponding WRs had completed.
[0088] In an embodiment, the network adapter generates CQEs indicating failed connections for WRs destined for the failed RC SQ or DC SQ and publishes these CQEs on the CQ.
[0089] When an RC or DC SQ fails, the identifier currently associated with the failed SQ is added to the blacklist 160. The SQ identifier may include a QP number for RC or a flow ID for DC. In the case of a TCP connection, the SQ identifier may include a five-tuple including source and destination addresses, source and destination port numbers, and the underlying protocol. When the distributor 128 reads a WR from the MCSQ 104, the blacklist filter 154 checks whether the identifier of the SQ is in the blacklist 160. As described above, when the identifier is not in the blacklist, the distributor sends the WR to the relevant SQ. When the identifier is in the blacklist, the blacklist filter blocks the WR from being sent to the distributor. Instead, the network adapter generates a CQE indicating the failed connection and publishes the CQE on the CQ112. At an appropriate later time, for example, when the failure is repaired, the host sends a command to the network adapter to remove the SQ identifier from the blacklist.
[0090] exist Figure 2 In an example implementation of , the delivery engine 118 executes the WRs in the SQ. For example, the delivery engine includes a single execution engine that executes all WRs. Alternatively, the delivery engine includes multiple execution engines that are dynamically allocated to execute WRs.
[0091] As mentioned above, the number of MCSQs is not necessarily limited to a single MCSQ. When there are multiple MCSQs, an SQ connected to a given target can serve multiple MCSQs.
[0092] Figure 1 The computing system (20), network node (24), and network adapter (38) configurations shown are example configurations, which are selected purely for conceptual clarity. In alternative embodiments, any other suitable computing system, network node, and network adapter configuration may also be used. For clarity, elements that are not necessary for understanding the principles of the present invention, such as various interfaces, addressing circuits, timing and sequencing circuits, and debugging circuits, have been omitted from the figure.
[0093] Some elements of network adapter 38, such as processing circuitry 46, may be implemented in hardware (e.g., in one or more application specific integrated circuits (ASICs) or FPGAs). Additionally or alternatively, processing circuitry 46 may be implemented using software or using a combination of hardware and software elements. Memory 34 may include any suitable type of memory using any suitable storage technology, such as random access memory (RAM), dynamic RAM (DRAM), non-volatile memory such as flash memory, or a combination of memory types.
[0094] In some embodiments, some functions of the network adapter 38, such as the functions of the processing circuit 46, may be performed by a general purpose processor that is programmed with software to perform the functions described herein. The software may be downloaded to the processor in electronic form, such as over a network, or it may alternatively or additionally be provided and / or stored on a non-transitory tangible medium, such as a magnetic, optical, or electronic memory.
[0095] Multi-channel communication method using DC and RC protocols
[0096] Figure 3 is a flow chart schematically illustrating a method for multi-channel transmission according to embodiments described herein.
[0097] The method will be described as consisting of Figure 1 The network adapter 38 (more specifically, the processing circuit 46 of the network adapter) is executed, and reference is made to Figure 2 Diagram of the elements that include a network adapter domain.
[0098] In the description Figure 3 , it is assumed that the WR includes an identifier field indicating the SQ on which the WR is to be published.
[0099] The method begins with the network adapter 38 marking the status of all DC SQs 124 in the DC SQ pool 120 and all RC SQs 126 in the RC SQ pool 122 as available at the SQ initialization step 200. At the identifier determination step 204, the network adapter reads the identifier field from the first WR (e.g., the WR at the head position) in the MCSQ 104. The identifier depends on the underlying protocol. For example, when the WR specifies that the DC protocol is used for transmission, the identifier may include a flow identifier. Alternatively, when the WR specifies that the RC mode is used for transmission, the identifier may include a QP number. Further alternatively, when the underlying protocol is TCP, the identifier may include a five-tuple including a source address and a destination address, a source port number and a destination port number, and an underlying protocol.
[0100] At the association query step 208, the network adapter checks whether the identifier has been associated with either the DC SQ 124 or the RC SQ 126, and if so, retrieves the first WR from the MCSQ at the WR retrieval step 212. At the WR posting step 216, the network adapter posts the WR on the service SQ determined at the above step 208. At the release check step 220, the network adapter checks whether any SQ has been released, and if so, marks the status of the released SQ as available. After step 220, the network adapter loops back to step 204 to process subsequent WRs in the MCSQ 104.
[0101] When the identifier has no associated SQ in the DC SQ pool or the RC SQ pool at step 208, the network adapter proceeds to the SQ availability check step 228 to check for an available DC SQ in the DC SQ pool or an RC SQ in the RC SQ pool as needed. When no SQ that becomes available is found at step 228, all SQs in the relevant pool participate in the connection, and the network adapter proceeds to the waiting step 232 to wait for one (or more) DC SQs in the DC SQ pool or one (or more) RCSQs in the RC SQ pool to disconnect and become available, and loops back to step 228.
[0102] When an available SQ is found in step 228, the network adapter proceeds to the allocation step 236 to allocate the found SQ to serve the WR with the identifier at step 204. Further in step 236, the network adapter establishes a connection between the found SQ and the target's SQ, and marks the state of the found SQ as participating. After step 236, the network adapter proceeds to step 212, followed by step 216, to retrieve the current first WR and publish it to the SQ allocated in step 236.
[0103] Figure 4 is a diagram schematically illustrating data flows in a network node 300 for managing communications separately over DC and RC connections according to embodiments described herein.
[0104] exist Figure 4In the embodiment, WRs of RC and DC are handled separately. The DC part includes DC MCSQ 104A (or multiple DC MCSQs), which maintains WRs distributed by DC distributor 128A between DC SQ 124. Completion of DCWR is reported via DC CQ 112A. The RC part includes RC MCSQ 104B (or multiple RCMSCQs), which maintains WRs distributed by RC distributor 128B between RC SQ 126. Completion of RC WR is reported via RC CQ 112B. The DC and RC parts include separate blacklists 160A and 160B and separate blacklist filters 164A and 164B for handling DC SQ failures and RC SQ failures, respectively. Each of the DC part and the RC part includes a reordering buffer 144 for reordering completion reports.
[0105] The data streams in the DC and RC sections use separate MCSQs, similar to the above Figure 2 The functions and data flows described in , where DC and RC use a common MSCQ process.
[0106] In some embodiments, the host issues WRs on first and second MCSQs associated with first and second SQ pools, respectively. Each of the first and second MCSQs may be a DC MCSQ or an RC MCSQ. In such embodiments, the network adapter distributes WRs from the first MCSQ to SQs in the first pool, and distributes WRs from the second MCSQ to SQs in the second pool. In some embodiments, at least one SQ is shared between the first and second pools (e.g., both are DC SQ pools or both are RC SQ pools), and the network adapter issues WRs from both the first and second MCSQs to at least one SQ.
[0107] The embodiments described above are given as examples, and other suitable embodiments may also be used.
[0108] It should be understood that the embodiments described above are cited as examples, and the appended claims are not limited to what is specifically shown and described above. On the contrary, the scope includes combinations and sub-combinations of the various features described above, as well as changes and modifications thereof that would occur to a person skilled in the art after reading the foregoing description and that are not disclosed in the prior art. The documents incorporated by reference in this patent application are considered to be an integral part of this application, unless any term is defined in these incorporated documents in a manner that conflicts with the explicit or implicit definitions in this specification, otherwise only the definitions in this specification should be considered.
Claims
1. A network adapter, comprising: a network interface configured to connect to a communication network for communicating with a remote target; a host interface configured to connect to a host, the host accessing a multi-channel send queue (MCSQ) storing work requests (WRs) originating from a client process running on the host; and A processing circuit, the processing circuit being configured to: Retrieve WRs from multiple send queues (SQs) and perform the data transfer operation specified in the WRs, and The WRs are retrieved from the MCSQ and the retrieved WRs are distributed into the plurality of send queues (SQs) accessible by the processing circuitry.
2. The network adapter of claim 1 , wherein each of the targets comprises: (i) a remote node coupled to the communication network; or (ii) a local device coupled to the host. 3 . The network adapter of claim 1 , wherein the WRs include respective identifiers associated with respective SQs, and wherein the processing circuitry is configured to distribute the WRs among the SQs based on the identifiers.
4. The network adapter of claim 3 , wherein the processing circuit is configured to, in response to detecting that the identifier in the retrieved WR has no associated SQ in the SQs, select an available SQ from the plurality of SQs, associate the identifier with the available SQ, and publish the WR on the available SQ.
5. The network adapter of claim 3, wherein the processing circuit is configured to publish the WR on a selected SQ in response to detecting that the identifier in a given WR is associated with the selected SQ. 6 . The network adapter of claim 1 , wherein the processing circuit is configured to operate the SQ according to a reliable connection (RC) protocol in which the SQ is assigned to be persistently connected to a corresponding target.
7. The network adapter of claim 1, wherein the processing circuit is configured to operate the SQ according to a dynamic connection (DC) protocol that allows a given SQ to connect to different targets at different times.
8. The network adapter of claim 1 , wherein the host issues WRs on first and second MCSQs associated with first and second SQ pools, respectively, and wherein the processing circuit is configured to distribute WRs from the first MCSQ to SQs in the first SQ pool and distribute WRs from the second MCSQ to SQs of the second SQ pool.
9. The network adapter of claim 8, wherein at least one SQ is shared between the first SQ pool and the second SQ pool, and wherein the processing circuit is configured to issue WRs from both the first MCSQ and the second MCSQ to the at least one SQ.
10. The network adapter of claim 1, wherein the processing circuit is configured to, after all completion queue elements (CQEs) corresponding to WRs posted to the MCSQ prior to a given WR are posted on a completion queue (CQ), post the CQE indicating end execution of the given WR on the CQ accessible by the client process.
11. The network adapter of claim 1, wherein the processing circuit is configured to issue CQEs to a CQ independent of an order of corresponding WRs in the MCSQ.
12. The network adapter of claim 1, wherein the processing circuit is configured to distribute WRs specifying only a given target to a given SQ that has established a connection with the given target until the connection is terminated.
13. The network adapter of claim 1, wherein the processing circuit is configured to, in response to detecting a failure in a given SQ, issue a CQE on a CQ indicating the failure.
14. The network adapter of claim 13, wherein the processing circuit is configured to issue a CQE on the CQ indicating the failure for each WR to be executed in a given SQ.
15. The network adapter of claim 13, wherein the processing circuit is configured to issue a CQE on the CQ indicating the failure for each WR from the MCSQ to be distributed to a given SQ.
16. The network adapter of claim 1, wherein at least a given WR specifies a corresponding data transfer operation from the host to a target.
17. The network adapter of claim 1, wherein a given WR specifies an operation to be performed locally.
18. A method for communication, comprising: In a network adapter connected to a communication network for communicating with a remote target and also connected to a host, the host accesses an MCSQ storing work requests (WRs) originating from a client process running on the host, A WR is retrieved from a plurality of send queues (SQs) and a data transfer operation specified in the WR is performed, and a WR is retrieved from the MCSQ and the retrieved WR is distributed among a plurality of send queues (SQs) accessible by the network adapter.
19. The method of claim 18, wherein each of the targets comprises: (i) a remote node coupled to the communication network; or (ii) a local device coupled to the host.
20. The method of claim 18, wherein the WRs include respective identifiers associated with respective SQs, and wherein distributing the WRs includes distributing the WRs among the SQs based on the identifiers.
21. The method of claim 20, further comprising, in response to detecting that the identifier in the retrieved WR has no associated SQ in the SQs, selecting an available SQ from the plurality of SQs, associating the identifier with the available SQ, and publishing the WR on the available SQ.
22. The method of claim 20, further comprising publishing the WR on a selected SQ in response to detecting that the identifier in a given WR is associated with the selected SQ.
23. The method of claim 18, further comprising operating the SQ according to a reliable connection (RC) protocol in which the SQ is assigned to be persistently connected to a corresponding target.
24. The method of claim 18, further comprising operating the SQ according to a dynamic connection (DC) protocol that allows a given SQ to connect to different targets at different times.
25. The method of claim 18, wherein the host issues WRs on first and second MCSQs associated with first and second SQ pools, respectively, and wherein distributing the WRs comprises distributing the WRs from the first MCSQ to SQs in the first SQ pool, and distributing the WRs from the second MCSQ to SQs in the second SQ pool.
26. The method of claim 25, wherein at least one SQ is shared between the first SQ pool and a second SQ pool, and wherein distributing the WR comprises issuing WRs from both the first MCSQ and the second MCSQ to the at least one SQ.
27. The method of claim 18, further comprising, after all completion queue elements (CQEs) corresponding to WRs posted to the MCSQ prior to a given WR are posted on a completion queue (CQ), posting the CQE indicating end execution of the given WR on the CQ accessible by the client process.
28. The method of claim 27, wherein issuing the CQE comprises issuing the CQE to a CQ independent of an order of corresponding WRs in the MCSQ.
29. The method of claim 18, wherein distributing the WR comprises distributing a WR specifying only a given target to a given SQ that has established a connection with the given target until the connection is terminated.
30. The method of claim 27, wherein issuing the CQE comprises, in response to detecting a failure in a given SQ, issuing a CQE on a CQ indicating the failure for each WR retrieved from the MCSQ and to be distributed to the given SQ.
31. The method of claim 30, wherein issuing the CQE comprises issuing a CQE on a CQ indicating the failure for each WR to be executed in the given SQ.
32. The method of claim 30, wherein publishing the CQE comprises publishing a CQE on the CQ indicating the failure of each WR from the MCSQ to be distributed to the given SQ.
33. The method of claim 18, wherein a given WR specifies a corresponding data transfer operation from the host to the target.
34. The method of claim 18, wherein a given WR specifies an operation to be performed locally.
Citation Information
Patent Citations
Dynamically-connected transport service
US8213315B2
Responding to dynamically-connected transport requests
US8761189B2
System and method for preserving message order while employing both programmed I / O and DMA operations
US5887134A
