Efficient PCIe Utilization via PCIe TLP Merging

By using merge buffers and timeout counters in the controller of the data storage device, the transmission efficiency of TLP in the PCIe bus is optimized, solving the problem of low packet efficiency in the transport layer and improving the performance of the data storage device.

CN114518838BActive Publication Date: 2024-10-01SANDISK TECH
View PDF 8 Cites 0 Cited by

Patent Information

Application Number
CN202110656543.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2021-02-24
Filing Date
2021-06-11
Publication Date
2024-10-01
Estimated Expiration
2041-06-11

AI Technical Summary

Technical Problem

In the PCIe bus, the inefficiency of Transport Layer Packets (TLPs) leads to performance degradation of data storage devices, especially when the payload size of the data is small, the overhead accounts for a larger proportion, and the delay when the data is divided into smaller TLPs increases and bandwidth requirements increase.

Method used

By introducing a merge buffer and a timeout counter in the controller of the data storage device, requests are merged and the threshold of the timeout counter is adjusted according to the weight value. When the request is larger than the maximum TLP size, partition processing is performed to optimize data transmission.

Benefits of technology

It effectively reduces data transmission delay and improves bandwidth utilization. By merging requests and dynamically adjusting the threshold of the timeout counter, the transmission efficiency of data packets is optimized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114518838B_ABST
    Figure CN114518838B_ABST
Patent Text Reader

Abstract

The present invention is entitled Efficient PCIe Utilization through PCIe TLP Merging. The present disclosure as a whole relates to efficient transport layer packet (TLP) utilization. When a controller of a data storage device generates a request for transferring data to or from a storage device, the request is stored in a merge buffer. The merge buffer may include previously generated requests, wherein the previously generated requests and the new request are merged. A timeout counter is initialized for the request stored in the merge buffer. The timeout counter has a configurable threshold corresponding to a weight value, which is adjusted for latency or bandwidth considerations. When the merge request is larger than the maximum TLP size, the merge request is partitioned, wherein at least one partition is the size of the maximum TLP size. When the request is the size of the maximum TLP size or when a threshold is exceeded, a request is sent from the buffer.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims the benefit of U.S. Provisional Patent Application Serial No. 63 / 116,459, filed on November 20, 2020, which is incorporated herein by reference. Background Art Technical Field

[0003] Embodiments of the present disclosure generally relate to efficient transport layer packet (TLP) utilization.

[0004] Description of Related Art

[0005] Data storage devices such as solid-state drives are typically connected to a host computer via a non-volatile memory express (NVMe) interface. In such systems, the host computer initiates a data transfer by preparing a data buffer containing the data to be transferred to or from the storage device. In NVMe, the physical memory location of the data buffer is indicated by a physical region page (PRP) entry or a scatter-aggregate table (SGL). Using the PRP or SGL, the host computer transmits a pointer to the physical memory location to the storage device as a host command pointer. The host computer sends at least as many pointers as physical memory locations to store the data for transfer.

[0006] When working with NVMe via PCIe, the host computer can send pointers to continuous logical addresses. However, when transmitting data associated with the pointer, the data storage device may be inefficient in utilizing the physical (PCIe) bus. Inefficient utilization can lead to performance degradation. For example, each data packet (i.e., transport layer data packet (TLP)) transmitted via the PCIe bus may have an overhead of about 24 bytes. When the payload size of the data is about 256 bytes, the overhead accounts for about 10% of the total payload size. In addition, when the data from the continuous logical address is larger than the maximum TLP, the data storage device may divide the data into several smaller TLPs. Each of the smaller TLPs includes overhead, which can increase latency and require more bandwidth.

[0007] Therefore, there is a need in the art for improved TLP utilization that optimizes latency and bandwidth. Summary of the invention

[0008] The present disclosure as a whole relates to effective transport layer packet (TLP) utilization. When a controller of a data storage device generates a request for transferring data to or from a storage device, the request is stored in a merge buffer. The merge buffer may include previously generated requests, wherein the previously generated requests and the new request are merged. A timeout counter is initialized for the request stored in the merge buffer. The timeout counter has a configurable threshold corresponding to a weight value, which is adjusted for latency or bandwidth considerations. When the merge request is larger than the maximum TLP size, the merge request is partitioned, wherein at least one partition is the size of the maximum TLP size. When the request is the size of the maximum TLP size or when a threshold is exceeded, a request is sent from the buffer.

[0009] In one embodiment, a data storage device includes a memory device and a controller coupled to the memory device. The controller is configured to receive a new command, generate one or more requests associated with the new command, determine whether the start of the newly generated one or more requests is continuous with the end of a previous request or a merged request stored in a buffer, and update the length of the previous request or merged request stored in the buffer to include the new length of the newly generated one or more requests, or send the previous request or merged request from the buffer and push the newly generated one or more requests to the buffer.

[0010] In another embodiment, a data storage device includes a memory device and a controller coupled to the memory device. The controller is configured to initialize a weight value, wherein the weight value affects a maximum threshold of a timeout counter, define a maximum size value of a received command, receive a new command, determine whether the received new command is greater than or less than the maximum size value of the received command, adjust the weight value based on the determination, adjust the maximum threshold of the timeout counter, and define a maximum payload size (MPS).

[0011] In another embodiment, a data storage device includes a memory device and a controller coupled to the memory device. The controller includes means for determining whether a new request is continuous with a previous request or a merged request stored in a buffer, and means for adjusting a timeout counter based on data traffic. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Thus, a detailed understanding of the manner in which the above-described features of the present disclosure are understood, a more particular description of the present disclosure, the above brief overview, may be obtained by reference to the embodiments, some of which are illustrated in the accompanying drawings. It should be noted, however, that the drawings illustrate only typical embodiments of the present disclosure and are therefore not to be considered limiting of its scope, as the present disclosure may admit to other equally effective embodiments.

[0013] Figure 1is a schematic block diagram of an exemplary computing system including a host computer system and a storage device according to one embodiment.

[0014] Figure 2 is a schematic diagram of a TLP according to one embodiment.

[0015] Figure 3 is a schematic diagram of commands based on various views according to one embodiment.

[0016] Figure 4 is a schematic block diagram of data transfer to a host device according to one embodiment.

[0017] Figure 5A A method is shown for optimizing storage of requests in a buffer, according to one embodiment.

[0018] Figure 5B According to one embodiment, the update Figure 5A The requested length of the buffer.

[0019] Figure 6 is a method of showing updates of weight values ​​according to one embodiment.

[0020] To facilitate understanding, identical reference numerals have been used, where possible, to designate identical elements that are common to the figures. It is contemplated that elements disclosed in one embodiment may be beneficially utilized on other embodiments without specific recitation. DETAILED DESCRIPTION

[0021] Hereinafter, reference is made to the embodiments of the present disclosure. However, it should be understood that the present disclosure is not limited to the embodiments specifically described. On the contrary, any combination of the following features and elements (whether or not related to different embodiments) is considered to realize and practice the present disclosure. In addition, although the embodiments of the present disclosure can achieve advantages that are superior to other possible solutions and / or superior to the prior art, whether a specific advantage is achieved by a given embodiment is not a limitation to the present disclosure. Therefore, the following aspects, features, embodiments and advantages are merely illustrative, and are not considered to be elements or limitations of the appended claims, unless explicitly stated in the claims. Similarly, reference to "the present disclosure" should not be interpreted as a summary of any inventive subject matter disclosed herein, and should not be considered to be elements or limitations of the appended claims, unless explicitly stated in the claims.

[0022] The present disclosure as a whole relates to effective transport layer packet (TLP) utilization. When a controller of a data storage device generates a request for transferring data to or from a storage device, the request is stored in a merge buffer. The merge buffer may include previously generated requests, wherein the previously generated requests and the new request are merged. A timeout counter is initialized for the request stored in the merge buffer. The timeout counter has a configurable threshold corresponding to a weight value, which is adjusted for latency or bandwidth considerations. When the merge request is larger than the maximum TLP size, the merge request is partitioned, wherein at least one partition is the size of the maximum TLP size. When the request is the size of the maximum TLP size or when a threshold is exceeded, a request is sent from the buffer.

[0023] Figure 1 1 is a schematic block diagram of an exemplary computing system 100 including a host computer system 170 and a data storage device 102 according to one embodiment. In some examples, the data storage device 102 may be a solid-state drive of the host computer system 170. The host computer system 170 may utilize a non-volatile memory (NVM) included in the data storage device 102 (shown as a memory array 160) to write and read data, such as for long-term memory storage. The data storage device 102 may be an internal storage drive, such as a notebook hard drive or a desktop hard drive. The data storage device 102 may be a removable mass storage device, such as, but not limited to, a handheld removable memory device, such as a memory card (e.g., a secure digital (SD) card, a micro secure digital (micro-SD) card, or a multimedia card (MMC)) or a universal serial bus (USB) device. The data storage device 102 may take the form of an embedded mass storage device such as an eSD / eMMC embedded flash drive embedded in the host computer system 170. The data storage device 102 may also be any other type of internal storage device, removable storage device, embedded storage device, external storage device, or network storage device.

[0024] In some examples, for clarity, data storage device 102 may include Figure 1106. In some examples, the physical size and connector configuration of the data storage device 106 may conform to one or more standard form factors. Some exemplary standard form factors include, but are not limited to, a 3.5" data storage device (e.g., an HDD or SSD), a 2.5" data storage device, a 1.8" data storage device, a peripheral component interconnect (PCI), a PCI extension (PCI-X), a PCI Express (PCIe) (e.g., PCIe x1, x4, x8, x16, PCIe Mini Card, MiniPCI, etc.). In some examples, the data storage device 102 may be directly coupled (e.g., directly soldered) to a motherboard of the host computer system 170.

[0025] The host computer system 170 can be a variety of devices, such as computer servers, network attached storage (NAS) units, desktop computers, notebook (i.e., laptop) computers, tablet computers (i.e., "smart" tablets), set-top boxes, mobile phones (i.e., "smart" phones), televisions, cameras, display devices, digital media players, video game consoles, video streaming devices, and automotive applications (i.e., mapping, autonomous driving).

[0026] The host computer system 170 includes a main memory 180, such as a DRAM or other main memory. Applications may be stored in the main memory 180 for execution by components of the host computer system 170. The main memory 180 may include host queues, such as a command submission queue and a command completion queue. The main memory 180 includes a physical region page (PRP) pointer 182, a data buffer 184 (such as a host data buffer), and other types of memory structures 186.

[0027] The data storage device 102 includes a MAC and PHY component 120 for inbound communication from the host computer system 170 to the data storage device 102 and outbound communication from the data storage device 102 to the host computer system 170. The link between the data storage device 102 and the host computer system 170 can be any suitable link, such as a high-speed peripheral component interface (PCIe) link in this example. The PCIe link can be one to thirty-two lanes, depending on the number of available PHYs connecting the two PCIe connectors. The PCIe link is typically set up during endpoint device initialization (such as initialization of the data storage device 102).

[0028] The link between the host computer system 170 and the data storage device 102 operates under a communication protocol such as a PCIe serial communication protocol or other suitable communication protocol. Other suitable communication protocols include Ethernet, Serial Attached SCSI (SAS), Serial AT Attached Device (SATA), any protocol related to Remote Direct Memory Access (RDMA), such as Infiniband, iWARP, or RDMA over Converged Ethernet (RoCE), and other suitable serial communication protocols. In other examples, the data storage device 102 may also be connected to the host computer system 170 via a switch or a bridge.

[0029] In the PCIe communication protocol, the host computer system 170 and the data storage device 102 may send requests to each other as transport layer packets (TLPs). The TLP may include an optional TLP prefix, a TLP header, a data payload, and an optional TLP summary. The TLP header includes a type field, which may indicate the type of transaction.

[0030] As the TLP is transmitted between the host computer system 170 and the data storage device 102, the data link layer and the physical layer are added to each TLP to ensure that the TLP arrives at the intended destination. Each TLP includes specific overhead from the added data link layer and the physical layer. For example, the TLP can include an optional end-to-end cyclic redundancy check and (ECRC) in the TLP summary. The data link layer adds a sequence number and a link layer CRC (LCRC) to the TLP to ensure successful transmission across the link. The physical layer adds information to mark the beginning and end of the TLP.

[0031] The memory array 160 of the storage device 102 can be configured to store information for a long time as a non-volatile storage space and retain the information after power on / off cycles. The memory array 160 can be composed of one or more dies of NAND flash memory. Other examples of non-volatile memory include phase change memory, ReRAM memory, MRAM memory, magnetic media (including shingled magnetic recording), optical disks, floppy disks, electrically programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), and other solid-state memories. The magnetic media non-volatile memory can be one or more disks in the storage device 102. Each disk can contain one or more areas consisting of one or more data tracks. The memory array 160 may additionally include one or more types of non-volatile memory.

[0032] The data storage device 102 includes a controller 110 that manages the operation of the data storage device 102, such as writing to and reading from the memory array 160. The controller 110 may include one or more processors 112, which may be multi-core processors. The processor 112 processes the components of the data storage device 102 through firmware code.

[0033] The controller 110 may operate under the NVM Express (NVMe) protocol, but other protocols are also applicable. The NVMe protocol is a communication interface / protocol developed for SSDs to operate a host computer system and a data storage device linked via a PCIe interface. The NVMe protocol provides a command submission queue and a command completion queue for accessing data stored in the data storage device 102 by the host computer system 170. The data storage device 102 may extract or read a host command from a command submission queue of a host queue of the main memory 180.

[0034] The controller 110 executes executable instructions (referred to herein as “instructions”) of a computer-readable program code (e.g., software or firmware). The instructions may be executed by various components of the controller 110, such as the processor 112, logic gates, switches, application specific integrated circuits (ASICs), programmable logic controllers, embedded microcontrollers, and other components of the controller 110.

[0035] The instructions are stored in a non-transitory computer-readable storage medium. In certain embodiments, the instructions are stored in a non-transitory computer-readable storage medium of the data storage device 102, such as a read-only memory or a memory array 160. The instructions stored in the data storage device 102 can be executed without input or instructions added from the host computer system 170. In other embodiments, the instructions are transmitted from the host computer system 170. The controller 110 is configured with hardware and instructions for performing the various functions described herein and shown in the figures.

[0036] The data storage device 102 may also include other components, such as a flash interface module 134, a direct memory access (DMA) module 144, a scheduler 140, an error correction module 142, a command executor 132, and a control path 150. The flash interface module 134 interacts with the memory array 160 for read and write operations. The scheduler 140 controls the data transfer when activating the control path 150 to extract the physical page area (PRP), issue completions and interrupts, and activate the DMA module 144 to perform the actual data transfer between the host computer system 170 and the data storage device 102. The error correction module 142 corrects the data extracted from the memory array 160. The command parser 130 extracts the command to the command executor 132 for execution on the flash interface module 134. The DMA module 144 performs the data transfer between the host computer system 170 and the data storage device 102.

[0037] Generally speaking, the host computer system 170 initiates a data transfer (to or from the data storage device 102) by transmitting a host command to the data storage device 102. With NVMe, the data associated with the host command may be indicated by a PRP entry or an SGL. In either system, the data for the host command is transmitted to the physical memory of the main memory 180 as a series of host command pointers. In this example, the host computer system 170 prepares the data to be transmitted in the data buffer 184 of the main memory 180 and generates a set of pointers to the data to be transmitted as PRPs 182. The control path 150 receives the host command pointer via the pointer extraction control 152 and stores the host command pointer until the host command can be executed.

[0038] In this example, pointer direction pattern detection 154 is a module of pointer extraction control 152 that can be used to analyze a host command pointer received from host computer system 170 to detect a direction pattern in the host command pointer. As described in further detail below, if a direction pattern can be detected in the host command pointer, pointer direction pattern detection 154 can store the received pointer in a reduced pointer storage structure. In some examples, pointer direction pattern detection 154 can be implemented as a hardware component of device controller 110, although in other examples, pointer direction pattern detection 154 can be implemented as firmware of device controller 110.

[0039] Pointer direction map detection 154 stores the host command pointer received from host computer system 170 in DRAM 156. In this example, DRAM 156 is shown as being external to storage device 102, however, in other examples, the host command pointer may alternatively be stored internal to storage device 102, such as in SRAM of data storage device 102.

[0040] Figure 2is a schematic diagram of a TLP 200 according to one embodiment. Figure 1 As described above, TLP 200 may include an optional TLP prefix, a TLP header, a data payload, and an optional TLP summary. The data payload is a data packet transmitted between a host (such as a host computer system 170) and a data storage device (such as a Figure 1 The data payload of TLP 200 may have an average size of about 256 bytes or a maximum size of up to about 4K or about 4,096 bytes. The TLP header includes a type field, which may indicate the type of transaction. The TLP header may have a size between about 3 double words and 4 double words, where a double word is equal to about 32 bits or 4 bytes. In addition, TLP 200 may include a data link layer, a physical layer, and additional overhead. For example, TLP 200 may include an optional end-to-end cyclic redundancy checksum (ECRC), where the ECRC has a size of about 1 double word. The values ​​listed previously are not intended to be limiting, but to provide examples of possible implementations.

[0041] The data link layer adds a sequence number and a link layer CRC (LCRC) to the TLP 200 to ensure successful transmission on the link, where the link is the data transmission between the host and the data storage device. The sequence number size can be about 2 bytes, and the LCRC size can have a size of about 1 double word. The physical layer adds information to mark the beginning and end of the TLP 200, where the information marking the beginning (i.e., "Start") has a size of about 1 byte, and the information marking the end (i.e., "End") has a size of about 1 byte. The values ​​listed previously are not intended to be limiting, but to provide examples of possible embodiments.

[0042] Figure 3 is a schematic diagram of a command 300 based on various views according to one embodiment. The command 300 has three different views, depending on where the command 300 is viewed from. The three different views include a host view, a scattered aggregate table (SGL) view, and a device view. The host view can be Figure 1 The SGL view (including the physical region page (PRP) view) is a list of commands provided to the device by the host view. The device view can be Figure 1 A view of the command 300 in the data storage device 102, such as how the data is arranged in the NVM such as Figure 1 In the memory array 160.

[0043] Command 300 includes 4 logical block addresses (LBAs): LBA#1, LBA#2, LBA#3, and LBA#4. Each of the LBAs has a size of approximately 512 bytes. In the host view, the 4 LBAs are discontinuous, as indicated by the space between LBA#3 and LBA#4. For example, in the host view, LBA#1 has address 0x0012_0000, LBA#2 has address 0x0012_0200, LBA#3 has address 0x0012_0400, and LBA#4 has address 0x0012_0800. If the 4 LBAs were contiguous, the address of LBA#4 would be 0x0012_0600 instead of 0x0012_0800. However, in the device, the 4 LBAs are contiguous, with the logical address of the next LBA following the logical address of the previous LBA. For example, LBA#1 has an address of 0x0000_8000, LBA#2 has an address of 0x0000_8800, LBA#3 has an address of 0x0000_C000, and LBA#4 has an address of 0x0000_4000.

[0044] The SGL view includes 4 entries, where the first entry is LBA#1, the second entry is LBA#2 and LBA#3, and the third and fourth entries are LBA#4. When data is transferred between the host and the device, the data can be transferred at the maximum TLP size, where in this example, the maximum TLP size is about 256 bytes. For example, when the first entry is transferred, the first entry is transferred with 2 TLPs. Similarly, when the second entry is transferred, the second entry is transferred with 4 TLPs.

[0045] However, when LBA#4 is transmitted, the transmission can occur in 3 transmissions or 2 transmissions. In the first example, the transmission occurs in 3 transmissions, where the first transmission is 256 bytes, the second transmission is 254 bytes, and the third transmission is 2 bytes. The first transmission and the second transmission are transmissions associated with the third SGL entry. Instead of performing 3 transmissions (where each transmission has TLP header information and other overhead), 2 transmissions would be sufficient if the 3rd transmission is continuous and uninterrupted with the 2nd transmission. More specifically, the third address is the next address after the second address, so the third address is continuous and uninterrupted with the second address. For example, the first transmission can be 256 bytes and the second transmission can be 256 bytes, where the second transmission includes 254 bytes from the third SGL entry and 2 bytes from the fourth SGL entry. By having a minimum transmission amount, bandwidth can be used more efficiently.

[0046] Figure 4 is a schematic block diagram of data transmission to a host device according to one embodiment. A data storage device, such as Figure 1 The data storage device 102 includes a controller 404 that interacts with a DMA 406. The controller 404 may be Figure 1 Controller 404 utilizes the PRP list and the SRAM buffer list to determine where the data is stored or will be stored in SRAM 408 or any other memory device of the data storage device. It should be understood that the SRAM buffer list is used as an example in the current figure, and the buffer list can be any suitable internal buffer list to track the location of data stored in the data storage device. In addition, when a command such as a read command is received from the host device 402, DMA 406 can generate one or more requests associated with the received command. For example, the received command can be associated with 4 generated requests.

[0047] The controller 404 activates the DMA 406 to read data associated with the one or more generated requests associated with the host command from the SRAM 408 or any other memory and write the related data back to the host 402. The DMA 406 passes the data associated with the one or more generated requests to the merge buffer 410, where the passed data is merged with any data having sequential logical addresses with the data located in the merge buffer 410.

[0048] For example, if the data in the merge buffer has a logical address of 0x000_8000, such as Figure 3 0x0000_8800. When an LBA with a sequential logical address is received at the merge buffer 410, the previous LBA and the received LBA are merged. However, when the received LBA is not sequential with the previous LBA, the previous LBA is written to the host and the received LBA is programmed to the merge buffer 410.

[0049] The controller 404 utilizes a timer 412 to ensure that the generated request or merged request does not remain in the merge buffer 410 longer than a time threshold. The timer 412 can be a separate timer for the last generated request received at the merge buffer and / or a timer for the merged request. When the timer 412 reaches the time threshold, the generated request or merged request in the merge buffer 410 is written to the host 402. The time threshold can be a timeout counter, such as when the timer 412 reaches the time threshold, the generated request or merged request has timed out. It is contemplated that the data storage device may include more than one merge buffer, such that each of the merge buffers has a timer associated with the generated request or merged request stored in the relevant merge buffer.

[0050] Figure 5A is a method 500 showing optimizing storage of generated requests in a buffer according to one embodiment. At block 502, when a data storage device (such as Figure 1 The data storage device 102 attempts to send a request to a host such as Figure 1 The method 500 begins when a host computer system 170 (of the embodiment of the present invention) sends data associated with a new command. It should be understood that although data storage device to host transactions are exemplified, the embodiments herein are applicable to reciprocating transactions, such as host to data storage device transactions. In addition, the data can be retrieved or stored in any applicable location in the data storage device, such as non-volatile memory or volatile memory.

[0051] At block 504, the “previous request” buffer is cleared so that the buffer (such as Figure 4 The generated request or merged request in the merge buffer 410 of the previous request buffer may be written to the corresponding location. The "previous request" buffer may be the generated request or merged request stored in the merge buffer. After the "previous request" is cleared from the buffer, the newly generated request associated with the new command is stored in the buffer.

[0052] At block 506, a timeout counter is initialized, where the timeout counter may be Figure 4 In some examples, the timeout counter counts only while one or more requests or merged requests are in the buffer. For example, when the buffer is empty, the timeout counter is not incremented or initialized. At block 508, the controller determines whether the data storage device has been received from a host device (such as from Figure 1 The controller receives a request for additional generation at the host computer system 170 of the buffer. If the controller determines at block 508 that a request for additional generation has not been sent, the controller determines at block 510 whether a maximum threshold of the timeout counter has been reached or exceeded. The maximum threshold may be a configurable value based on the data flow to and from the buffer.

[0053] If the controller determines at block 510 that the timeout counter has not been reached, the controller waits for additional generated requests to arrive at block 508. However, if the timeout has been reached at block 510, the controller sends a merge request of the one or more generated requests stored in the buffer to the host device at block 512. After sending the merge request of the one or more generated requests stored in the buffer at block 512, the buffer is cleared at block 504. In the description herein, for exemplary purposes, a merge request may refer to a merge request of one or more requests or one or more generated requests.

[0054] If the controller determines at block 508 that an additional generated request has been received, the controller determines at block 514 whether there is a "previous request" in the buffer. The "previous request" may be a merged request of one or more generated requests in the buffer. If the controller determines at block 514 whether there is a "previous request" in the buffer, the controller determines at block 516 whether the logical address of the start of the additional new one or more generated requests is continuous with the logical address of the end of the "previous request".

[0055] For example, the controller may determine whether BUFFER.START plus BUFFER.LENGTH equals NEW.START, where BUFFER.START is the starting logical address of the request stored in the buffer, where BUFFER.LENGTH is the length of the request stored in the buffer, and where NEW.START is the logical address to which the new request is appended. When BUFFER.START+BUFFER.LENGTH=NEW.START, the logical addresses are continuous. However, when BUFFER.START+BUFFER.LENGTH≠NEW.START, the logical addresses are not continuous.

[0056] When the controller determines at block 516 that the logical addresses are not continuous, the controller sends the previous merged request stored in the buffer to the host and pushes the additional new request to the buffer at block 524. A timeout counter is initialized at block 506 for the additional new request stored in the buffer at block 524.

[0057] However, if the controller determines at block 516 that the logical addresses are consecutive, then at block 518, the previous request or merged request stored in the buffer is merged with the appended newly generated request so that the total size of the merged request is a combination of the size of the previous request or merged request and the size of the appended newly generated request. After merging the requests in the buffer at block 518, a timeout counter is initialized at block 506 for the merged request with the updated total length.

[0058] If the controller determines at block 514 that there is no "previous request" in the buffer, the controller determines at block 520 whether the newly generated request fills the entire buffer, such as when each buffer has a size equal to the maximum TLP size of about 256 bytes. If the controller determines at block 520 that the newly generated request does not fill the entire buffer, the newly generated request is sent to the buffer at block 522. A timeout counter is initialized at block 506 for the newly generated request stored in the buffer at block 522.

[0059] However, if the controller determines at block 520 that the newly generated request fills the entire buffer, the newly generated request is sent from the buffer at a size equal to the maximum TLP size and the remaining data is pushed to the buffer at block 524. A timeout counter is initialized at block 506 for the remaining data stored in the buffer at block 524.

[0060] Figure 5B According to one embodiment, the update Figure 5A Method 550 of merging requests in a buffer. Method 550 shows Figure 5A At block 518 of , the merged request length is updated. At block 552, the previously generated request ( Figure 5A The previously generated request in the new request) and the newly generated request ( Figure 5A The controller determines whether the merge request is larger than the maximum TLP size at block 554. If the merge request is not larger than the TLP size at block 554, the method 550 exits to block 506 of the method 500 at block 560, where a timeout counter is initialized for the merge request.

[0061] However, if the merged request is larger than the maximum TLP size at box 554, the data associated with the merged request is sent to the target address, such as a host, at the maximum TLP size. For example, the maximum TLP size may be 256 bytes. The maximum TLP size may be referred to as the maximum payload size (MPS), so that the request sent is the size of the MPS. The size of the request sent to the target address may be a request associated with the start logical address BUFFER.START to the next logical address of the maximum TLP size. For example, if the merged request has a size of about 510 bytes and the maximum TLP size is about 256 bytes, the data sent is the first 256 bytes (i.e., bytes 1-256), with the remaining 254 bytes (i.e., bytes 257-510) remaining in the buffer.

[0062] At block 558, the new start logical address NEW.START of the merge request is updated, where NEW.START is defined as BUFFER.START+BUFFER.LENGTH-TLP.SIZE=NEW.START. For example, if BUFFER.START is 0, BUFFER.LENGTH is about 510 bytes, and TLP.SIZE is 256, then NEW.START is the logical address corresponding to the 257th byte (which is NEW.START=256), where the remaining total merged data has a size of about 254 bytes. After determining the new start logical address, method 550 returns to block 554 and repeats the process until the merge request is less than the maximum TLP size and exits method 550 at block 560.

[0063] Figure 6 is a method 600 showing the updating of weight values ​​according to one embodiment. The weight value adjusts the maximum threshold of the timeout counter, such as Figure 4 The timeout counter utilized by the timer 412 of FIG. 41 is a timeout counter. When the maximum threshold of the timeout counter decreases, requests are pushed and / or merged from the buffer earlier than when the maximum threshold of the timeout counter increases. Similarly, when the weight value decreases, the maximum threshold decreases, and vice versa. When the controller identifies a buffer (such as Figure 4 The method 600 begins at block 602 when the merge buffer 410 receives one or more newly generated requests associated with a received host command.

[0064] At box 604, the weight value is initialized to a first value of 50. The weight value may have a lower boundary or threshold of about 0 and an upper boundary or threshold of about 100. The values ​​listed previously are not intended to be limiting, but to provide examples of possible implementations. The boundaries illustrate the minimum and maximum values ​​to which the weight value can be adjusted when receiving multiple requests with consecutive logical addresses. When the weight value becomes closer to the lower boundary, the controller may focus on the transmission delay of the command, such as by reducing the waiting time between transmissions. When the weight value becomes closer to the upper boundary, the controller may focus on the transmission bandwidth of the command, such as by increasing the waiting time so that multiple requests can be merged. In addition, at box 604, the controller limits the length of the short command. For example, the short command may have a maximum size value or maximum length of about 4,096 bytes. It should be understood that although initializing the weight value and defining the length of the short command are shown as one step, the initialization and definition can be performed in separate steps and in any order.

[0065] At block 606, the controller waits for a request to be received by a host device such as Figure 1The controller receives a command sent by a host computer system 170 of the present invention. After receiving the command at box 606, the controller determines whether the received command is a short command at box 608. If the command received at box 608 is a short command, the weight value is reduced by "z" at box 610. The "z" value is the minimum value to which the weight value can be reduced, such as 1. However, if the command received at box 608 is not a short command, the weight value is increased by a function of the size of the command received.

[0066] The results of the function may be further constrained by max and min values ​​defined as max(x, min(y, f(s))), where f(s) is, for example, the size of the command divided by the definition of a "short command size." For example, if the short command size is 4,096 bytes, a command of 8,196 bytes would have an f(s) of 2. The min function may be used to increase the f(s) value, and the max function may be used to decrease the f(s) value, such as when f(s) does not satisfy x≥f(s)≥y. After increasing or decreasing the weight value, the method 600 returns to block 606, where the controller waits for the controller to receive another command, where the weight value of the timer is recalibrated.

[0067] It will be appreciated that each buffer will have a corresponding timer. The timer may be restarted when a new request enters the buffer or when a merged request is pushed out of the buffer. The timer has a weighted limit that depends on the amount of traffic present. For example, if there are many small transactions, the traffic is referred to as "random", while if there are fewer longer transactions, the traffic is referred to as "sequential". The more sequential the traffic, the more time available to wait for new requests, and the greater the likelihood of merged requests. The more random the traffic, the less time available to wait for new requests.

[0068] By dynamically adjusting the timer to account for commands of different sizes, the overhead associated with transmitting commands between the host device and the data storage device can be optimized, thereby increasing bandwidth and reducing latency, or vice versa. By combining consecutive addresses, TLPs can be more efficiently utilized, thereby improving bandwidth.

[0069] In one embodiment, a data storage device includes a memory device and a controller coupled to the memory device. The controller is configured to receive a new command, generate one or more requests associated with the new command, determine whether the start of the newly generated one or more requests is continuous with the end of a previous request or a merged request stored in a buffer, and update the length of the previous request or the merged request stored in the buffer to include the new length of the newly generated one or more requests, or send the previous request or the merged request from the buffer and push the newly generated one or more requests to the buffer.

[0070] Determining includes checking a first logical address of the end of a previous request or a merged request, and checking a second logical address of the start of one or more newly generated requests. Updating includes merging the first size of the previous request or the merged request and the second size of the newly generated one or more requests if the start of the newly generated one or more requests is continuous with the end of the previous request or the merged request. Sending includes transmitting a portion of the previous request or the merged request at a size equal to the maximum TLP size. Determining includes checking a timeout counter of the previous request or the merged request. Each buffer has a corresponding timeout counter. The maximum threshold of the timeout counter is determined by a weight value of the timer. If the new command has a size greater than the maximum size value, the weight value increases, and if the new command has a size less than the maximum size value, the weight value decreases. The controller is further configured to send the previous request or the merged request from the buffer and push the newly generated one or more requests to the buffer when it is determined that the maximum threshold will be exceeded.

[0071] In another embodiment, a data storage device includes a memory device and a controller coupled to the memory device. The controller is configured to initialize a weight value, wherein the weight value affects a maximum threshold of a timeout counter, define a maximum size value of a received command, receive a new command, determine whether the received new command is greater than or less than the maximum size value of the received command, adjust the weight value based on the determination, adjust the maximum threshold of the timeout counter, and define an MPS.

[0072] The weight value is initialized to a first value of 50. The weight value has a minimum threshold of approximately 0 and a maximum threshold of approximately 100. Adjusting the weight value includes decreasing the weight value by "z" if the received new command is less than the maximum size value of the received command, and increasing the weight value by a max function if the received new command is greater than the maximum size value of the received command. "z" is the minimum value to decrease the weight value. The max function is max(x, min(y, f(s))). "x" is the minimum value to increase the weight value. "min(y, f(s))" is the minimum value to increase the weight value. "f(s)" is the size of the new command divided by the maximum size value.

[0073] Adjusting the maximum threshold of the timeout counter includes reducing the maximum threshold when the weight value decreases, and increasing the maximum threshold when the weight value increases. Reducing the maximum threshold reduces the time that the request or merged request is stored in the buffer, and increasing the maximum threshold increases the time that the request or merged request is stored in the buffer. When the maximum threshold is exceeded, the request or merged request is sent from the buffer. When the maximum threshold is not exceeded, the request or merged request is merged with the previous request or previous merged request in the buffer. The maximum size value of the received command is the size of a short command. The request or merged request is sent from the buffer at MPS. The first logical address of the previous request and the second logical address of the request are consecutive.

[0074] In another embodiment, a data storage device includes a memory device and a controller coupled to the memory device. The controller includes means for determining whether a new request is continuous with a previous request or a merged request stored in a buffer, and means for adjusting a timeout counter based on data traffic.

[0075] The device for determining when a new request is consecutive to a previous request or a merged request includes a device for merging the new request with the previous request or the merged request stored in the buffer. The device for adjusting the timeout counter includes a device for initializing a weight value, wherein the weight value is adjusted based on the incoming command; a device for determining a maximum size value of the received command; a device for determining whether the incoming command is greater than or less than the maximum size value; and a device for increasing the weight value if the incoming command is greater than the maximum size value, wherein increasing the weight value increases the maximum threshold, or a device for decreasing the weight value if the incoming command is less than the maximum size value, wherein decreasing the weight value decreases the maximum threshold. The controller also includes a device for sending the previous request or the merged request from the buffer at a size equal to the maximum transport layer packet (TLP) size. The maximum TLP size is equal to the maximum payload size. Exceeding the maximum threshold includes sending the previous request or the merged request from the buffer.

[0076] While the foregoing is directed to embodiments of the present disclosure, other and further embodiments of the present disclosure may be envisaged without departing from the basic scope of the present disclosure, and the scope of the present disclosure is determined by the appended claims.

Claims

1. A data storage device, comprising: Memory devices; and a controller coupled to the memory device; The controller is configured to: Receive new commands; generating one or more requests associated with the new command; determining whether a start of the newly generated one or more requests is consecutive to an end of a previous request or a merged request stored in a buffer, wherein the determining includes checking a timeout counter of the previous request or the merged request, and wherein each buffer has a corresponding timeout counter; as well as Do any of the following: updating the length of the previous request or the merged request stored in the buffer to include a new length of the newly generated one or more requests; or The previous request or the merged request is sent from the buffer, and the newly generated one or more requests are pushed to the buffer. 2 . The data storage device of claim 1 , wherein the determining comprises checking a logical address of the end of the previous request or the merged request and checking a second logical address of the start of the newly generated one or more requests.

3. A data storage device according to claim 1, wherein the update includes merging the first size of the previous request or the merged request and the second size of the newly generated one or more requests if the start of the newly generated one or more requests is continuous with the end of the previous request or the merged request.

4. The data storage device of claim 1 , wherein the sending comprises transmitting the previous request or a portion of the merged request in a size equal to a maximum transport layer data packet size, i.e., a maximum TLP size.

5. A data storage device according to claim 1, wherein the maximum threshold of the timeout counter is determined by a weight value of the timer, wherein if the size of the new command is greater than the maximum size value, the weight value increases, and if the size of the new command is less than the maximum size value, the weight value decreases.

6. The data storage device of claim 5, wherein the controller is further configured to send the previous request or the merged request from the buffer and push the newly generated one or more requests to the buffer when it is determined that the maximum threshold will be exceeded.

7. A data storage device, comprising: Memory devices; and a controller coupled to the memory device, the controller being configured to: Initializing a weight value, wherein the weight value affects a maximum threshold of a timeout counter; Defines the maximum size value of received commands; Receive new commands; determining whether the received new command is greater than or less than the maximum size value of the received command; adjusting the weight value based on the determination; adjusting the maximum threshold of the timeout counter; as well as Defines the maximum payload size or MPS. 8 . The data storage device of claim 7 , wherein the weight value is initialized at a first value of 50 , wherein the weight value has a minimum threshold of 0 and a maximum threshold of 100 .

9. A data storage device according to claim 7, wherein adjusting the weight value includes reducing the weight value by "z" if the new command received is smaller than the maximum size value of the received command, and increasing the weight value by a max function if the new command received is larger than the maximum size value of the received command, and wherein "z" is the minimum value used to reduce the weight value.

10. A data storage device according to claim 9, wherein the max function is max(x, min(y, f(s))), wherein "x" is the maximum value for increasing the weight value, wherein "min(y, f(s))" is the minimum value for increasing the weight value, and wherein "f(s)" is the size of the new command divided by the maximum size value. 11 . The data storage device of claim 7 , wherein adjusting the maximum threshold of the timeout counter comprises decreasing the maximum threshold when the weight value decreases, and increasing the maximum threshold when the weight value increases.

12. A data storage device according to claim 11, wherein reducing the maximum threshold reduces the time that a request or a merged request is stored in the buffer, and increasing the maximum threshold increases the time that the request or the merged request is stored in the buffer, wherein when the maximum threshold is exceeded, the request or the merged request is sent from the buffer, and wherein when the maximum threshold is not exceeded, the request or the merged request is merged with a previous request or a previous merged request in the buffer. 13 . The data storage device of claim 12 , wherein the maximum size value of the received command is a size of a short command, and wherein the request or the merged request is sent from the buffer at the MPS.

14. The data storage device of claim 12, wherein a last logical address of the previous request or the previous merged request is consecutive to a second logical address of the request or the merged request.

15. A data storage device, comprising: Memory device; and a controller coupled to the memory device, wherein the controller is configured to: determining whether a new request is consecutive to a previous request or a merged request stored in a buffer, wherein the determining comprises checking a timeout counter of the previous request or the merged request, and wherein each buffer has a corresponding timeout counter; Adjusting the timeout counter based on data traffic; as well as Do any of the following: updating the length of the previous request or the merged request stored in the buffer to include a new length of the new request; or The previous request or the merged request is sent from the buffer, and the new request is pushed to the buffer. 16 . The data storage device of claim 15 , wherein when the new request is consecutive to the previous request or the merged request, the determining comprises merging the new request with the previous request or the merged request stored in the buffer.

17. The data storage device of claim 15, wherein the controller is further configured to: The previous request or the merged request is sent from the buffer at a size equal to a maximum transport layer data packet size, ie, a maximum TLP size; wherein the maximum TLP size is equal to a maximum payload size.

18. A data storage device, comprising: Memory device; and a controller coupled to the memory device, wherein the controller is configured to: determining whether the new request is consecutive to a previous request or a merged request stored in a buffer; as well as Adjusting the timeout counter based on data traffic; The adjusting the timeout counter comprises: Initializing weight values, wherein the weight values ​​are adjusted based on the incoming commands; determining a maximum size value for a received command; determining whether the incoming command is greater than or less than the maximum size value; and Any of the following: increasing the weight value when the incoming command is greater than the maximum size value, wherein increasing the weight value increases a maximum threshold; or The weight value is decreased when the incoming command is less than the maximum size value, wherein decreasing the weight value decreases the maximum threshold value.

19. The data storage device of claim 18, wherein the previous request or the merged request is sent from the buffer when the maximum threshold is exceeded.

Citation Information

Patent Citations

  • Assigning a weighting to host quality of service indicators

    CN104008017A

  • Storage device, controller, and operating method of storage device

    CN109471817A

  • Data storage system and method for optimized scheduling of background management operations

    CN111427510A

  • Serial Buffer To Support Rapid I / O Logic Layer Out Of order Response With Data Retransmission

    US20090228630A1

  • Flexible control mechanism for store gathering in a write buffer

    US20140143471A1